Changes for page Plan Your Data Management
Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45
From 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
To 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
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -258,23 +258,100 @@ 258 258 {{/html}} 259 259 260 260 {{html clean="false"}} 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]{ 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]{ 265 265 box-sizing:border-box; 266 266 } 267 267 </style> 268 -<script data-sn-horizontal-box-harmonizer="4"> 343 + 344 +<script data-sn-service-navigator-master="1"> 269 269 (function(){ 270 270 "use strict"; 271 271 348 + var PAGE_KIND="detail"; 349 + var PLACEHOLDER=false; 350 + var PLACEHOLDER_LABEL="COMING SOON"; 351 + 272 272 var MOBILE_MAX=767; 273 273 var ROW_TOLERANCE=6; 274 - var MIN_W=150; 275 - var MIN_H=36; 276 - var MAX_PARENT_CHILDREN=16; 277 - var SEARCH_DEPTH=5; 354 + var RESIZE_DEBOUNCE=220; 278 278 279 279 var root= 280 280 document.getElementById("xwikicontent")|| ... ... @@ -284,93 +284,105 @@ 284 284 285 285 if(!root)return; 286 286 287 - var heightManaged=new Set(); 288 - var sectionManaged=new Set(); 289 - var originalMinHeight=new WeakMap(); 290 - var originalMarginTop=new WeakMap(); 291 - var raf=0; 364 + var managedHeight=new Set(); 365 + var managedMargin=new Set(); 366 + var originalHeight=new WeakMap(); 367 + var originalMargin=new WeakMap(); 292 292 293 - function num(v){ 294 - var n=parseFloat(v); 295 - return Number.isFinite(n)?n:0; 296 - } 369 + var resizeTimer=0; 370 + var running=false; 297 297 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; 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 + ] 309 309 } 434 + ]; 310 310 311 - var r=el.getBoundingClientRect(); 312 - 313 - return ( 314 - r.width>=(minW||1)&& 315 - r.height>=(minH||1) 316 - ); 436 + function num(value){ 437 + var n=parseFloat(value); 438 + return Number.isFinite(n)?n:0; 317 317 } 318 318 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 - ); 441 + function norm(value){ 442 + return String(value||"") 443 + .replace(/\s+/g," ") 444 + .trim() 445 + .toUpperCase(); 326 326 } 327 327 328 - function namedLikeBox(el){ 329 - var c= 330 - typeof el.className==="string" 331 - ? el.className 332 - : ""; 448 + function visible(el){ 449 + if(!el||el.nodeType!==1)return false; 333 333 334 - r eturn/(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c);335 - }451 + var style=getComputedStyle(el); 452 + var rect=el.getBoundingClientRect(); 336 336 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 - 365 365 return ( 366 - namedLikeBox(el)||367 - b order>=1||368 - (bg&&radius>=3)||369 - (shadow&&r.width>=180)455 + style.display!=="none"&& 456 + style.visibility!=="hidden"&& 457 + rect.width>20&& 458 + rect.height>4 370 370 ); 371 371 } 372 372 373 - function save Original(el,map,property){462 + function saveStyle(el,map,property){ 374 374 if(map.has(el))return; 375 375 376 376 map.set(el,{ ... ... @@ -379,7 +379,7 @@ 379 379 }); 380 380 } 381 381 382 - function restore Original(el,map,property){471 + function restoreStyle(el,map,property){ 383 383 var original=map.get(el); 384 384 385 385 if(original&&original.value){ ... ... @@ -393,247 +393,249 @@ 393 393 } 394 394 } 395 395 396 - function reset(){ 397 - heightManaged.forEach(function(el){398 - restore Original(485 + function resetRuntime(){ 486 + managedHeight.forEach(function(el){ 487 + restoreStyle( 399 399 el, 400 - original MinHeight,489 + originalHeight, 401 401 "min-height" 402 402 ); 403 - 404 404 el.removeAttribute( 405 - "data-sn-equal-height -managed"493 + "data-sn-master-equal-height" 406 406 ); 407 407 }); 408 408 409 - sectionManaged.forEach(function(el){410 - restore Original(497 + managedMargin.forEach(function(el){ 498 + restoreStyle( 411 411 el, 412 - originalMargin Top,500 + originalMargin, 413 413 "margin-top" 414 414 ); 415 - 416 416 el.removeAttribute( 417 - "data-sn-first- section-aligned"504 + "data-sn-master-first-row" 418 418 ); 419 419 }); 420 420 421 - heightManaged.clear();422 - sectionManaged.clear();508 + managedHeight.clear(); 509 + managedMargin.clear(); 423 423 } 424 424 425 - function pickTarget(child){426 - if(!visible(child,MIN_W,MIN_H))return null;512 + function themeFor(text){ 513 + var value=norm(text); 427 427 428 - if(boxLike(child)){ 429 - return child; 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 + } 430 430 } 431 431 432 - varcr=child.getBoundingClientRect();433 - var q=[];530 + return null; 531 + } 434 434 435 - Array.from(child.children||[]).forEach(function(el){436 - q.push({el:el,depth:1});437 - });533 + /* ======================================================= 534 + PLACEHOLDER BADGE 535 + ======================================================= */ 438 438 439 - var best=null;440 - varbestScore=-Infinity;537 + function applyPlaceholderBadge(){ 538 + if(!PLACEHOLDER)return; 441 441 442 - while(q.length){ 443 - var item=q.shift(); 444 - var el=item.el; 540 + if( 541 + document.querySelector( 542 + ".sn-coming-soon-badge" 543 + ) 544 + ){ 545 + return; 546 + } 445 445 446 - if(!visible(el,MIN_W,MIN_H))continue; 548 + var title= 549 + document.querySelector( 550 + "#document-title" 551 + )|| 552 + document.querySelector( 553 + "h1" 554 + ); 447 447 448 - var r=el.getBoundingClientRect();556 + if(!title)return; 449 449 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 - ); 558 + var badge= 559 + document.createElement( 560 + "span" 561 + ); 460 460 461 - var topFit= 462 - 1-Math.min( 463 - 1, 464 - Math.abs(cr.top-r.top)/100 465 - ); 563 + badge.className= 564 + "sn-coming-soon-badge"; 466 466 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; 566 + badge.textContent= 567 + PLACEHOLDER_LABEL; 472 472 473 - if(score>bestScore){ 474 - best=el; 475 - bestScore=score; 476 - } 477 - } 569 + badge.setAttribute( 570 + "aria-label", 571 + PLACEHOLDER_LABEL 572 + ); 478 478 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; 574 + title.appendChild( 575 + badge 576 + ); 490 490 } 491 491 492 - function groupsByVisualRow(entries){ 493 - var groups=[]; 579 + /* ======================================================= 580 + DETAIL PAGE OWN-ACCENT PROPAGATION 581 + ======================================================= */ 494 494 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; 583 + function parseRGB(value){ 584 + var match=String(value||"").match( 585 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i 586 + ); 505 505 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 - } 588 + if(!match)return null; 517 517 518 - if(!group){ 519 - group={ 520 - top:entry.rect.top, 521 - entries:[] 522 - }; 523 - groups.push(group); 524 - } 590 + return [ 591 + Number(match[1]), 592 + Number(match[2]), 593 + Number(match[3]) 594 + ]; 595 + } 525 525 526 - group.entries.push(entry); 527 - }); 528 - 529 - return groups; 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 + ); 530 530 } 531 531 532 - function validHorizontalGroup(group){533 - if(group.entries.length<2)return false;605 + function paletteMatch(cssColor){ 606 + var rgb=parseRGB(cssColor); 534 534 535 - var lefts= 536 - group.entries 537 - .map(function(e){return e.rect.left;}) 538 - .sort(function(a,b){return a-b;}); 608 + if(!rgb)return null; 539 539 540 - if( 541 - lefts[lefts.length-1]- 542 - lefts[0]< 543 - 80 544 - ){ 545 - return false; 546 - } 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 + ]; 547 547 548 - var widths= 549 - group.entries 550 - .map(function(e){return e.rect.width;}) 551 - .filter(function(w){return w>0;}); 617 + var best=null; 618 + var bestDistance=Infinity; 552 552 553 - if(widths.length<2)return false; 620 + palette.forEach(function(item){ 621 + var d=distance(rgb,item.rgb); 554 554 555 - var minWidth=Math.min.apply(Math,widths); 556 - var maxWidth=Math.max.apply(Math,widths); 623 + if(d<bestDistance){ 624 + best=item; 625 + bestDistance=d; 626 + } 627 + }); 557 557 558 - return ( 559 - maxWidth/ 560 - Math.max(1,minWidth)<= 561 - 1.9 562 - ); 629 + return bestDistance<=30 630 + ?best 631 + :null; 563 563 } 564 564 565 - function normalizeText(text){ 566 - return String(text||"") 567 - .replace(/s+/g," ") 568 - .trim() 569 - .toUpperCase(); 570 - } 634 + function propagateDetailAccents(){ 635 + if(PAGE_KIND!=="detail")return; 571 571 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 - 591 591 Array.from( 592 - card.querySelectorAll( 593 - "div,p,span,strong,h3,h4,h5,h6" 638 + root.querySelectorAll( 639 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+ 640 + ".arsn-source,.dmp-source,.ido-source,.pp-source" 594 594 ) 595 595 ).forEach(function(el){ 596 - if(!visible(el,20,6))return; 597 - if(excluded(el))return; 643 + if(!visible(el))return; 598 598 599 - var r=el.getBoundingClientRect(); 600 - var relativeTop=r.top-cardRect.top; 645 + var style=getComputedStyle(el); 601 601 602 602 if( 603 - relativeTop<45|| 604 - relativeTop>cardRect.height*.72 648 + num(style.borderTopWidth)>=2 605 605 ){ 606 - return; 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 + } 607 607 } 663 + }); 608 608 609 - var widthRatio= 610 - r.width/ 611 - Math.max(1,cardRect.width); 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; 612 612 613 - if( 614 - widthRatio<.55|| 615 - widthRatio>1.05|| 616 - r.height>54 617 - ){ 618 - return; 619 - } 674 + el.style.setProperty( 675 + "border-left", 676 + "4px solid #e94b13", 677 + "important" 678 + ); 679 + }); 620 620 621 - var text=normalizeText(el.textContent); 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; 622 622 623 - if( 624 - text.length<2|| 625 - text.length>90 626 - ){ 627 - return; 628 - } 689 + el.style.setProperty( 690 + "border-left", 691 + "4px solid #21b6d7", 692 + "important" 693 + ); 694 + }); 695 + } 629 629 630 - var style=getComputedStyle(el); 697 + /* ======================================================= 698 + OVERVIEW SEMANTIC THEME PALETTE 699 + ======================================================= */ 631 631 632 - var bg= 633 - style.backgroundColor&& 634 - style.backgroundColor!=="rgba(0, 0, 0, 0)"&& 635 - style.backgroundColor!=="transparent"; 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; 636 636 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 + 637 637 var border= 638 638 num(style.borderTopWidth)+ 639 639 num(style.borderRightWidth)+ ... ... @@ -640,315 +640,674 @@ 640 640 num(style.borderBottomWidth)+ 641 641 num(style.borderLeftWidth); 642 642 643 - var mostlyUpper= 644 - text.length>=3&& 645 - text===text.toUpperCase(); 646 - 647 - var exact=exactKnownFirstSection(el); 648 - 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); 655 - 656 - if(score>=7){ 657 - candidates.push({ 658 - el:el, 659 - relativeTop:relativeTop, 660 - width:r.width, 661 - score:score 662 - }); 734 + if( 735 + rect.width>=220&& 736 + rect.width<=800&& 737 + rect.height>=120&& 738 + border>=1 739 + ){ 740 + candidates.push(node); 663 663 } 664 - }); 665 665 743 + node=node.parentElement; 744 + } 745 + 666 666 if(!candidates.length)return null; 667 667 668 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; 672 - } 673 - return b.width-a.width; 749 + return ( 750 + b.getBoundingClientRect().height- 751 + a.getBoundingClientRect().height 752 + ); 674 674 }); 675 675 676 - // For exact known labels always prefer the earliest exact match. 677 - var exacts=candidates.filter(function(c){ 678 - return exactKnownFirstSection(c.el); 679 - }); 755 + return candidates[0]; 756 + } 680 680 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; 686 - } 758 + function rowCandidates(link,card){ 759 + var result=[]; 760 + var cardRect= 761 + card.getBoundingClientRect(); 687 687 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 - }); 763 + var node=link; 692 692 693 - return candidates[0].el; 694 - } 765 + while(node&&node!==card){ 766 + if(visible(node)){ 767 + var rect= 768 + node.getBoundingClientRect(); 695 695 696 - function alignFirstSections(cards){ 697 - var rows= 698 - cards.map(function(card){ 699 - var bar= 700 - visuallyFirstSectionBar(card); 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 + } 779 + } 701 701 702 - if(!bar)return null; 781 + node=node.parentElement; 782 + } 703 703 704 - varcardRect=705 - card.getBoundingClientRect();784 + return result; 785 + } 706 706 707 - var barRect= 708 - bar.getBoundingClientRect(); 787 + function chooseOuterRow( 788 + candidates, 789 + link 790 + ){ 791 + if(!candidates.length){ 792 + return link; 793 + } 709 709 710 - return {711 - card:card,712 - bar:bar,713 - relativeTop:714 - barRect.top-cardRect.top,715 - label:716 - normalizeText(bar.textContent)717 - };795 + var bordered= 796 + candidates.filter(function(el){ 797 + return ( 798 + num( 799 + getComputedStyle(el) 800 + .borderLeftWidth 801 + )>=1 802 + ); 718 718 }); 719 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; 805 + var pool= 806 + bordered.length 807 + ?bordered 808 + :candidates; 809 + 810 + pool.sort(function(a,b){ 811 + var ar= 812 + a.getBoundingClientRect(); 813 + 814 + var br= 815 + b.getBoundingClientRect(); 816 + 817 + return ( 818 + ar.left-br.left|| 819 + br.width-ar.width 820 + ); 821 + }); 822 + 823 + return pool[0]||link; 824 + } 825 + 826 + function applyOverviewPalette(){ 827 + if(PAGE_KIND!=="overview"){ 828 + return []; 728 728 } 729 729 730 - var targetTop= 731 - Math.max.apply( 732 - Math, 733 - rows.map(function(row){ 734 - return row.relativeTop; 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 + }; 735 735 }) 736 - ); 846 + .filter(function(row){ 847 + return !!row.card; 848 + }); 737 737 738 - rows.forEach(function(row){ 739 - var delta= 740 - targetTop- 741 - row.relativeTop; 850 + var unique=[]; 851 + var seenHeaders=new Set(); 742 742 743 - if(delta<=1)return; 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 + ); 744 744 745 - saveOriginal( 746 - row.bar, 747 - originalMarginTop, 748 - "margin-top" 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" 749 749 ); 750 750 751 - var currentMargin= 752 - num( 753 - getComputedStyle( 754 - row.bar 755 - ).marginTop 756 - ); 886 + row.el.style.setProperty( 887 + "color", 888 + row.theme.text, 889 + "important" 890 + ); 757 757 758 - row.bar.style.setProperty( 759 - "margin-top", 760 - ( 761 - currentMargin+ 762 - delta 763 - )+"px" 892 + row.el.style.setProperty( 893 + "text-align", 894 + "left", 895 + "important" 764 764 ); 765 765 766 - row.bar.setAttribute( 767 - "data-sn-first-section-aligned", 768 - "4" 898 + row.el.style.setProperty( 899 + "word-spacing", 900 + "normal", 901 + "important" 769 769 ); 770 770 771 - sectionManaged.add(row.bar); 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 + }); 772 772 }); 773 773 774 - return { 775 - labels: 776 - rows.map(function(row){ 777 - return row.label; 778 - }), 779 - targetRelativeTop: 780 - Math.round(targetTop) 781 - }; 985 + return unique; 782 782 } 783 783 784 - function applyGroup(group){ 785 - if(!validHorizontalGroup(group)){ 786 - return null; 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; 787 787 } 788 788 789 789 var cards=[]; 790 790 var seen=new Set(); 791 791 792 - group.entries.forEach(function(entry){793 - if(!seen.has( entry.target)){794 - seen.add( entry.target);795 - cards.push( entry.target);1003 + headers.forEach(function(row){ 1004 + if(!seen.has(row.card)){ 1005 + seen.add(row.card); 1006 + cards.push(row.card); 796 796 } 797 797 }); 798 798 799 - if(cards.length<2)return null; 1010 + if(cards.length<2){ 1011 + return; 1012 + } 800 800 801 - varfirstSection=802 - alignFirstSections(cards);1014 + // Group cards by actual top position. 1015 + var groups=[]; 803 803 804 - // The section alignment can change natural card heights. 805 - // Measure only afterwards. 806 - var maxHeight=0; 807 - 808 808 cards.forEach(function(card){ 809 - maxHeight=Math.max( 810 - maxHeight, 811 - card.getBoundingClientRect().height 812 - ); 1018 + var top= 1019 + card.getBoundingClientRect().top; 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); 813 813 }); 814 814 815 - maxHeight=Math.ceil(maxHeight); 1045 + groups.forEach(function(group){ 1046 + if(group.cards.length<2){ 1047 + return; 1048 + } 816 816 817 - if(maxHeight<MIN_H)return null; 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 + }); 818 818 819 - cards.forEach(function(card){ 820 - saveOriginal( 821 - card, 822 - originalMinHeight, 823 - "min-height" 824 - ); 1068 + return candidates.length 1069 + ?candidates[0] 1070 + :null; 1071 + }); 825 825 826 - card.style.setProperty( 827 - "min-height", 828 - maxHeight+"px" 829 - ); 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 + ); 830 830 831 - card.setAttribute( 832 - "data-sn-equal-height-managed", 833 - "4" 834 - ); 1093 + firstHeaders.forEach(function(row){ 1094 + var relativeTop= 1095 + row.el 1096 + .getBoundingClientRect() 1097 + .top- 1098 + row.card 1099 + .getBoundingClientRect() 1100 + .top; 835 835 836 - heightManaged.add(card);837 - });1102 + var delta= 1103 + targetTop-relativeTop; 838 838 839 - return { 840 - cards:cards.length, 841 - height:maxHeight, 842 - firstSection:firstSection 843 - }; 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 + }); 1174 + }); 844 844 } 845 845 846 - function run(){ 847 - reset(); 1177 + /* ======================================================= 1178 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY 1179 + ======================================================= */ 848 848 1181 + function equaliseDetailGrids(){ 849 849 if( 1183 + PAGE_KIND!=="detail"|| 850 850 window.innerWidth<=MOBILE_MAX 851 851 ){ 852 852 return; 853 853 } 854 854 855 - var parents= 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){ 856 856 Array.from( 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 - }); 1200 + root.querySelectorAll(selector) 1201 + ).forEach(function(grid){ 1202 + var children= 1203 + Array.from( 1204 + grid.children||[] 1205 + ).filter(visible); 866 866 867 - var touched=new Set(); 1207 + if(children.length<2){ 1208 + return; 1209 + } 868 868 869 - parents.forEach(function(parent){ 870 - var entries=[]; 1211 + var groups=[]; 871 871 872 - Array.from(parent.children).forEach(function(child){ 873 - if(!visible(child,MIN_W,MIN_H))return; 1213 + children.forEach(function(child){ 1214 + var top= 1215 + child 1216 + .getBoundingClientRect() 1217 + .top; 874 874 875 - var target=pickTarget(child); 876 - if(!target)return; 1219 + var group=null; 877 877 878 - entries.push({ 879 - target:target, 880 - rect:target.getBoundingClientRect() 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); 881 881 }); 882 - }); 883 883 884 - if(entries.length<2)return; 1243 + groups.forEach(function(group){ 1244 + if(group.items.length<2){ 1245 + return; 1246 + } 885 885 886 - groupsByVisualRow(entries).forEach(function(group){ 887 - if(!validHorizontalGroup(group))return; 1248 + var maxHeight=0; 888 888 889 - var signature= 890 - group.entries.map(function(entry){ 891 - return entry.target; 1250 + group.items.forEach(function(item){ 1251 + maxHeight= 1252 + Math.max( 1253 + maxHeight, 1254 + item 1255 + .getBoundingClientRect() 1256 + .height 1257 + ); 892 892 }); 893 893 894 - if( 895 - !signature.some(function(el){ 896 - return !touched.has(el); 897 - }) 898 - ){ 899 - return; 900 - } 1260 + maxHeight= 1261 + Math.ceil(maxHeight); 901 901 902 - var applied= 903 - applyGroup(group); 1263 + group.items.forEach(function(item){ 1264 + saveStyle( 1265 + item, 1266 + originalHeight, 1267 + "min-height" 1268 + ); 904 904 905 - if(applied){ 906 - signature.forEach(function(el){ 907 - touched.add(el); 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); 908 908 }); 909 - } 1282 + }); 910 910 }); 911 911 }); 912 912 } 913 913 914 - function schedule(){ 915 - if(raf)cancelAnimationFrame(raf); 1287 + /* ======================================================= 1288 + RUN / RESPONSIVE SCHEDULING 1289 + ======================================================= */ 916 916 917 - raf=requestAnimationFrame(function(){ 918 - raf=requestAnimationFrame(function(){ 919 - raf=0; 920 - run(); 921 - }); 922 - }); 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 + } 923 923 } 924 924 925 - addEventListener("resize",schedule,{passive:true}); 926 - addEventListener("load",schedule,{once:true}); 1319 + function onResize(){ 1320 + if(resizeTimer){ 1321 + clearTimeout( 1322 + resizeTimer 1323 + ); 1324 + } 927 927 928 - root.addEventListener( 929 - "click", 930 - function(){ 931 - setTimeout(schedule,0); 932 - }, 933 - true 934 - ); 1326 + resizeTimer= 1327 + setTimeout( 1328 + function(){ 1329 + resizeTimer=0; 1330 + run(); 1331 + }, 1332 + RESIZE_DEBOUNCE 1333 + ); 1334 + } 935 935 936 - Array.from(root.querySelectorAll("img")).forEach(function(img){ 937 - if(!img.complete){ 938 - img.addEventListener("load",schedule,{once:true}); 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 + }); 939 939 } 940 - }); 941 941 942 - if(document.fonts&&document.fonts.ready){ 943 - document.fonts.ready.then(schedule); 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(); 944 944 } 945 945 946 - schedule(); 947 - setTimeout(schedule,200); 948 - setTimeout(schedule,650); 949 - setTimeout(schedule,1400); 1392 + window.addEventListener( 1393 + "resize", 1394 + onResize, 1395 + {passive:true} 1396 + ); 1397 + 1398 + waitForReady(); 950 950 })(); 951 951 </script> 952 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END --> 1401 + 1402 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END --> 953 953 {{/html}} 954 954