Changes for page Plan Your Data Management
Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45
From version 4.11
edited by Veronika Kocher
on Thursday, 03 Sep 2026 13:04
on Thursday, 03 Sep 2026 13:04
Change comment:
There is no comment for this version
To version 4.9
edited by Veronika Kocher
on Thursday, 03 Sep 2026 9:34
on Thursday, 03 Sep 2026 9:34
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -258,100 +258,23 @@ 258 258 {{/html}} 259 259 260 260 {{html clean="false"}} 261 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START --> 262 - 263 -<style data-sn-service-navigator-master="1"> 264 -/* ========================================================= 265 - MASTER TYPOGRAPHY 266 - ========================================================= */ 267 -#xwikicontent h1, 268 -#xwikicontent h2, 269 -#xwikicontent h3, 270 -#xwikicontent h4, 271 -#xwikicontent h5, 272 -#xwikicontent h6, 273 -#xwikicontent .box-title, 274 -#xwikicontent [role="heading"], 275 -#xwikicontent h1 a, 276 -#xwikicontent h2 a, 277 -#xwikicontent h3 a, 278 -#xwikicontent h4 a, 279 -#xwikicontent h5 a, 280 -#xwikicontent h6 a, 281 -#xwikicontent .box-title a, 282 -#xwikicontent [role="heading"] a{ 283 - text-align:left!important; 284 - text-justify:auto!important; 285 - word-spacing:normal!important; 286 -} 287 - 288 -/* ========================================================= 289 - COMING SOON / IN VORBEREITUNG 290 - ========================================================= */ 291 -.sn-coming-soon-badge{ 292 - display:inline-block; 293 - vertical-align:middle; 294 - margin-left:10px; 295 - padding:4px 8px; 296 - border-radius:14px; 297 - border:1px solid #efd9cc; 298 - background:#fff4ee; 299 - color:#8a4d36; 300 - font-size:11px; 301 - font-weight:700; 302 - letter-spacing:.055em; 303 - line-height:1.2; 304 - white-space:nowrap; 305 -} 306 - 307 -/* ========================================================= 308 - NATIVE / DETAIL CALLOUT GEOMETRY 309 - Preserve existing backgrounds. 310 - ========================================================= */ 311 -#xwikicontent .arsn-info, 312 -#xwikicontent .dmp-info, 313 -#xwikicontent .ido-info, 314 -#xwikicontent .pp-info, 315 -#xwikicontent .infomessage{ 316 - box-sizing:border-box!important; 317 - border-left:4px solid #21b6d7!important; 318 - border-radius:8px; 319 - text-align:left!important; 320 - word-spacing:normal!important; 321 -} 322 - 323 -#xwikicontent .arsn-warn, 324 -#xwikicontent .dmp-warn, 325 -#xwikicontent .ido-warn, 326 -#xwikicontent .pp-warn, 327 -#xwikicontent .warn, 328 -#xwikicontent .warning, 329 -#xwikicontent .warningmessage, 330 -#xwikicontent .errormessage{ 331 - box-sizing:border-box!important; 332 - border-left:4px solid #e94b13!important; 333 - border-radius:8px; 334 - text-align:left!important; 335 - word-spacing:normal!important; 336 -} 337 - 338 -[data-sn-master-equal-height], 339 -[data-sn-master-first-row]{ 261 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_START --> 262 +<style data-sn-horizontal-box-harmonizer="4"> 263 +[data-sn-equal-height-managed], 264 +[data-sn-first-section-aligned]{ 340 340 box-sizing:border-box; 341 341 } 342 342 </style> 343 - 344 -<script data-sn-service-navigator-master="1"> 268 +<script data-sn-horizontal-box-harmonizer="4"> 345 345 (function(){ 346 346 "use strict"; 347 347 348 - var PAGE_KIND="detail"; 349 - var PLACEHOLDER=false; 350 - var PLACEHOLDER_LABEL="COMING SOON"; 351 - 352 352 var MOBILE_MAX=767; 353 353 var ROW_TOLERANCE=6; 354 - var RESIZE_DEBOUNCE=220; 274 + var MIN_W=150; 275 + var MIN_H=36; 276 + var MAX_PARENT_CHILDREN=16; 277 + var SEARCH_DEPTH=5; 355 355 356 356 var root= 357 357 document.getElementById("xwikicontent")|| ... ... @@ -361,105 +361,93 @@ 361 361 362 362 if(!root)return; 363 363 364 - var managedHeight=new Set(); 365 - var managedMargin=new Set(); 366 - var originalHeight=new WeakMap(); 367 - var originalMargin=new WeakMap(); 287 + var heightManaged=new Set(); 288 + var sectionManaged=new Set(); 289 + var originalMinHeight=new WeakMap(); 290 + var originalMarginTop=new WeakMap(); 291 + var raf=0; 368 368 369 - var resizeTimer=0; 370 - var running=false; 293 + function num(v){ 294 + var n=parseFloat(v); 295 + return Number.isFinite(n)?n:0; 296 + } 371 371 372 - var THEMES=[ 373 - { 374 - name:"BLUE", 375 - accent:"#21b6d7", 376 - bg:"#eaf7fb", 377 - text:"#315d68", 378 - labels:[ 379 - "HIER STARTEN", 380 - "ENTSCHEIDEN", 381 - "ÜBERPRÜFEN & ANPASSEN", 382 - "START HERE", 383 - "DECIDE", 384 - "REVIEW & ADAPT" 385 - ] 386 - }, 387 - { 388 - name:"RED", 389 - accent:"#e94b13", 390 - bg:"#fff1ec", 391 - text:"#8a4d36", 392 - labels:[ 393 - "PLANEN & ORGANISIEREN", 394 - "ORGANISIEREN & DOKUMENTIEREN", 395 - "PUBLIZIEREN & PRÄSENTIEREN", 396 - "PLAN & ORGANISE", 397 - "PLAN & ORGANIZE", 398 - "ORGANISE & DOCUMENT", 399 - "ORGANIZE & DOCUMENT", 400 - "PUBLISH & PRESENT" 401 - ] 402 - }, 403 - { 404 - name:"YELLOW", 405 - accent:"#f0aa00", 406 - bg:"#fff8e7", 407 - text:"#785b17", 408 - labels:[ 409 - "SCHÜTZEN & KLÄREN", 410 - "STANDARDISIEREN & IDENTIFIZIEREN", 411 - "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN", 412 - "PROTECT & CLARIFY", 413 - "STANDARDISE & IDENTIFY", 414 - "STANDARDIZE & IDENTIFY", 415 - "OPEN, REUSE & MAKE FINDABLE" 416 - ] 417 - }, 418 - { 419 - name:"GREEN", 420 - accent:"#38b76a", 421 - bg:"#edf9f1", 422 - text:"#3f7451", 423 - labels:[ 424 - "INFRASTRUKTUR EINRICHTEN", 425 - "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN", 426 - "SPEICHERN & ZUGRIFF STEUERN", 427 - "REPOSITORIUM, ERHALTEN & ÜBERGEBEN", 428 - "SET UP INFRASTRUCTURE", 429 - "SET UP INFRASTRUCTURE & COLLABORATION", 430 - "STORE & CONTROL ACCESS", 431 - "REPOSITORY, PRESERVE & HAND OVER" 432 - ] 298 + function visible(el,minW,minH){ 299 + if(!el||el.nodeType!==1)return false; 300 + 301 + var s=getComputedStyle(el); 302 + 303 + if( 304 + s.display==="none"|| 305 + s.visibility==="hidden"|| 306 + Number(s.opacity)===0 307 + ){ 308 + return false; 433 433 } 434 - ]; 435 435 436 - function num(value){ 437 - var n=parseFloat(value); 438 - return Number.isFinite(n)?n:0; 311 + var r=el.getBoundingClientRect(); 312 + 313 + return ( 314 + r.width>=(minW||1)&& 315 + r.height>=(minH||1) 316 + ); 439 439 } 440 440 441 - function norm(value){ 442 - return String(value||"") 443 - .replace(/\s+/g," ") 444 - .trim() 445 - .toUpperCase(); 319 + function excluded(el){ 320 + return ( 321 + !el.matches|| 322 + el.matches( 323 + "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]" 324 + ) 325 + ); 446 446 } 447 447 448 - function visible(el){ 449 - if(!el||el.nodeType!==1)return false; 328 + function namedLikeBox(el){ 329 + var c= 330 + typeof el.className==="string" 331 + ? el.className 332 + : ""; 450 450 451 - var style=getComputedStyle(el);452 - var rect=el.getBoundingClientRect();334 + return /(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c); 335 + } 453 453 337 + function boxLike(el){ 338 + if(!visible(el,MIN_W,MIN_H)||excluded(el))return false; 339 + 340 + var s=getComputedStyle(el); 341 + var r=el.getBoundingClientRect(); 342 + 343 + var border= 344 + num(s.borderTopWidth)+ 345 + num(s.borderRightWidth)+ 346 + num(s.borderBottomWidth)+ 347 + num(s.borderLeftWidth); 348 + 349 + var radius=Math.max( 350 + num(s.borderTopLeftRadius), 351 + num(s.borderTopRightRadius), 352 + num(s.borderBottomLeftRadius), 353 + num(s.borderBottomRightRadius) 354 + ); 355 + 356 + var bg= 357 + s.backgroundColor&& 358 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&& 359 + s.backgroundColor!=="transparent"; 360 + 361 + var shadow= 362 + s.boxShadow&& 363 + s.boxShadow!=="none"; 364 + 454 454 return ( 455 - style.display!=="none"&&456 - style.visibility!=="hidden"&&457 - r ect.width>20&&458 - r ect.height>4366 + namedLikeBox(el)|| 367 + border>=1|| 368 + (bg&&radius>=3)|| 369 + (shadow&&r.width>=180) 459 459 ); 460 460 } 461 461 462 - function save Style(el,map,property){373 + function saveOriginal(el,map,property){ 463 463 if(map.has(el))return; 464 464 465 465 map.set(el,{ ... ... @@ -468,7 +468,7 @@ 468 468 }); 469 469 } 470 470 471 - function restore Style(el,map,property){382 + function restoreOriginal(el,map,property){ 472 472 var original=map.get(el); 473 473 474 474 if(original&&original.value){ ... ... @@ -482,249 +482,247 @@ 482 482 } 483 483 } 484 484 485 - function reset Runtime(){486 - managedHeight.forEach(function(el){487 - restore Style(396 + function reset(){ 397 + heightManaged.forEach(function(el){ 398 + restoreOriginal( 488 488 el, 489 - originalHeight, 400 + originalMinHeight, 490 490 "min-height" 491 491 ); 403 + 492 492 el.removeAttribute( 493 - "data-sn- master-equal-height"405 + "data-sn-equal-height-managed" 494 494 ); 495 495 }); 496 496 497 - managedMargin.forEach(function(el){498 - restore Style(409 + sectionManaged.forEach(function(el){ 410 + restoreOriginal( 499 499 el, 500 - originalMargin, 412 + originalMarginTop, 501 501 "margin-top" 502 502 ); 415 + 503 503 el.removeAttribute( 504 - "data-sn- master-first-row"417 + "data-sn-first-section-aligned" 505 505 ); 506 506 }); 507 507 508 - managedHeight.clear();509 - managedMargin.clear();421 + heightManaged.clear(); 422 + sectionManaged.clear(); 510 510 } 511 511 512 - function themeFor(text){513 - v ar value=norm(text);425 + function pickTarget(child){ 426 + if(!visible(child,MIN_W,MIN_H))return null; 514 514 515 - for(var i=0;i<THEMES.length;i++){ 516 - for(var j=0;j<THEMES[i].labels.length;j++){ 517 - var label=THEMES[i].labels[j]; 518 - 519 - if( 520 - value===label|| 521 - value.indexOf(label+" ")===0|| 522 - value.indexOf(label+" -")===0|| 523 - value.indexOf(label+" ·")===0 524 - ){ 525 - return THEMES[i]; 526 - } 527 - } 428 + if(boxLike(child)){ 429 + return child; 528 528 } 529 529 530 - retu rnnull;531 - }432 + var cr=child.getBoundingClientRect(); 433 + var q=[]; 532 532 533 - /*=======================================================534 - PLACEHOLDERBADGE535 - ======================================================= */435 + Array.from(child.children||[]).forEach(function(el){ 436 + q.push({el:el,depth:1}); 437 + }); 536 536 537 - functionapplyPlaceholderBadge(){538 - if(!PLACEHOLDER)return;439 + var best=null; 440 + var bestScore=-Infinity; 539 539 540 - if( 541 - document.querySelector( 542 - ".sn-coming-soon-badge" 543 - ) 544 - ){ 545 - return; 546 - } 442 + while(q.length){ 443 + var item=q.shift(); 444 + var el=item.el; 547 547 548 - var title= 549 - document.querySelector( 550 - "#document-title" 551 - )|| 552 - document.querySelector( 553 - "h1" 554 - ); 446 + if(!visible(el,MIN_W,MIN_H))continue; 555 555 556 - if(!title)return;448 + var r=el.getBoundingClientRect(); 557 557 558 - var badge= 559 - document.createElement( 560 - "span" 561 - ); 450 + if( 451 + r.width>=cr.width*.68&& 452 + boxLike(el) 453 + ){ 454 + var widthFit= 455 + 1-Math.min( 456 + 1, 457 + Math.abs(cr.width-r.width)/ 458 + Math.max(1,cr.width) 459 + ); 562 562 563 - badge.className= 564 - "sn-coming-soon-badge"; 461 + var topFit= 462 + 1-Math.min( 463 + 1, 464 + Math.abs(cr.top-r.top)/100 465 + ); 565 565 566 - badge.textContent= 567 - PLACEHOLDER_LABEL; 467 + var score= 468 + widthFit*6+ 469 + topFit*3+ 470 + Math.min(r.height,900)/450+ 471 + Math.min(r.width*r.height,900000)/900000; 568 568 569 - badge.setAttribute( 570 - "aria-label", 571 - PLACEHOLDER_LABEL 572 - ); 473 + if(score>bestScore){ 474 + best=el; 475 + bestScore=score; 476 + } 477 + } 573 573 574 - title.appendChild( 575 - badge 576 - ); 479 + if(item.depth<SEARCH_DEPTH){ 480 + Array.from(el.children||[]).forEach(function(next){ 481 + q.push({ 482 + el:next, 483 + depth:item.depth+1 484 + }); 485 + }); 486 + } 487 + } 488 + 489 + return best; 577 577 } 578 578 579 - /* ======================================================= 580 - DETAIL PAGE OWN-ACCENT PROPAGATION 581 - ======================================================= */ 492 + function groupsByVisualRow(entries){ 493 + var groups=[]; 582 582 583 - function parseRGB(value){ 584 - var match=String(value||"").match( 585 - /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 586 - ); 495 + entries 496 + .slice() 497 + .sort(function(a,b){ 498 + return ( 499 + a.rect.top-b.rect.top|| 500 + a.rect.left-b.rect.left 501 + ); 502 + }) 503 + .forEach(function(entry){ 504 + var group=null; 587 587 588 - if(!match)return null; 506 + for(var i=0;i<groups.length;i++){ 507 + if( 508 + Math.abs( 509 + groups[i].top- 510 + entry.rect.top 511 + )<=ROW_TOLERANCE 512 + ){ 513 + group=groups[i]; 514 + break; 515 + } 516 + } 589 589 590 - return [ 591 - Number(match[1]), 592 - Number(match[2]), 593 - Number(match[3]) 594 - ]; 595 - } 518 + if(!group){ 519 + group={ 520 + top:entry.rect.top, 521 + entries:[] 522 + }; 523 + groups.push(group); 524 + } 596 596 597 - function distance(a,b){ 598 - return Math.sqrt( 599 - Math.pow(a[0]-b[0],2)+ 600 - Math.pow(a[1]-b[1],2)+ 601 - Math.pow(a[2]-b[2],2) 602 - ); 526 + group.entries.push(entry); 527 + }); 528 + 529 + return groups; 603 603 } 604 604 605 - function paletteMatch(cssColor){606 - var rgb=parseRGB(cssColor);532 + function validHorizontalGroup(group){ 533 + if(group.entries.length<2)return false; 607 607 608 - if(!rgb)return null; 535 + var lefts= 536 + group.entries 537 + .map(function(e){return e.rect.left;}) 538 + .sort(function(a,b){return a-b;}); 609 609 610 - var palette=[ 611 - {hex:"#21b6d7",rgb:[33,182,215]}, 612 - {hex:"#e94b13",rgb:[233,75,19]}, 613 - {hex:"#f0aa00",rgb:[240,170,0]}, 614 - {hex:"#38b76a",rgb:[56,183,106]} 615 - ]; 540 + if( 541 + lefts[lefts.length-1]- 542 + lefts[0]< 543 + 80 544 + ){ 545 + return false; 546 + } 616 616 617 - var best=null; 618 - var bestDistance=Infinity; 548 + var widths= 549 + group.entries 550 + .map(function(e){return e.rect.width;}) 551 + .filter(function(w){return w>0;}); 619 619 620 - palette.forEach(function(item){ 621 - var d=distance(rgb,item.rgb); 553 + if(widths.length<2)return false; 622 622 623 - if(d<bestDistance){ 624 - best=item; 625 - bestDistance=d; 626 - } 627 - }); 555 + var minWidth=Math.min.apply(Math,widths); 556 + var maxWidth=Math.max.apply(Math,widths); 628 628 629 - return bestDistance<=30 630 - ?best 631 - :null; 558 + return ( 559 + maxWidth/ 560 + Math.max(1,minWidth)<= 561 + 1.9 562 + ); 632 632 } 633 633 634 - function propagateDetailAccents(){ 635 - if(PAGE_KIND!=="detail")return; 565 + function normalizeText(text){ 566 + return String(text||"") 567 + .replace(/s+/g," ") 568 + .trim() 569 + .toUpperCase(); 570 + } 636 636 572 + function exactKnownFirstSection(el){ 573 + var text=normalizeText(el.textContent); 574 + 575 + return ( 576 + text==="HIER STARTEN"|| 577 + text==="ORGANISIEREN & DOKUMENTIEREN"|| 578 + text==="ENTSCHEIDEN"|| 579 + text==="START HERE"|| 580 + text==="GET STARTED"|| 581 + text==="ORGANISE & DOCUMENT"|| 582 + text==="ORGANIZE & DOCUMENT"|| 583 + text==="DECIDE" 584 + ); 585 + } 586 + 587 + function visuallyFirstSectionBar(card){ 588 + var cardRect=card.getBoundingClientRect(); 589 + var candidates=[]; 590 + 637 637 Array.from( 638 - root.querySelectorAll( 639 - ".arsn-call,.dmp-call,.ido-call,.pp-call,"+ 640 - ".arsn-source,.dmp-source,.ido-source,.pp-source" 592 + card.querySelectorAll( 593 + "div,p,span,strong,h3,h4,h5,h6" 641 641 ) 642 642 ).forEach(function(el){ 643 - if(!visible(el))return; 596 + if(!visible(el,20,6))return; 597 + if(excluded(el))return; 644 644 645 - var style=getComputedStyle(el); 599 + var r=el.getBoundingClientRect(); 600 + var relativeTop=r.top-cardRect.top; 646 646 647 647 if( 648 - num(style.borderTopWidth)>=2 603 + relativeTop<45|| 604 + relativeTop>cardRect.height*.72 649 649 ){ 650 - var match= 651 - paletteMatch( 652 - style.borderTopColor 653 - ); 654 - 655 - if(match){ 656 - el.style.setProperty( 657 - "border-left", 658 - "4px solid "+match.hex, 659 - "important" 660 - ); 661 - } 606 + return; 662 662 } 663 - }); 664 664 665 - // Warning families: explicit safety override. 666 - Array.from( 667 - root.querySelectorAll( 668 - ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+ 669 - ".warn,.warning,.warningmessage,.errormessage" 670 - ) 671 - ).forEach(function(el){ 672 - if(!visible(el))return; 609 + var widthRatio= 610 + r.width/ 611 + Math.max(1,cardRect.width); 673 673 674 - el.style.setProperty( 675 - "border-left", 676 - "4px solid #e94b13", 677 - "important" 678 - ); 679 - }); 613 + if( 614 + widthRatio<.55|| 615 + widthRatio>1.05|| 616 + r.height>54 617 + ){ 618 + return; 619 + } 680 680 681 - // Info families: explicit orientation override. 682 - Array.from( 683 - root.querySelectorAll( 684 - ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage" 685 - ) 686 - ).forEach(function(el){ 687 - if(!visible(el))return; 621 + var text=normalizeText(el.textContent); 688 688 689 - el.style.setProperty( 690 - "border-left", 691 - "4px solid #21b6d7", 692 - "important" 693 - ); 694 - }); 695 - } 623 + if( 624 + text.length<2|| 625 + text.length>90 626 + ){ 627 + return; 628 + } 696 696 697 - /* ======================================================= 698 - OVERVIEW SEMANTIC THEME PALETTE 699 - ======================================================= */ 630 + var style=getComputedStyle(el); 700 700 701 - function smallestThemeHeaders(){ 702 - return Array.from( 703 - root.querySelectorAll( 704 - "div,span,p,strong,h3,h4,h5,h6" 705 - ) 706 - ).filter(function(el){ 707 - if(!visible(el))return false; 708 - if(!themeFor(el.textContent))return false; 632 + var bg= 633 + style.backgroundColor&& 634 + style.backgroundColor!=="rgba(0, 0, 0, 0)"&& 635 + style.backgroundColor!=="transparent"; 709 709 710 - return !Array.from( 711 - el.children||[] 712 - ).some(function(child){ 713 - return !!themeFor( 714 - child.textContent 715 - ); 716 - }); 717 - }); 718 - } 719 - 720 - function findOverviewCard(header){ 721 - var node=header.parentElement; 722 - var candidates=[]; 723 - 724 - while(node&&node!==root){ 725 - var rect=node.getBoundingClientRect(); 726 - var style=getComputedStyle(node); 727 - 728 728 var border= 729 729 num(style.borderTopWidth)+ 730 730 num(style.borderRightWidth)+ ... ... @@ -731,674 +731,315 @@ 731 731 num(style.borderBottomWidth)+ 732 732 num(style.borderLeftWidth); 733 733 734 - if( 735 - rect.width>=220&& 736 - rect.width<=800&& 737 - rect.height>=120&& 738 - border>=1 739 - ){ 740 - candidates.push(node); 741 - } 643 + var mostlyUpper= 644 + text.length>=3&& 645 + text===text.toUpperCase(); 742 742 743 - node=node.parentElement; 744 - } 647 + var exact=exactKnownFirstSection(el); 745 745 746 - if(!candidates.length)return null; 649 + var score= 650 + (exact?20:0)+ 651 + (bg?6:0)+ 652 + (border>=1?2:0)+ 653 + (mostlyUpper?4:0)+ 654 + (num(style.fontWeight)>=600?1:0); 747 747 748 - candidates.sort(function(a,b){ 749 - return ( 750 - b.getBoundingClientRect().height- 751 - a.getBoundingClientRect().height 752 - ); 656 + if(score>=7){ 657 + candidates.push({ 658 + el:el, 659 + relativeTop:relativeTop, 660 + width:r.width, 661 + score:score 662 + }); 663 + } 753 753 }); 754 754 755 - return candidates[0]; 756 - } 666 + if(!candidates.length)return null; 757 757 758 - function rowCandidates(link,card){ 759 - var result=[]; 760 - var cardRect= 761 - card.getBoundingClientRect(); 762 - 763 - var node=link; 764 - 765 - while(node&&node!==card){ 766 - if(visible(node)){ 767 - var rect= 768 - node.getBoundingClientRect(); 769 - 770 - if( 771 - rect.height<=105&& 772 - rect.width>= 773 - cardRect.width*.50&& 774 - rect.width<= 775 - cardRect.width*1.03 776 - ){ 777 - result.push(node); 778 - } 668 + candidates.sort(function(a,b){ 669 + if(a.score!==b.score)return b.score-a.score; 670 + if(Math.abs(a.relativeTop-b.relativeTop)>3){ 671 + return a.relativeTop-b.relativeTop; 779 779 } 673 + return b.width-a.width; 674 + }); 780 780 781 - node=node.parentElement; 782 - } 676 + // For exact known labels always prefer the earliest exact match. 677 + var exacts=candidates.filter(function(c){ 678 + return exactKnownFirstSection(c.el); 679 + }); 783 783 784 - return result; 785 - } 786 - 787 - function chooseOuterRow( 788 - candidates, 789 - link 790 - ){ 791 - if(!candidates.length){ 792 - return link; 681 + if(exacts.length){ 682 + exacts.sort(function(a,b){ 683 + return a.relativeTop-b.relativeTop||b.width-a.width; 684 + }); 685 + return exacts[0].el; 793 793 } 794 794 795 - var bordered= 796 - candidates.filter(function(el){ 797 - return ( 798 - num( 799 - getComputedStyle(el) 800 - .borderLeftWidth 801 - )>=1 802 - ); 803 - }); 688 + // Generic fallback: earliest high-confidence bar. 689 + candidates.sort(function(a,b){ 690 + return a.relativeTop-b.relativeTop||b.score-a.score||b.width-a.width; 691 + }); 804 804 805 - var pool= 806 - bordered.length 807 - ?bordered 808 - :candidates; 693 + return candidates[0].el; 694 + } 809 809 810 - pool.sort(function(a,b){ 811 - var ar= 812 - a.getBoundingClientRect(); 696 + function alignFirstSections(cards){ 697 + var rows= 698 + cards.map(function(card){ 699 + var bar= 700 + visuallyFirstSectionBar(card); 813 813 814 - var br= 815 - b.getBoundingClientRect(); 702 + if(!bar)return null; 816 816 817 - return ( 818 - ar.left-br.left|| 819 - br.width-ar.width 820 - ); 821 - }); 704 + var cardRect= 705 + card.getBoundingClientRect(); 822 822 823 - ret urn pool[0]||link;824 - }707 + var barRect= 708 + bar.getBoundingClientRect(); 825 825 826 - function applyOverviewPalette(){ 827 - if(PAGE_KIND!=="overview"){ 828 - return []; 710 + return { 711 + card:card, 712 + bar:bar, 713 + relativeTop: 714 + barRect.top-cardRect.top, 715 + label: 716 + normalizeText(bar.textContent) 717 + }; 718 + }); 719 + 720 + // Conservative: only align when every card in the horizontal row 721 + // has a reliable first section bar. 722 + if( 723 + rows.some(function(row){ 724 + return !row; 725 + }) 726 + ){ 727 + return null; 829 829 } 830 830 831 - var headers= 832 - smallestThemeHeaders() 833 - .map(function(el){ 834 - return { 835 - el:el, 836 - theme: 837 - themeFor( 838 - el.textContent 839 - ), 840 - card: 841 - findOverviewCard( 842 - el 843 - ) 844 - }; 730 + var targetTop= 731 + Math.max.apply( 732 + Math, 733 + rows.map(function(row){ 734 + return row.relativeTop; 845 845 }) 846 - .filter(function(row){ 847 - return !!row.card; 848 - }); 736 + ); 849 849 850 - var unique=[]; 851 - var seenHeaders=new Set(); 738 + rows.forEach(function(row){ 739 + var delta= 740 + targetTop- 741 + row.relativeTop; 852 852 853 - headers.forEach(function(row){ 854 - var key= 855 - row.theme.name+ 856 - "|"+ 857 - Math.round( 858 - row.card 859 - .getBoundingClientRect() 860 - .left 861 - )+ 862 - "|"+ 863 - Math.round( 864 - row.el 865 - .getBoundingClientRect() 866 - .top 867 - ); 743 + if(delta<=1)return; 868 868 869 - if(!seenHeaders.has(key)){ 870 - seenHeaders.add(key); 871 - unique.push(row); 872 - } 873 - }); 874 - 875 - unique.forEach(function(row){ 876 - var headerRect= 877 - row.el 878 - .getBoundingClientRect(); 879 - 880 - row.el.style.setProperty( 881 - "background", 882 - row.theme.bg, 883 - "important" 745 + saveOriginal( 746 + row.bar, 747 + originalMarginTop, 748 + "margin-top" 884 884 ); 885 885 886 - row.el.style.setProperty( 887 - "color", 888 - row.theme.text, 889 - "important" 890 - ); 751 + var currentMargin= 752 + num( 753 + getComputedStyle( 754 + row.bar 755 + ).marginTop 756 + ); 891 891 892 - row.el.style.setProperty( 893 - "text-align", 894 - "left", 895 - "important" 758 + row.bar.style.setProperty( 759 + "margin-top", 760 + ( 761 + currentMargin+ 762 + delta 763 + )+"px" 896 896 ); 897 897 898 - row.el.style.setProperty( 899 - "word-spacing", 900 - "normal", 901 - "important" 766 + row.bar.setAttribute( 767 + "data-sn-first-section-aligned", 768 + "4" 902 902 ); 903 903 904 - var later= 905 - unique 906 - .filter(function(other){ 907 - return ( 908 - other.card===row.card&& 909 - other.el 910 - .getBoundingClientRect() 911 - .top> 912 - headerRect.top+2 913 - ); 914 - }) 915 - .sort(function(a,b){ 916 - return ( 917 - a.el 918 - .getBoundingClientRect() 919 - .top- 920 - b.el 921 - .getBoundingClientRect() 922 - .top 923 - ); 924 - }); 925 - 926 - var stopTop= 927 - later.length 928 - ?later[0].el 929 - .getBoundingClientRect() 930 - .top 931 - :Infinity; 932 - 933 - Array.from( 934 - row.card.querySelectorAll("a") 935 - ).forEach(function(link){ 936 - if(!visible(link))return; 937 - 938 - var rect= 939 - link.getBoundingClientRect(); 940 - 941 - if( 942 - rect.top<= 943 - headerRect.bottom-2|| 944 - rect.top>= 945 - stopTop-2 946 - ){ 947 - return; 948 - } 949 - 950 - var candidates= 951 - rowCandidates( 952 - link, 953 - row.card 954 - ); 955 - 956 - var target= 957 - chooseOuterRow( 958 - candidates, 959 - link 960 - ); 961 - 962 - candidates.forEach(function(el){ 963 - el.style.setProperty( 964 - "border-left", 965 - "0 solid transparent", 966 - "important" 967 - ); 968 - }); 969 - 970 - target.style.setProperty( 971 - "border-left", 972 - "3px solid "+ 973 - row.theme.accent, 974 - "important" 975 - ); 976 - 977 - target.style.setProperty( 978 - "box-sizing", 979 - "border-box", 980 - "important" 981 - ); 982 - }); 771 + sectionManaged.add(row.bar); 983 983 }); 984 984 985 - return unique; 774 + return { 775 + labels: 776 + rows.map(function(row){ 777 + return row.label; 778 + }), 779 + targetRelativeTop: 780 + Math.round(targetTop) 781 + }; 986 986 } 987 987 988 - /* ======================================================= 989 - OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW 990 - ======================================================= */ 991 - 992 - function alignOverviewCards(headers){ 993 - if( 994 - PAGE_KIND!=="overview"|| 995 - window.innerWidth<=MOBILE_MAX 996 - ){ 997 - return; 784 + function applyGroup(group){ 785 + if(!validHorizontalGroup(group)){ 786 + return null; 998 998 } 999 999 1000 1000 var cards=[]; 1001 1001 var seen=new Set(); 1002 1002 1003 - headers.forEach(function(row){1004 - if(!seen.has(r ow.card)){1005 - seen.add(r ow.card);1006 - cards.push(r ow.card);792 + group.entries.forEach(function(entry){ 793 + if(!seen.has(entry.target)){ 794 + seen.add(entry.target); 795 + cards.push(entry.target); 1007 1007 } 1008 1008 }); 1009 1009 1010 - if(cards.length<2){ 1011 - return; 1012 - } 799 + if(cards.length<2)return null; 1013 1013 1014 - // Groupcardsby actual top position.1015 - vargroups=[];801 + var firstSection= 802 + alignFirstSections(cards); 1016 1016 1017 - cards.forEach(function(card){1018 - vartop=1019 - card.getBoundingClientRect().top;804 + // The section alignment can change natural card heights. 805 + // Measure only afterwards. 806 + var maxHeight=0; 1020 1020 1021 - var group=null; 1022 - 1023 - for(var i=0;i<groups.length;i++){ 1024 - if( 1025 - Math.abs( 1026 - groups[i].top-top 1027 - )<=ROW_TOLERANCE 1028 - ){ 1029 - group=groups[i]; 1030 - break; 1031 - } 1032 - } 1033 - 1034 - if(!group){ 1035 - group={ 1036 - top:top, 1037 - cards:[] 1038 - }; 1039 - groups.push(group); 1040 - } 1041 - 1042 - group.cards.push(card); 808 + cards.forEach(function(card){ 809 + maxHeight=Math.max( 810 + maxHeight, 811 + card.getBoundingClientRect().height 812 + ); 1043 1043 }); 1044 1044 1045 - groups.forEach(function(group){ 1046 - if(group.cards.length<2){ 1047 - return; 1048 - } 815 + maxHeight=Math.ceil(maxHeight); 1049 1049 1050 - var firstHeaders= 1051 - group.cards.map(function(card){ 1052 - var candidates= 1053 - headers 1054 - .filter(function(row){ 1055 - return row.card===card; 1056 - }) 1057 - .sort(function(a,b){ 1058 - return ( 1059 - a.el 1060 - .getBoundingClientRect() 1061 - .top- 1062 - b.el 1063 - .getBoundingClientRect() 1064 - .top 1065 - ); 1066 - }); 817 + if(maxHeight<MIN_H)return null; 1067 1067 1068 - return candidates.length 1069 - ?candidates[0] 1070 - :null; 1071 - }); 819 + cards.forEach(function(card){ 820 + saveOriginal( 821 + card, 822 + originalMinHeight, 823 + "min-height" 824 + ); 1072 1072 1073 - if( 1074 - !firstHeaders.some(function(row){ 1075 - return !row; 1076 - }) 1077 - ){ 1078 - var targetTop= 1079 - Math.max.apply( 1080 - Math, 1081 - firstHeaders.map(function(row){ 1082 - return ( 1083 - row.el 1084 - .getBoundingClientRect() 1085 - .top- 1086 - row.card 1087 - .getBoundingClientRect() 1088 - .top 1089 - ); 1090 - }) 1091 - ); 826 + card.style.setProperty( 827 + "min-height", 828 + maxHeight+"px" 829 + ); 1092 1092 1093 - firstHeaders.forEach(function(row){ 1094 - var relativeTop= 1095 - row.el 1096 - .getBoundingClientRect() 1097 - .top- 1098 - row.card 1099 - .getBoundingClientRect() 1100 - .top; 831 + card.setAttribute( 832 + "data-sn-equal-height-managed", 833 + "4" 834 + ); 1101 1101 1102 - var delta= 1103 - targetTop-relativeTop; 1104 - 1105 - if(delta>1){ 1106 - saveStyle( 1107 - row.el, 1108 - originalMargin, 1109 - "margin-top" 1110 - ); 1111 - 1112 - var current= 1113 - num( 1114 - getComputedStyle( 1115 - row.el 1116 - ).marginTop 1117 - ); 1118 - 1119 - row.el.style.setProperty( 1120 - "margin-top", 1121 - ( 1122 - current+delta 1123 - )+"px" 1124 - ); 1125 - 1126 - row.el.setAttribute( 1127 - "data-sn-master-first-row", 1128 - "1" 1129 - ); 1130 - 1131 - managedMargin.add( 1132 - row.el 1133 - ); 1134 - } 1135 - }); 1136 - } 1137 - 1138 - var maxHeight=0; 1139 - 1140 - group.cards.forEach(function(card){ 1141 - maxHeight= 1142 - Math.max( 1143 - maxHeight, 1144 - card 1145 - .getBoundingClientRect() 1146 - .height 1147 - ); 1148 - }); 1149 - 1150 - maxHeight= 1151 - Math.ceil(maxHeight); 1152 - 1153 - group.cards.forEach(function(card){ 1154 - saveStyle( 1155 - card, 1156 - originalHeight, 1157 - "min-height" 1158 - ); 1159 - 1160 - card.style.setProperty( 1161 - "min-height", 1162 - maxHeight+"px" 1163 - ); 1164 - 1165 - card.setAttribute( 1166 - "data-sn-master-equal-height", 1167 - "1" 1168 - ); 1169 - 1170 - managedHeight.add( 1171 - card 1172 - ); 1173 - }); 836 + heightManaged.add(card); 1174 1174 }); 838 + 839 + return { 840 + cards:cards.length, 841 + height:maxHeight, 842 + firstSection:firstSection 843 + }; 1175 1175 } 1176 1176 1177 - /* ======================================================= 1178 - DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1179 - ======================================================= */ 846 + function run(){ 847 + reset(); 1180 1180 1181 - function equaliseDetailGrids(){ 1182 1182 if( 1183 - PAGE_KIND!=="detail"|| 1184 1184 window.innerWidth<=MOBILE_MAX 1185 1185 ){ 1186 1186 return; 1187 1187 } 1188 1188 1189 - var selectors=[ 1190 - ".arsn-grid", 1191 - ".arsn-grid-2", 1192 - ".arsn-grid-3", 1193 - ".dmp-grid", 1194 - ".ido-grid", 1195 - ".pp-grid" 1196 - ]; 1197 - 1198 - selectors.forEach(function(selector){ 855 + var parents= 1199 1199 Array.from( 1200 - root.querySelectorAll(selector) 1201 - ).forEach(function(grid){ 1202 - var children= 1203 - Array.from( 1204 - grid.children||[] 1205 - ).filter(visible); 857 + root.querySelectorAll("*") 858 + ).filter(function(parent){ 859 + return ( 860 + visible(parent,MIN_W,MIN_H)&& 861 + parent.children&& 862 + parent.children.length>=2&& 863 + parent.children.length<=MAX_PARENT_CHILDREN 864 + ); 865 + }); 1206 1206 1207 - if(children.length<2){ 1208 - return; 1209 - } 867 + var touched=new Set(); 1210 1210 1211 - var groups=[]; 869 + parents.forEach(function(parent){ 870 + var entries=[]; 1212 1212 1213 - children.forEach(function(child){ 1214 - var top= 1215 - child 1216 - .getBoundingClientRect() 1217 - .top; 872 + Array.from(parent.children).forEach(function(child){ 873 + if(!visible(child,MIN_W,MIN_H))return; 1218 1218 1219 - var group=null; 875 + var target=pickTarget(child); 876 + if(!target)return; 1220 1220 1221 - for(var i=0;i<groups.length;i++){ 1222 - if( 1223 - Math.abs( 1224 - groups[i].top-top 1225 - )<=ROW_TOLERANCE 1226 - ){ 1227 - group=groups[i]; 1228 - break; 1229 - } 1230 - } 1231 - 1232 - if(!group){ 1233 - group={ 1234 - top:top, 1235 - items:[] 1236 - }; 1237 - groups.push(group); 1238 - } 1239 - 1240 - group.items.push(child); 878 + entries.push({ 879 + target:target, 880 + rect:target.getBoundingClientRect() 1241 1241 }); 882 + }); 1242 1242 1243 - groups.forEach(function(group){ 1244 - if(group.items.length<2){ 1245 - return; 1246 - } 884 + if(entries.length<2)return; 1247 1247 1248 - var maxHeight=0; 886 + groupsByVisualRow(entries).forEach(function(group){ 887 + if(!validHorizontalGroup(group))return; 1249 1249 1250 - group.items.forEach(function(item){ 1251 - maxHeight= 1252 - Math.max( 1253 - maxHeight, 1254 - item 1255 - .getBoundingClientRect() 1256 - .height 1257 - ); 889 + var signature= 890 + group.entries.map(function(entry){ 891 + return entry.target; 1258 1258 }); 1259 1259 1260 - maxHeight= 1261 - Math.ceil(maxHeight); 894 + if( 895 + !signature.some(function(el){ 896 + return !touched.has(el); 897 + }) 898 + ){ 899 + return; 900 + } 1262 1262 1263 - group.items.forEach(function(item){ 1264 - saveStyle( 1265 - item, 1266 - originalHeight, 1267 - "min-height" 1268 - ); 902 + var applied= 903 + applyGroup(group); 1269 1269 1270 - item.style.setProperty( 1271 - "min-height", 1272 - maxHeight+"px" 1273 - ); 1274 - 1275 - item.setAttribute( 1276 - "data-sn-master-equal-height", 1277 - "1" 1278 - ); 1279 - 1280 - managedHeight.add(item); 905 + if(applied){ 906 + signature.forEach(function(el){ 907 + touched.add(el); 1281 1281 }); 1282 - } );909 + } 1283 1283 }); 1284 1284 }); 1285 1285 } 1286 1286 1287 - /* ======================================================= 1288 - RUN / RESPONSIVE SCHEDULING 1289 - ======================================================= */ 914 + function schedule(){ 915 + if(raf)cancelAnimationFrame(raf); 1290 1290 1291 - function run(){ 1292 - if(running)return; 1293 - 1294 - running=true; 1295 - 1296 - try{ 1297 - resetRuntime(); 1298 - applyPlaceholderBadge(); 1299 - propagateDetailAccents(); 1300 - 1301 - var headers= 1302 - applyOverviewPalette(); 1303 - 1304 - if( 1305 - window.innerWidth> 1306 - MOBILE_MAX 1307 - ){ 1308 - alignOverviewCards( 1309 - headers 1310 - ); 1311 - 1312 - equaliseDetailGrids(); 1313 - } 1314 - }finally{ 1315 - running=false; 1316 - } 917 + raf=requestAnimationFrame(function(){ 918 + raf=requestAnimationFrame(function(){ 919 + raf=0; 920 + run(); 921 + }); 922 + }); 1317 1317 } 1318 1318 1319 - function onResize(){ 1320 - if(resizeTimer){ 1321 - clearTimeout( 1322 - resizeTimer 1323 - ); 1324 - } 925 + addEventListener("resize",schedule,{passive:true}); 926 + addEventListener("load",schedule,{once:true}); 1325 1325 1326 - resizeTimer= 1327 - setTimeout( 1328 - function(){ 1329 - resizeTimer=0; 1330 - run(); 1331 - }, 1332 - RESIZE_DEBOUNCE 1333 - ); 1334 - } 928 + root.addEventListener( 929 + "click", 930 + function(){ 931 + setTimeout(schedule,0); 932 + }, 933 + true 934 + ); 1335 1335 1336 - async function waitForReady(){ 1337 - if( 1338 - document.readyState!=="complete" 1339 - ){ 1340 - await new Promise(function(resolve){ 1341 - window.addEventListener( 1342 - "load", 1343 - resolve, 1344 - {once:true} 1345 - ); 1346 - }); 936 + Array.from(root.querySelectorAll("img")).forEach(function(img){ 937 + if(!img.complete){ 938 + img.addEventListener("load",schedule,{once:true}); 1347 1347 } 940 + }); 1348 1348 1349 - if( 1350 - document.fonts&& 1351 - document.fonts.ready 1352 - ){ 1353 - try{ 1354 - await document.fonts.ready; 1355 - }catch(error){} 1356 - } 1357 - 1358 - var images= 1359 - Array.from( 1360 - root.querySelectorAll("img") 1361 - ); 1362 - 1363 - await Promise.all( 1364 - images.map(function(img){ 1365 - if(img.complete){ 1366 - return Promise.resolve(); 1367 - } 1368 - 1369 - return new Promise(function(resolve){ 1370 - var done=function(){ 1371 - resolve(); 1372 - }; 1373 - 1374 - img.addEventListener( 1375 - "load", 1376 - done, 1377 - {once:true} 1378 - ); 1379 - 1380 - img.addEventListener( 1381 - "error", 1382 - done, 1383 - {once:true} 1384 - ); 1385 - }); 1386 - }) 1387 - ); 1388 - 1389 - run(); 942 + if(document.fonts&&document.fonts.ready){ 943 + document.fonts.ready.then(schedule); 1390 1390 } 1391 1391 1392 - window.addEventListener( 1393 - "resize", 1394 - onResize, 1395 - {passive:true} 1396 - ); 1397 - 1398 - waitForReady(); 946 + schedule(); 947 + setTimeout(schedule,200); 948 + setTimeout(schedule,650); 949 + setTimeout(schedule,1400); 1399 1399 })(); 1400 1400 </script> 1401 - 1402 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 952 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1403 1403 {{/html}} 1404 1404