Merge pull request 'Template Fix 6000 — presentation follow-up' (#604) from dev/MC:fix/header-dropdown-regression-20261125 into main
All checks were successful
DuneRealms Web CI / web (push) Successful in 4m13s
All checks were successful
DuneRealms Web CI / web (push) Successful in 4m13s
This commit is contained in:
commit
7ddef9ea9e
20 changed files with 156 additions and 29 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +1,18 @@
|
|||
.applications-dashboard,.politics-content{--election-panel:#15372d;--election-field:#0b271f;--election-ink:#f0e3be;--election-muted:#c3ccbb;--election-line:#a38b50;--election-accent:#dac17d;min-width:0;max-width:100%;font:15px/1.65 Arial,sans-serif;color:var(--election-ink)}
|
||||
.politics-cp-shell .applications-dashboard,.politics-cp-shell .politics-content{--election-panel:#f5ecda;--election-field:#fffaf0;--election-ink:#442d2c;--election-muted:#67564b;--election-line:#b79a5d;--election-accent:#71363c}
|
||||
.naib-council .applications-dashboard,.naib-council .politics-content{--election-panel:#f3e5cc;--election-field:#fff8ea;--election-ink:#443522;--election-muted:#695d46;--election-line:#b39661;--election-accent:#76532f}
|
||||
.applications-dashboard .politics-card,.applications-dashboard .politics-charter,.politics-content>.politics-card{box-sizing:border-box;max-width:none;width:100%;min-width:0;margin:0 0 22px;padding:24px;border:1px solid var(--election-line);border-radius:12px;background:var(--election-panel);color:var(--election-ink)}
|
||||
.applications-dashboard h3,.politics-content h3{font-family:Georgia,serif;margin:0 0 14px;color:var(--election-ink)}.applications-dashboard p,.politics-content p{color:inherit;max-width:none}.applications-dashboard .politics-card>p{color:var(--election-muted)}
|
||||
.applications-table-wrap{width:100%;max-width:100%;overflow-x:auto;border:1px solid var(--election-line);border-radius:9px;margin-top:18px}.applications-table{border-collapse:collapse;width:100%;min-width:760px;font:13px/1.5 Arial,sans-serif;color:var(--election-ink)}.applications-table caption{text-align:left;padding:12px 14px;font-weight:600;color:var(--election-muted)}.applications-table th,.applications-table td{padding:13px 12px;text-align:left;vertical-align:middle;border-bottom:1px solid color-mix(in srgb,var(--election-line) 40%,transparent);overflow-wrap:anywhere}.applications-table th{font-size:12px;font-weight:700;background:color-mix(in srgb,var(--election-accent) 12%,var(--election-panel));white-space:nowrap}.applications-table td:first-child{min-width:170px;font:12px/1.5 ui-monospace,monospace}.applications-table td:nth-child(2){min-width:135px}.applications-table td:nth-child(3){min-width:115px}.applications-table td:nth-child(2) img{display:inline-block;vertical-align:middle;width:30px;height:30px;margin-right:8px}.applications-table tbody tr:last-child td{border-bottom:0}
|
||||
.applications-dashboard .politics-charter{display:grid;gap:16px}.applications-dashboard .politics-charter>label:not(.politics-accept){display:grid;gap:7px;font-weight:600}.applications-dashboard .politics-charter :is(select,textarea){display:block;width:100%;max-width:100%;box-sizing:border-box;border:1px solid var(--election-line);border-radius:7px;background:var(--election-field);color:var(--election-ink);font:inherit;padding:12px}.applications-dashboard .politics-charter textarea{min-height:160px;resize:vertical}.applications-dashboard .politics-charter>p{margin:0}.applications-dashboard .politics-accept,.politics-content .politics-accept{display:flex;align-items:flex-start;gap:10px;font-weight:400;line-height:1.6}.applications-dashboard input[type=checkbox],.politics-content input[type=checkbox]{flex:none;width:18px;height:18px;margin:3px 0 0;accent-color:var(--election-accent)}
|
||||
.applications-dashboard button,.politics-content button{width:auto;justify-self:start;min-height:42px;border:1px solid var(--election-line);border-radius:7px;background:var(--election-accent);color:var(--election-panel);font:600 13px/1.4 Arial,sans-serif;padding:10px 16px;cursor:pointer}.applications-dashboard button:disabled,.politics-content button:disabled{opacity:.55;cursor:default}.applications-dashboard :is(button,select,textarea):focus-visible,.politics-content button:focus-visible{outline:3px solid #528ca0;outline-offset:3px}.applications-detail-grid{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,2fr);gap:9px 18px}.applications-detail-grid dt{font-weight:600;color:var(--election-muted)}.applications-detail-grid dd{margin:0;overflow-wrap:anywhere}
|
||||
@media(max-width:650px){.applications-dashboard .politics-card,.applications-dashboard .politics-charter,.politics-content>.politics-card{padding:16px}.applications-detail-grid{grid-template-columns:1fr;gap:4px}.applications-detail-grid dd{margin-bottom:10px}}
|
||||
|
||||
/* Use the same readable green/gold record palette in all CP workspaces. */
|
||||
.applications-dashboard{width:100%;grid-template-columns:minmax(0,1fr)}
|
||||
.applications-dashboard .applications-table{min-width:0;table-layout:auto}
|
||||
.applications-dashboard .applications-table :is(th,td){min-width:0;white-space:normal;overflow-wrap:anywhere;padding:10px 7px}
|
||||
.applications-dashboard .applications-table td:first-child{font-size:11px}
|
||||
.applications-dashboard .applications-table-wrap{box-sizing:border-box;scrollbar-color:#a38b50 #0b271f;scrollbar-width:thin}
|
||||
.applications-dashboard .politics-card :is(h3,h4,th),.politics-cp-shell .applications-dashboard .politics-card :is(h3,h4,th){color:#f0d78d}
|
||||
.applications-dashboard .politics-charter label,.applications-dashboard .politics-card td{color:var(--election-ink)}
|
||||
.applications-dashboard .politics-card button{background:var(--election-accent);color:var(--election-field)}
|
||||
@media(max-width:650px){.applications-dashboard .applications-table{min-width:580px}}
|
||||
|
|
|
|||
|
|
@ -52,3 +52,19 @@ body.politics-cp-shell #portals{display:none!important}
|
|||
.policy-tools{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:20px}.politics-cp-shell .policy-tools input,.politics-cp-shell .policy-tools select{background:#2d2029;color:#f0e3cb;border:1px solid #a68a54;border-radius:6px;padding:12px;font:15px Georgia,serif}.policy-tools input{flex:1;min-width:180px}.policy-row{display:grid;grid-template-columns:140px minmax(0,1fr);margin-bottom:18px;border:3px double #b89a60;border-radius:8px;background:linear-gradient(130deg,#452c35,#2a202b);overflow:hidden;box-shadow:0 5px 14px #100b1244}.policy-row-art{display:flex;align-items:center;justify-content:center;background:linear-gradient(#35202b55,#241925b3),url('https://www.dunerealms.com/assets/political-imperial-chamber-v1.png') center/cover}.policy-row-art img{width:92px;height:92px;object-fit:contain;filter:drop-shadow(0 5px 8px #10080d99)}.policy-row-body{padding:22px 26px}.politics-cp-shell .policy-row-body h3{margin:0 0 10px;color:#efd196;font-size:23px}.policy-row-body p{line-height:1.7;margin:0 0 15px}.policy-row-body button{margin-left:14px;padding:9px 16px;border-radius:5px}.policy-coming{display:inline-block;color:#dbc795;border:1px solid #a5895655;background:#2b2128;padding:7px 12px;border-radius:20px;font:12px Arial,sans-serif}.policy-watch{padding:16px;line-height:1.6;border-bottom:1px solid #a68a54}.policy-watch h3{color:#efd196;font-size:16px}.policy-watch p{font-size:13px}.policy-empty{padding:28px;border:1px solid #a68a5455;border-radius:7px;background:#30212a}
|
||||
.navitem .dune-new-overlay{display:inline-block;margin-left:6px;padding:2px 5px;border:1px solid #c38a63;background:#8b282c;color:#fff1cf;font:bold 9px Arial,sans-serif;border-radius:2px}.navitem .dune-update-overlay{background:#254957;border-color:#74a2b0}
|
||||
@media(max-width:720px){.policy-row{grid-template-columns:85px minmax(0,1fr)}.policy-row-art img{width:62px;height:62px}.policy-row-body{padding:18px}.politics-cp-shell .policy-row-body h3{font-size:20px}.policy-tools{display:grid;grid-template-columns:1fr}.policy-tools input{min-width:0}.policy-tabs button{flex:1}}
|
||||
|
||||
/* Match shared workspace navigation without removing political artwork or functions. */
|
||||
body.politics-cp-shell{color-scheme:dark;--text:#f0e3be;--gold:#dac17d;--line:#a38b50;--green:#15372d;background:#102b22;color:#f0e3be}
|
||||
.politics-cp-shell .side{background:linear-gradient(#173b2e,#102b22)}
|
||||
.politics-cp-shell .side-hero,.politics-cp-shell .category-heading{background:linear-gradient(90deg,#284b37,#16382a);color:#f0d78d}
|
||||
.politics-cp-shell .category-block{background:#142f25;border-color:#a38b50}
|
||||
.politics-cp-shell .category-count{background:#284b37;color:#f0d78d}
|
||||
.politics-cp-shell .navitem{color:#f0e3be}
|
||||
.politics-cp-shell .navitem:hover,.politics-cp-shell .navitem[aria-current=page]{background:#31583d;color:#ffe2a0}
|
||||
.politics-cp-shell .election-design .cp-v2-template-tabs{display:flex;flex-wrap:wrap;gap:8px}
|
||||
.politics-cp-shell .election-design .cp-v2-template-tab{background:#16382a;color:#f0d78d;border-color:#a38b50}
|
||||
.politics-cp-shell .election-design .cp-v2-template-tab[aria-selected=true]{background:#31583d;color:#ffe2a0}
|
||||
.politics-cp-shell .election-design :is(h2,h3,h4){color:#f0d78d}
|
||||
.politics-cp-shell .election-design :is(p,label,td){color:#f0e3be}
|
||||
.politics-cp-shell .election-design :is(select,textarea,input){background:#0b271f;color:#f0e3be;border-color:#a38b50}
|
||||
.politics-cp-shell .election-design{scrollbar-color:#a38b50 #0b271f;scrollbar-width:thin}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ export function xpReport(data){
|
|||
export function createProgressionSidebar(host,{fetcher=fetch,onBranch=()=>{},onNavigate=()=>{}}={}){
|
||||
const right=host.closest('#content')?.parentElement?.querySelector('#sidebar-right');
|
||||
if(!right)return {available:false,setJournal(){},setBranches(){},showBranches(){},setNavigation(){},dispose(){}};
|
||||
const controller=new AbortController(),summary=el('section',undefined,'mentat-report'),directory=el('details',undefined,'category-block progression-directory-menu');directory.setAttribute('aria-label','Mission branches');
|
||||
directory.open=true;const journalMenu=el('details',undefined,'category-block progression-journal-menu');journalMenu.open=true;journalMenu.setAttribute('aria-label','Journal views');let currentKind='personal',currentView='missions';const href=(kind,view)=>(location.hash.split('?')[0]||'#quests/quests')+'?'+new URLSearchParams({xp:kind,view});const closeMenus=()=>{right.classList.remove('open');right.parentElement?.querySelector('#sidebar')?.classList.remove('open');document.querySelector('#mobile-menu')?.setAttribute('aria-expanded','false');};const open=(event,kind,view)=>{event.preventDefault();history.replaceState(null,'',href(kind,view));onNavigate(kind,view);closeMenus();};
|
||||
const controller=new AbortController(),summary=el('section',undefined,'mentat-report'),directory=el('section',undefined,'category-block progression-directory-menu');directory.setAttribute('aria-label','Mission branches');
|
||||
const journalMenu=el('section',undefined,'category-block progression-journal-menu');journalMenu.setAttribute('aria-label','Journal views');let currentKind='personal',currentView='missions';const href=(kind,view)=>(location.hash.split('?')[0]||'#quests/quests')+'?'+new URLSearchParams({xp:kind,view});const closeMenus=()=>{right.classList.remove('open');right.parentElement?.querySelector('#sidebar')?.classList.remove('open');document.querySelector('#mobile-menu')?.setAttribute('aria-expanded','false');};const open=(event,kind,view)=>{event.preventDefault();history.replaceState(null,'',href(kind,view));onNavigate(kind,view);closeMenus();};
|
||||
const journals=new Map(),failures=new Set(),pending=new Set();let alive=true,player=null,mentat=null,houseState='loading',branchRows=[],branchId=null;
|
||||
const directoryBanner=right.querySelector(':scope > .side-hero'),bannerNext=directoryBanner?.nextSibling;right.prepend(summary);const left=right.parentElement?.querySelector('#sidebar');(left||right).append(journalMenu);if(left&&directoryBanner)left.append(directoryBanner);(left||right).append(directory);
|
||||
const format=n=>Number.isSafeInteger(n)?n.toLocaleString('en-GB'):'—';
|
||||
|
|
@ -37,7 +37,7 @@ export function createProgressionSidebar(host,{fetcher=fetch,onBranch=()=>{},onN
|
|||
}
|
||||
}
|
||||
function menuIcon(key){const img=el('img');img.src=typeof globalThis.uniqueMenuIcon==='function'?globalThis.uniqueMenuIcon('quests/'+key):'https://www.dunerealms.com/assets/nav-account-v2.webp';img.alt='';img.width=img.height=24;return img;}
|
||||
function menuHeading(label,count){const title=el('summary',undefined,'category-heading');title.append(menuIcon('category/'+label),el('span',label,'category-name'),el('span',String(count),'category-count'));return title;}
|
||||
function menuHeading(label,count){const title=el('div',undefined,'category-heading');title.setAttribute('role','heading');title.setAttribute('aria-level','2');title.append(menuIcon('category/'+label),el('span',label,'category-name'),el('span',String(count),'category-count'));return title;}
|
||||
function renderViews(){journalMenu.replaceChildren(menuHeading('Journal views',3));const links=el('div',undefined,'category-links');for(const [view,label]of [['missions','Missions'],['decisions','Decisions'],['history','History']]){const link=el('a',undefined,'navitem');link.append(menuIcon('view/'+view),el('span',label));link.href=href(currentKind,view);link.setAttribute('aria-current',view===currentView?'page':'false');link.onclick=event=>open(event,currentKind,view);links.append(link);}journalMenu.append(links);}
|
||||
function renderBranches(){directory.replaceChildren(menuHeading('Mission branches',branchRows.length));const links=el('div',undefined,'category-links');for(const row of branchRows){const button=el('button',undefined,'navitem');button.type='button';button.setAttribute('aria-current',row.id===branchId?'page':'false');button.append(menuIcon('branch/'+row.id),el('span',row.title));button.onclick=()=>{onBranch(row.id);closeMenus();};links.append(button);}directory.append(links);directory.hidden=!branchRows.length;}
|
||||
async function read(path){const r=await fetcher(path,{credentials:'same-origin',cache:'no-store',signal:controller.signal});if(!r.ok)throw Error('Report unavailable');return r.json();}
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
/* Compact Alphastyle category blocks — one expanded section at a time */
|
||||
.side{padding:9px 9px 16px}.side-hero{min-height:78px;margin-bottom:9px;padding:9px;font-size:18px}.mail-shortcut{margin:6px 0 10px;padding:9px 11px;font-size:13px;min-height:40px}
|
||||
.category-block{margin:7px 0;border:1px solid #806c42;border-radius:6px;background:linear-gradient(130deg,#173b27,#0b281a);box-shadow:inset 0 0 0 1px #345337;overflow:hidden}
|
||||
.category-block[open]{border-color:#c6a15d}.category-heading{display:flex;align-items:center;gap:9px;min-height:43px;padding:9px 11px;color:#f0d18d;font:600 14px Georgia,serif;cursor:pointer;list-style:none;background:linear-gradient(95deg,#315037,#142f21)}
|
||||
.category-block{border-color:#c6a15d}.category-heading{display:flex;align-items:center;gap:9px;min-height:43px;padding:9px 11px;color:#f0d18d;font:600 14px Georgia,serif;cursor:pointer;list-style:none;background:linear-gradient(95deg,#315037,#142f21)}
|
||||
.category-heading::-webkit-details-marker{display:none}.category-heading::marker{content:''}.category-heading:hover{background:#3c5739}.category-heading:focus-visible{outline:2px solid #f7d994;outline-offset:-3px}
|
||||
.category-symbol{color:#edcb82;font-size:17px}.category-name{flex:1}.category-count{border:1px solid #7c8156;border-radius:10px;min-width:25px;padding:1px 5px;text-align:center;color:#d5d5b5;font:10px Arial,sans-serif}.category-heading:after{content:'▾';color:#dcbf78;font-size:11px}.category-block:not([open]) .category-heading:after{content:'▸'}
|
||||
.category-symbol{color:#edcb82;font-size:17px}.category-name{flex:1}.category-count{border:1px solid #7c8156;border-radius:10px;min-width:25px;padding:1px 5px;text-align:center;color:#d5d5b5;font:10px Arial,sans-serif}
|
||||
.category-links{padding:4px 6px 7px;border-top:1px solid #786f46}.category-links .navitem{min-height:34px;margin:1px 0;padding:4px 6px;gap:8px;font-size:12px;border-bottom:1px solid #3c5b40}.category-links .navitem img{width:24px;height:24px}.category-links .navitem[aria-current=page]{border:1px solid #d8b86e;background:linear-gradient(90deg,#6a5930,#24442c)}.category-links .navitem:last-child{border-bottom-color:transparent}
|
||||
@media(max-width:720px){.category-heading{min-height:46px}.category-links .navitem{min-height:42px;font-size:13px}.category-links .navitem img{width:27px;height:27px}}
|
||||
|
||||
/* Compact desktop menu; preserve original Alphastyle artwork, cards and header. */
|
||||
@media(min-width:721px){.layout{grid-template-columns:minmax(210px,255px) minmax(0,1fr)}.side{padding:8px}.side-hero{min-height:76px;margin-bottom:8px;padding:8px;font-size:18px}.category-block{margin:5px 0;break-inside:avoid}.category-heading{min-height:30px;padding:5px 8px;font-size:12px}.category-symbol{font-size:14px}.category-links{padding:3px 5px}.category-links .navitem{min-height:27px;padding:3px 5px;gap:6px;font-size:11px;line-height:1.2}.category-links .navitem img{width:19px;height:19px}.mail-shortcut{min-height:30px;padding:5px 8px;margin:4px 0 7px;font-size:11px}}
|
||||
@media(max-width:720px){.category-block:not([open]) .category-links{display:none}}
|
||||
|
||||
|
||||
/* CP V2.3 — existing V1 artwork in menu headings; narrower aligned navigation */
|
||||
@media(min-width:721px){.layout{grid-template-columns:205px minmax(0,1fr)}.side{padding:7px}.category-heading{gap:7px;padding:5px 7px;min-height:32px;align-items:center}.category-heading>img{width:25px;height:25px;object-fit:contain;flex:0 0 25px;filter:drop-shadow(0 1px 2px #000)}.category-name{font-size:12px;line-height:1.15}.category-count{margin-left:auto}.category-links{padding:3px 5px}.category-links .navitem{width:100%;justify-content:flex-start;text-align:left;gap:7px;padding:4px 7px;min-height:30px}.category-links .navitem img{width:20px;height:20px;flex:0 0 20px;object-fit:contain}.category-links .navitem span{flex:1;min-width:0;text-align:left}.side-hero{font-size:16px}}
|
||||
|
|
@ -283,3 +283,6 @@
|
|||
.cp-v2-news-form .article-picture{margin:18px 0}.cp-v2-news-form .article-picture img,.cp-v2-news-form video{display:block;max-width:100%;height:auto;border-radius:10px}.cp-v2-news-form .article-seal img{width:150px}.cp-v2-news-form figcaption{color:#c7cbae;font-size:.9rem}.cp-v2-news-form details>label{display:grid;gap:8px;margin:12px 0}
|
||||
.cp-political-decision-form{display:grid;gap:1rem;max-width:48rem}.cp-political-decision-form>label{display:grid;gap:.4rem;min-width:0}.cp-political-decision-form input,.cp-political-decision-form select,.cp-political-decision-form textarea{box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
||||
.cp-political-agreement-inbox{margin-block:1.5rem;padding:1rem;border:1px solid var(--border,#a58a45);border-radius:12px}.cp-political-agreement-inbox article{padding:1rem;margin-block:1rem;background:var(--panel,#102e23);border:1px solid var(--border,#a58a45);border-radius:8px;overflow-wrap:anywhere}.cp-political-agreement-inbox article p{white-space:pre-wrap}.cp-political-agreement-inbox button{margin:.35rem .35rem .35rem 0}
|
||||
|
||||
/* Sidebar groups stay permanently expanded; scroll the page rather than clipping links. */
|
||||
.category-block .category-heading{cursor:default}.category-block .category-links{display:block}@media(max-width:720px){.layout .side.open,.layout .side-right.open{max-height:none;overflow:visible}}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ if(wid==='clan'&&!context.clanWorkspace){disposePage();disposePage=()=>{};conten
|
|||
if(wid==='post'&&!context.mailDirectoryReady&&Date.now()-postMenuTime>30000){disposePage();disposePage=()=>{};current='post';sidebar.replaceChildren(el('p','','Loading your inboxes…'));content.replaceChildren(el('p','cp-v2-news-status','Loading your authorised inboxes…'));document.querySelector('#sidebar-right').replaceChildren();if(!postMenuRequest)postMenuRequest=import('/v2/cp-v2-post-menu.mjs').then(({loadMailboxMenu})=>loadMailboxMenu()).finally(()=>{postMenuRequest=null;});postMenuRequest.then(inboxes=>{if(navigation!==renderSequence)return;const post=menu.workspaces.find(w=>w.id==='post'),channels=post.groups.find(g=>g.label==='Channels')?.items||[];post.groups=[{label:'Inboxes',items:inboxes},{label:'Channels',items:channels.filter(item=>item.id!=='shared-inbox')}];postMenuTime=Date.now();go('post',pid,{...context,mailDirectoryReady:true});}).catch(error=>{if(navigation!==renderSequence)return;const retry=el('button','gold-button','Retry inbox directory');retry.onclick=()=>go('post',pid);content.replaceChildren(el('p','cp-v2-news-status',error.message),retry);});return;}
|
||||
const initialTab=route.initialTab||context.initialTab;const requestedDesignTab=pid; if(['realm','market'].includes(wid)&&['company-directory','company-registration','company-profile','company-members','company-finance','company-permissions','company-applications'].includes(pid))pid='companies';if(wid==='bureau'&&pid==='dev-approvals'){wid='forge';pid='dev-approvals';}disposePage();disposePage=()=>{};if(wid==='bureau'&&pid==='luckperms')pid='permissions';const originalWorkspace=menu.workspaces.find(x=>x.id===wid)||menu.workspaces[0],clanRecord=context.clanWorkspace?.clans.find(c=>c.id===context.clanWorkspace.selected);const w=originalWorkspace.id==='clan'?{...originalWorkspace,groups:originalWorkspace.groups.map(g=>({...g,items:g.items.filter(item=>context.clanSwitcher?.clanPageAllowed(clanRecord,item.id)!==false)})).filter(g=>g.items.length)}:originalWorkspace;current=w.id;document.body.dataset.workspace=w.id;const items=w.groups.flatMap(g=>g.items);const item=items.find(x=>x.id===pid)||items[0];if(clanSurface&&parent!==window)parent.postMessage({type:'dune-clan-route',workspace:w.id,page:item.id,...(w.id==='clan'&&context.accountId?{accountId:context.accountId}:{})},clanParentOrigin);for(const b of portals.children)b.setAttribute('aria-selected',String(b.dataset.id===w.id));sidebar.replaceChildren();const sidebarRight=document.querySelector('#sidebar-right');sidebarRight.replaceChildren();renderComfortNavigation(w.id);const banner=el('div','side-hero',w.id==='forge'?'DEV':w.label.toUpperCase());sidebar.append(banner);sidebarRight.append(el('div','side-hero',w.id==='forge'?'DUNEGIT':w.label.toUpperCase()+' · DIRECTORY'));if(w.id==='realm'){const mail=el('button','mail-shortcut','✉ You’ve Got Mail');mail.onclick=()=>go('post','mail-inbox');sidebar.append(mail)}
|
||||
if(w.id==='clan'&&context.clanSwitcher){sidebar.append(context.clanSwitcher.createOrganisationSwitcher({kind:'clan',records:context.clanWorkspace.clans,selected:context.clanWorkspace.selected,onSelect:id=>{const u=new URL(location.href);u.searchParams.set('clan',id);history.replaceState(null,'',u);go('clan','clan-overview',{accountId:id});}}));}
|
||||
if(item.href){if(item.target==='_blank'){const link=el('a','navitem','Open osCommerce administration →');link.href=item.href;link.target='_blank';link.rel='noopener noreferrer';content.replaceChildren(link);window.open(item.href,'_blank','noopener,noreferrer');}else location.assign(item.href);return;}const groups=w.groups.map(g=>({...g,items:g.items.filter(x=>!x.dashboardOnly)})).filter(g=>g.items.length);let split=groups.length,best=Infinity;for(let i=1;i<groups.length;i++){const a=groups.slice(0,i).reduce((n,g)=>n+g.items.length+2,0),b=groups.slice(i).reduce((n,g)=>n+g.items.length+2,0),delta=Math.abs(a-b);if(delta<best){best=delta;split=i}}if(w.id==='forge')split=groups.findIndex(g=>g.label==='DuneGit');if(w.id==='post')split=1;for(const [gi,g] of groups.entries()){const target=sidebar;const block=el('details','category-block');block.open=true;const heading=el('summary','category-heading');heading.append(categoryTitleImage(g.label,w.id),el('span','category-name',g.label),el('span','category-count',String(g.items.length)));block.append(heading);const links=el('div','category-links');for(const x of g.items){const b=el(x.href?'a':'button','navitem');if(x.href){b.href=x.href;if(x.target==='_blank'){b.target='_blank';b.rel='noopener noreferrer';}}else b.type='button';b.append(submenuArtwork(x,g,w.id),el('span','',x.label));b.setAttribute('aria-current',x.id===item.id?'page':'false');if(!x.href)b.onclick=()=>go(w.id,x.id);links.append(b)}block.append(links);target.append(block)}content.replaceChildren();const hero=el('div','hero');hero.append(image(art[w.id]));const title=el('div');title.append(el('h1','',item.label),el('p','',w.id==='clan'?'Your household, its banner and the people who carry it.':'Realm management, account tools and personal operations.'));hero.append(title);content.append(hero);
|
||||
if(item.href){if(item.target==='_blank'){const link=el('a','navitem','Open osCommerce administration →');link.href=item.href;link.target='_blank';link.rel='noopener noreferrer';content.replaceChildren(link);window.open(item.href,'_blank','noopener,noreferrer');}else location.assign(item.href);return;}const groups=w.groups.map(g=>({...g,items:g.items.filter(x=>!x.dashboardOnly)})).filter(g=>g.items.length);let split=groups.length,best=Infinity;for(let i=1;i<groups.length;i++){const a=groups.slice(0,i).reduce((n,g)=>n+g.items.length+2,0),b=groups.slice(i).reduce((n,g)=>n+g.items.length+2,0),delta=Math.abs(a-b);if(delta<best){best=delta;split=i}}if(w.id==='forge')split=groups.findIndex(g=>g.label==='DuneGit');if(w.id==='post')split=1;for(const [gi,g] of groups.entries()){const target=sidebar;const block=el('section','category-block');const heading=el('div','category-heading');heading.setAttribute('role','heading');heading.setAttribute('aria-level','2');heading.append(categoryTitleImage(g.label,w.id),el('span','category-name',g.label),el('span','category-count',String(g.items.length)));block.append(heading);const links=el('div','category-links');for(const x of g.items){const b=el(x.href?'a':'button','navitem');if(x.href){b.href=x.href;if(x.target==='_blank'){b.target='_blank';b.rel='noopener noreferrer';}}else b.type='button';b.append(submenuArtwork(x,g,w.id),el('span','',x.label));b.setAttribute('aria-current',x.id===item.id?'page':'false');if(!x.href)b.onclick=()=>go(w.id,x.id);links.append(b)}block.append(links);target.append(block)}content.replaceChildren();const hero=el('div','hero');hero.append(image(art[w.id]));const title=el('div');title.append(el('h1','',item.label),el('p','',w.id==='clan'?'Your household, its banner and the people who carry it.':'Realm management, account tools and personal operations.'));hero.append(title);content.append(hero);
|
||||
const cards=el('div','cards');content.append(cards);
|
||||
function card(name,icon,full=false){const c=el('article','card'+(full?' full':''));const h=el('h2');h.append(image(icon),document.createTextNode(name));c.append(h);cards.append(c);return c}
|
||||
function button(name,fn){const b=el('button','gold-button',name);b.onclick=fn;return b}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ release=pathlib.Path('/home/dunerealms/apps/dunerealms/current').resolve(strict=
|
|||
assert release.name=='ci-'+args.expected_release
|
||||
base=pathlib.Path('/home/dunerealms/apps/integrations').resolve(strict=True)
|
||||
node='/home/dunerealms/.nvm/versions/node/v22.23.3/bin/node'
|
||||
result=subprocess.run([node,'--input-type=module','-e',"import {SHARED_HEADER,SHARED_HEAD} from './scripts/portal-navigation.mjs';import {sharedHomepageHeaderScript} from './scripts/homepage-header.mjs';console.log(JSON.stringify({header:SHARED_HEADER,head:SHARED_HEAD,runtime:sharedHomepageHeaderScript()}));"],cwd=release,capture_output=True,text=True,check=True)
|
||||
chrome=json.loads(result.stdout);script=(release/'web/realm-design.js').read_text()+chrome['runtime'];support_css=(release/'scripts/osticket-presentation.css').read_text();forum_css=(release/'scripts/mybb-presentation.css').read_text();css=(release/'web/realm-design.css').read_text()+'\n'+(release/'scripts/homepage-header.css').read_text()+'\n'+support_css+'\n'+forum_css;assert '__duneRealmDesign' in script and 'dr-native' in css and 'data-shared-header-source="homepage"' in chrome['header']
|
||||
result=subprocess.run([node,'--input-type=module','-e',"import {SHARED_HEADER,SHARED_HEAD} from './scripts/portal-navigation.mjs';import {sharedHomepageHeaderScript} from './scripts/homepage-header.mjs';import {SHARED_FOOTER,sharedFooterBrandScript} from './scripts/site-chrome.mjs';console.log(JSON.stringify({header:SHARED_HEADER,head:SHARED_HEAD,footer:SHARED_FOOTER,runtime:sharedHomepageHeaderScript()+sharedFooterBrandScript()}));"],cwd=release,capture_output=True,text=True,check=True)
|
||||
chrome=json.loads(result.stdout);script=(release/'web/realm-design.js').read_text()+chrome['runtime'];support_css=(release/'scripts/osticket-presentation.css').read_text();forum_css=(release/'scripts/mybb-presentation.css').read_text();css=(release/'web/realm-design.css').read_text()+'\n'+(release/'scripts/homepage-header.css').read_text()+'\n'+support_css+'\n'+forum_css+'\n'+(release/'scripts/shared-footer.css').read_text();assert '__duneRealmDesign' in script and 'dr-native' in css and 'data-shared-header-source="homepage"' in chrome['header']
|
||||
start='/* DUNE REALM DESIGN START */';end='/* DUNE REALM DESIGN END */'
|
||||
def append(old,content):
|
||||
if start in old:
|
||||
|
|
@ -18,8 +18,9 @@ native_head=chrome['head'].replace('href="/portal-navigation.css"','href="https:
|
|||
# Native services execute the compiled same-origin navigation script, which
|
||||
# already includes realm-design.js. Keep their existing script security policy.
|
||||
native_head=re.sub(r'<script\b[^>]*src="[^"]*/realm-design\.js[^>]*></script>','',native_head)
|
||||
changes={'shared-header.html':chrome['header'],'shared-header-head.html':native_head}
|
||||
changes={'shared-header.html':chrome['header'],'shared-header-head.html':native_head,'shared-footer.html':chrome['footer']}
|
||||
hook=base/'shared-header.php';original_hook=hook.read_text();assert any(v in original_hook for v in ('v=canonical-362','v=realm-design-1','v=template-fix-6000'))
|
||||
original_hook='\n'.join(line for line in original_hook.split('\n') if 'shared-memorial.html' not in line)
|
||||
changes['shared-header.php']=original_hook.replace('v=canonical-362','v=template-fix-6000').replace('v=realm-design-1','v=template-fix-6000').replace('dune-osticket-theme.css?v=20261103-alpha','dune-osticket-theme.css?v=template-fix-6000').replace('dune-forum-polish.css?v=328-1','dune-forum-polish.css?v=template-fix-6000')
|
||||
for app in ['mybb','osticket']:
|
||||
for ext,content in [('js',(release/'dist/shared-chrome/portal-navigation.js').read_text()),('css',(release/'dist/shared-chrome/portal-navigation.css').read_text()+'\n'+re.sub(r'^@import[^;]+;\s*','',css))]:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {applySharedHeader,applySharedFooter,SHARED_FOOTER_SCRIPT,cleanLegacyChromeScript,assertSharedChrome} from './site-chrome.mjs';
|
||||
import {applySharedHeader,applySharedFooter,SHARED_FOOTER_SCRIPT,cleanLegacyChromeScript,assertSharedChrome,sharedFooterBrandScript} from './site-chrome.mjs';
|
||||
import {SHARED_HEADER} from './portal-navigation.mjs';
|
||||
import {sharedHomepageHeaderScript} from './homepage-header.mjs';
|
||||
import {applyRealmPageDesign} from './realm-page-design.mjs';
|
||||
|
|
@ -14,8 +14,8 @@ import{updatePortalNavigation}from'./portal-navigation.mjs';
|
|||
import {readFileSync,writeFileSync as writePlain,renameSync,unlinkSync,openSync,writeSync,closeSync,readdirSync,statSync,mkdirSync,existsSync,rmSync,cpSync} from 'node:fs';import path from 'node:path';import {fileURLToPath} from 'node:url';
|
||||
function writeFileSync(file,content){const temporary=file+'.build-'+process.pid;writePlain(temporary,content);renameSync(temporary,file);}
|
||||
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..'),web=path.join(root,'web'),dist=path.join(root,'dist');
|
||||
const sharedRealmRuntime=readFileSync(path.join(web,'realm-design.js'),'utf8')+sharedHomepageHeaderScript();
|
||||
const sharedRealmCSS=Buffer.concat([readFileSync(path.join(web,'realm-design.css')),readFileSync(new URL('./homepage-header.css',import.meta.url)),readFileSync(new URL('./osticket-presentation.css',import.meta.url)),readFileSync(new URL('./mybb-presentation.css',import.meta.url))]);
|
||||
const sharedRealmRuntime=readFileSync(path.join(web,'realm-design.js'),'utf8')+sharedHomepageHeaderScript()+sharedFooterBrandScript();
|
||||
const sharedRealmCSS=Buffer.concat([readFileSync(path.join(web,'realm-design.css')),readFileSync(new URL('./homepage-header.css',import.meta.url)),readFileSync(new URL('./osticket-presentation.css',import.meta.url)),readFileSync(new URL('./mybb-presentation.css',import.meta.url)),readFileSync(new URL('./shared-footer.css',import.meta.url))]);
|
||||
// Embedded workspaces execute the same runtime through their permitted origin.
|
||||
writeFileSync(path.join(root,'control-panel/public/cp-v2/cp-v2-realm-design.mjs'),sharedRealmRuntime);
|
||||
// CP entry documents are served directly by the existing CP process. Compile their
|
||||
|
|
|
|||
|
|
@ -15,3 +15,9 @@ dune-shared-header[hidden]{display:none!important}
|
|||
:host .shared-menu-badge{display:inline-block;margin-left:6px;font-size:9px;color:var(--gold-light)}
|
||||
@media(max-width:850px){:host .shared-account-group{display:none}}
|
||||
@media(max-width:640px){:host .nav-actions .button{min-height:35px;font-size:11px}}
|
||||
|
||||
:host .masthead{height:230px}
|
||||
:host .brand{display:flex;flex-direction:column;align-items:center;gap:4px}
|
||||
:host .shared-alpha-badge{display:block;width:max-content;padding:3px 11px;border:1px solid #ba9952;border-radius:20px;background:linear-gradient(120deg,#102d25,#263c2a);color:#ead190;font:600 11px/1.4 system-ui,sans-serif;letter-spacing:.09em;text-align:center;white-space:nowrap;box-shadow:0 2px 8px #0003}
|
||||
:host .shared-alpha-badge::before{content:'✦';margin-right:6px;color:#cda64f}
|
||||
@media(max-width:640px){:host .masthead{height:182px}}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ export function mountSharedHomepageHeader(template,groups,root){
|
|||
const load=(path)=>{const link=document.createElement('link');link.rel='stylesheet';link.href=from+path;shadow.append(link);return new Promise(resolve=>{link.onload=()=>resolve(true);link.onerror=()=>resolve(false);});};
|
||||
const loaded=[load('/preview/portal.css'),load('/preview/sections.css'),load('/realm-design.css?v=shared-homepage-header-1')];
|
||||
const holder=document.createElement('template');holder.innerHTML=template;shadow.append(holder.content);
|
||||
const brand=shadow.querySelector('.brand'),releaseBadge=document.createElement('span');releaseBadge.className='shared-alpha-badge';releaseBadge.textContent='Alpha';brand.append(releaseBadge);
|
||||
const releaseApi=location.hostname==='cp.dunerealms.com'?'/api/menu-badges':'https://cp.dunerealms.com/api/menu-badges';
|
||||
fetch(releaseApi,{cache:'no-store'}).then(r=>{if(!r.ok)throw Error();return r.json();}).then(data=>{if(!/^\d+(?:\.\d+){3}$/.test(data.releaseVersion))throw Error();return data.releaseVersion;}).catch(()=>fetch('/release.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>data?.version)).then(version=>{if(/^\d+(?:\.\d+){3}$/.test(version||''))releaseBadge.textContent='Alpha '+version;}).catch(()=>{});
|
||||
const nav=shadow.querySelector('#portal-navigation'),toggle=shadow.querySelector('.menu-toggle'),actions=shadow.querySelector('.nav-actions');
|
||||
// Reuse the original homepage structure, maintaining all PR602 destinations in the matching menu groups.
|
||||
const addLink=(box,label,href)=>{const a=document.createElement('a');a.href=href;a.textContent=label;box.append(a);};
|
||||
|
|
|
|||
|
|
@ -43,3 +43,10 @@ html body:is(.dune-forum,.dr-native-boards) #footer :is(.upper,.lower){backgroun
|
|||
html body:is(.dune-forum,.dr-native-boards) .dune-board-panels{padding:8px!important;gap:8px!important}
|
||||
html body:is(.dune-forum,.dr-native-boards) .dune-board-forums td{padding:7px 5px!important;font-size:12px!important}
|
||||
}
|
||||
/* MyBB's index inserts its root navigation inside #content>.wrapper followed by a BR.
|
||||
It repeats the illustrated root banner; retain breadcrumbs on every non-index page. */
|
||||
html body:is(.dune-forum,.dr-native-boards) #content:has(.dune-board-category)>.wrapper>.navigation,
|
||||
html body:is(.dune-forum,.dr-native-boards) #content:has(.dune-board-category)>.wrapper>.navigation+br{display:none!important}
|
||||
html body:is(.dune-forum,.dr-native-boards) #content:has(.dune-board-category)>.wrapper{padding-top:0!important;margin-top:0!important}
|
||||
html body:is(.dune-forum,.dr-native-boards) #content:has(.dune-board-category) .dune-board-category:first-of-type{margin-top:4px!important}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,3 +58,17 @@ html body:is(.dune-support,.dr-native-support) :is(.ticket-info,.ticket_info,.th
|
|||
html body:is(.dune-support,.dr-native-support) :is(#ticketTable,table.list,table.listings,table.queue){font-size:13px!important}
|
||||
html body:is(.dune-support,.dr-native-support) :is(#ticketTable,table.list,table.listings,table.queue) :is(th,td){padding:9px!important}
|
||||
}
|
||||
|
||||
/* Native thread chrome: preserve downloads, reply actions and real avatar images. */
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry::before{border-top:1px solid #79643b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry::after{border-bottom:1px solid #79643b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry .thread-body{border-color:#79643b!important;border-bottom:1px solid #79643b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-body .attachments{background:#17372c!important;border-top:1px solid #79643b!important;color:#f4e8ca!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-body .attachment-info{color:#f0d89b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-body .attachments a.filename{color:#f2d593!important;text-decoration:underline!important;text-underline-offset:3px}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-body .attachments .filesize{color:#b5c4b8!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry.avatar.message .header:before{border-left-color:#79643b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry.avatar.message .header:after{border-left-color:#1a3b2e!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry.avatar:is(.response,.note) .header:before{border-right-color:#79643b!important}
|
||||
html body:is(.dune-support,.dr-native-support) .thread-entry.avatar:is(.response,.note) .header:after{border-right-color:#1a3b2e!important}
|
||||
html body:is(.dune-support,.dr-native-support) :is(.thread-entry,.thread-event) img.avatar{background:#17372c!important;border:1px solid #79643b!important;border-radius:5px!important}
|
||||
|
|
|
|||
32
website/scripts/shared-footer.css
Normal file
32
website/scripts/shared-footer.css
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* Canonical shared footer layout belongs to the realm stylesheet, including public pages
|
||||
that do not load portal-navigation.css and native workspace iframe documents. */
|
||||
body.dr-design footer.dune-shared-footer{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:space-between!important;gap:10px 24px!important;padding:18px max(24px,4%)!important;background:#10271f!important;border-top:1px solid #74663f!important;border-bottom:0!important;margin-top:20px!important;box-sizing:border-box!important;max-width:none!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-footer-brand{font:700 19px/1.4 system-ui!important;letter-spacing:0!important;color:#dfbe78!important}
|
||||
body.dr-design footer.dune-shared-footer nav{display:flex!important;position:static!important;flex-direction:row!important;flex-wrap:wrap!important;gap:10px 20px!important;padding:0!important;background:none!important;border:0!important;font:12px/1.5 system-ui!important}
|
||||
body.dr-design footer.dune-shared-footer nav a{display:inline-block!important;padding:0!important;min-height:0!important;background:none!important;border:0!important;text-decoration:none!important;white-space:nowrap!important}
|
||||
body.dr-design footer.dune-shared-footer nav a:hover{text-decoration:underline!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-badge{display:inline-flex!important;align-items:center!important;gap:12px!important;padding:9px 15px!important;border:1px solid #a88e4b!important;border-radius:7px!important;background:linear-gradient(135deg,#294636,#0d241b)!important;box-shadow:inset 0 0 0 3px #d1b66b12,0 3px 8px #0003!important;text-decoration:none!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-art{font-size:38px!important;line-height:1!important;color:#d5b66b!important;border:1px solid #857847!important;padding:2px 7px!important;border-radius:4px!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-badge>span:last-child{display:grid!important;gap:5px!important}
|
||||
body.dr-design footer.dune-shared-footer>small{flex-basis:100%!important;border:0!important;padding:0!important;font:10px/1.5 system-ui!important;letter-spacing:0!important;text-align:left!important;color:#b7c3b5!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-memorial{display:none!important}
|
||||
body.dr-design footer.dune-shared-footer[hidden],html.dune-embedded body.dr-design footer.dune-shared-footer,html.dune-embedded body.dr-design footer.site-footer{display:none!important}
|
||||
@media(max-width:760px){body.dr-design footer.dune-shared-footer{gap:12px!important;padding:15px 20px!important}}
|
||||
|
||||
body.dr-design a.skip:not(:focus-visible){position:fixed!important;top:-100px!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important}
|
||||
body.dr-design a.skip:focus-visible{position:fixed!important;top:12px!important;left:20px!important;width:auto!important;height:auto!important;clip-path:none!important;overflow:visible!important;z-index:1000!important}
|
||||
|
||||
body.dr-design footer.dune-shared-footer .dune-footer-sponsors{display:flex!important;align-items:center!important;gap:12px!important;flex-wrap:wrap!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-corrino-badge{display:flex!important;align-items:center!important;justify-content:center!important;min-height:54px!important;padding:6px 10px!important;border:1px solid #a88e4b!important;border-radius:7px!important;background:#10271f!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-corrino-badge img{display:block!important;width:125px!important;height:44px!important;object-fit:contain!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-badge{min-height:54px!important;flex-direction:column!important;gap:4px!important;padding:6px 12px!important;justify-content:center!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-badge>span{display:block!important;font:10px/1.2 system-ui!important;color:#e4c77f!important;letter-spacing:.08em!important}
|
||||
body.dr-design footer.dune-shared-footer .dune-hosting-badge img{display:block!important;width:120px!important;height:20px!important;object-fit:contain!important;background:#fff!important;border-radius:3px!important;padding:3px 6px!important}
|
||||
/* Keep sponsor marks side by side on the same footer row on every desktop page. */
|
||||
body.dr-design footer.dune-shared-footer .dune-footer-sponsors{flex:0 0 auto!important;width:max-content!important;max-width:100%!important;flex-wrap:nowrap!important}
|
||||
body.dr-design footer.dune-shared-footer>nav{flex:1 1 380px!important;min-width:0!important;justify-content:center!important}
|
||||
body.dr-design footer.dune-shared-footer>.dune-footer-brand{flex:0 0 auto!important}
|
||||
@media(max-width:480px){body.dr-design footer.dune-shared-footer .dune-footer-sponsors{flex-wrap:wrap!important}body.dr-design footer.dune-shared-footer>nav{flex-basis:100%!important;justify-content:flex-start!important}}
|
||||
|
||||
body.dr-design footer.dune-shared-footer .dune-footer-sponsors{flex-direction:row!important}
|
||||
|
||||
|
|
@ -1,14 +1,22 @@
|
|||
/** Shared site chrome. Public pages and native adapters consume these same templates. */
|
||||
export const SHARED_FOOTER = `<footer class="dune-shared-footer" data-shared-chrome="3"><a class="dune-footer-brand" href="https://www.dunerealms.com/">✦ dunerealms.com</a><nav aria-label="Footer navigation"><a href="https://wiki.dunerealms.com/">Dunopedia</a><a href="https://support.dunerealms.com/">Support</a><a href="https://cp.dunerealms.com/">Account</a><a href="https://www.dunerealms.com/wiki.html">Disclaimer & contact</a><a data-dune-git-footer="1" href="https://www.dunerealms.com/git/unimatrix/MC">DuneGit</a><a href="https://www.dunerealms.com/api.html">Developer API</a><a href="https://www.dunerealms.com/rates-and-charges.html">Rates & Charges</a></nav><a class="dune-hosting-badge" href="https://www.hetzner.com/" target="_blank" rel="noopener noreferrer"><span class="dune-hosting-art" aria-hidden="true">▤</span><span>Powered by <strong>Hetzner</strong></span></a><small>Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.</small></footer>`;
|
||||
export const FOOTER_SPONSORS="<div class=\"dune-footer-sponsors\" data-footer-sponsors=\"1\"><a class=\"dune-corrino-badge\" href=\"https://www.dunerealms.com/corrino-group.html\" aria-label=\"Corrino Group\"><img src=\"https://www.dunerealms.com/assets/corrino-group-v4.png\" alt=\"Corrino Group\" width=\"165\" height=\"58\"></a><a class=\"dune-hosting-badge\" href=\"https://www.hetzner.com/\" target=\"_blank\" rel=\"noopener noreferrer\"><span>Powered by</span><img src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEuNDIgMjIuMjQiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZDUwYzJkO308L3N0eWxlPjwvZGVmcz48dGl0bGU+RWxlbWVudCAxPC90aXRsZT48ZyBpZD0iRWJlbmVfMiIgZGF0YS1uYW1lPSJFYmVuZSAyIj48ZyBpZD0iTG9nb19QdXIiIGRhdGEtbmFtZT0iTG9nbyBQdXIiPjxnIGlkPSJMb2dvIj48ZyBpZD0iSEVUWk5FUiI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTc0LjA1LDE0LjEyYTEwLjIyLDEwLjIyLDAsMCwwLDQuNTMtMmwwLDBhNi4xNSw2LjE1LDAsMCwwLDEuNjgtNC43OCw3LjcxLDcuNzEsMCwwLDAtMS4xNC00LjA2QTYuNDcsNi40NywwLDAsMCwxNzMuODQuMDlsLTEuMDksMEwxNzAuMiwwLDE1OC42NiwwYy0uNywwLTEsLjI5LTEsMVYyMS4yMmMwLC43LjI5LDEsMSwxaDNjLjcsMCwxLS4yOSwxLTF2LTYuN2gzLjY3YTMuNDgsMy40OCwwLDAsMSwyLjE3LjkxbDUuODIsNS44NWEzLjA4LDMuMDgsMCwwLDAsMiwuOTJoNC40N2MuNywwLC44Ny0uNDEuMzgtLjkxWm0tLjc2LTQuM0gxNjIuNjRWNC43MmgxMC42NWEyLjEzLDIuMTMsMCwwLDEsMS44NywyLjE1di43OUEyLjE0LDIuMTQsMCwwLDEsMTczLjI5LDkuODJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUzLDE3LjUySDEzNi40N1YxMy4zNWgxMy4xOWMuNywwLDEtLjI5LDEtMVY5LjkyYzAtLjctLjI5LTEtMS0xaC0xMy4yVjQuNzZIMTUzYy43LDAsMS0uMjksMS0xVjFjMC0uNy0uMjktMS0xLTFIMTMyLjM4Yy0uNywwLTEsLjI5LTEsMVYyMS4yNGMwLC43LjI5LDEsMSwxSDE1M2MuNywwLDEtLjI5LDEtMVYxOC41MUMxNTQsMTcuODEsMTUzLjY3LDE3LjUyLDE1MywxNy41MloiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMjcuNzMsNy4zYTcuMjUsNy4yNSwwLDAsMC0xLjEzLTRBNi42MSw2LjYxLDAsMCwwLDEyMS4yNCwwTDEwNi4wOCwwYy0uNzEsMC0xLC4yOS0xLDFWMjEuMjJjMCwuNy4yOSwxLDEsMWgzLjI2Yy43LDAsMS0uMjgsMS0xVjQuNzNsOC43OCwwYzEuODcsMCwzLjY5LDEuMjQsMy42OSwzLjExVjIxLjI0YzAsLjcuMjksMSwxLDFoMi45NWMuNzEsMCwxLS4yOSwxLTFaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTAwLjQ3LDE3LjM5bC0xNC4yNSwwTDEwMC41LDQuODRhMi41NywyLjU3LDAsMCwwLDEtMS44NFYxYzAtLjctLjMtMS0xLTFINzkuODNjLS43LDAtMSwuMjktMSwxVjMuNzdjMCwuNy4yOSwxLDEsMUg5My4wOEw3OS43OSwxNy4yNGEyLjYyLDIuNjIsMCwwLDAtMSwxLjg0djIuMTdjMCwuNy4yOSwxLDEsMWwyMC42NSwwYy43LDAsMS0uMjksMS0xVjE4LjM4QzEwMS40NiwxNy42OCwxMDEuMTcsMTcuMzksMTAwLjQ3LDE3LjM5WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTc0LjE5LDBINTMuNTVjLS43MSwwLTEsLjI4LTEsMVYzLjc2YzAsLjcuMjgsMSwxLDFoNy43OFYyMS4yNGMwLC43LjI5LDEsMSwxaDMuM2MuNywwLDEtLjI5LDEtMVY0Ljc1aDcuNTdjLjcsMCwxLS4yOSwxLTFWMUM3NS4xOC4zMiw3NC44OSwwLDc0LjE5LDBaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDcuOTEsMTcuNTJIMzEuNDFWMTMuMzVINDQuNmMuNywwLDEtLjI5LDEtMVY5LjkyYzAtLjctLjI4LTEtMS0xSDMxLjQxVjQuNzZoMTYuNWMuNywwLDEtLjI5LDEtMVYxYzAtLjctLjI5LTEtMS0xSDI3LjMzYy0uNywwLTEsLjI5LTEsMVYyMS4yNGMwLC43LjI5LDEsMSwxSDQ3LjkxYy43LDAsMS0uMjksMS0xVjE4LjUxQzQ4LjksMTcuODEsNDguNjEsMTcuNTIsNDcuOTEsMTcuNTJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNjMsMEgxOC41MmMtLjcsMC0xLC4yOS0xLDFWOC44N0g1LjEzVjFjMC0uNy0uMjktMS0xLTFIMUMuMjksMCwwLC4yOSwwLDFWMjEuMjVjMCwuNzEuMjksMSwxLDFINC4xM2MuNywwLDEtLjI4LDEtMXYtOGgxMi40djhjMCwuNy4yOSwxLDEsMWgzLjExYy43LDAsMS0uMjksMS0xVjFDMjIuNjIuMzIsMjIuMzMsMCwyMS42MywwWiIvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=\" alt=\"Hetzner\" width=\"181\" height=\"22\"></a></div>";
|
||||
export const SHARED_FOOTER = `<footer class="dune-shared-footer" data-shared-chrome="3"><a class="dune-footer-brand" href="https://www.dunerealms.com/">✦ dunerealms.com</a><nav aria-label="Footer navigation"><a href="https://wiki.dunerealms.com/">Dunopedia</a><a href="https://support.dunerealms.com/">Support</a><a href="https://cp.dunerealms.com/">Account</a><a href="https://www.dunerealms.com/wiki.html">Disclaimer & contact</a><a data-dune-git-footer="1" href="https://www.dunerealms.com/git/unimatrix/MC">DuneGit</a><a data-dune-api-footer="1" href="https://www.dunerealms.com/api.html">Developer API</a><a data-bank-rates="1" href="https://www.dunerealms.com/rates-and-charges.html">Rates & Charges</a></nav>${FOOTER_SPONSORS}<small>Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.</small></footer>`;
|
||||
export function applySharedFooter(html){
|
||||
const existing=html.match(/<footer\b[^>]*>[\s\S]*?<\/footer>/);
|
||||
if(!existing)return html.replace('</body>',SHARED_FOOTER+'</body>');
|
||||
// Keep authored memorial/award artwork when replacing legacy footer navigation.
|
||||
// The footer no longer carries the decorative Patrick Stewart memorial; dedicated awards pages are untouched.
|
||||
const memorial=existing[0].match(/<(aside|section)\b[^>]*class="[^"]*(?:memorial|tribute)[^"]*"[^>]*>[\s\S]*?<\/\1>/)?.[0]||'';
|
||||
return html.replace(existing[0],SHARED_FOOTER.replace('</footer>',memorial+'</footer>'));
|
||||
return html.replace(existing[0],SHARED_FOOTER.replace('</footer>',/dune-memorial|Patrick Stewart/i.test(memorial)?'</footer>':memorial+'</footer>'));
|
||||
}
|
||||
export const SHARED_FOOTER_SCRIPT=`(()=>{if(window.top!==window.self)return;const html=${JSON.stringify(SHARED_FOOTER)};let footer=document.querySelector('body>footer,.dune-shared-footer');if(footer?.dataset.sharedChrome==='3')return;const memorial=document.querySelector('.dune-memorial');const template=document.createElement('template');template.innerHTML=html;const fresh=template.content.firstElementChild;if(memorial)fresh.append(memorial);if(footer)footer.replaceWith(fresh);else document.body.append(fresh);})();`;
|
||||
export const SHARED_FOOTER_SCRIPT=`(()=>{if(window.top!==window.self)return;const html=${JSON.stringify(SHARED_FOOTER)};let footer=document.querySelector('body>footer,.dune-shared-footer');if(footer?.dataset.sharedChrome==='3')return;const template=document.createElement('template');template.innerHTML=html;const fresh=template.content.firstElementChild;if(footer)footer.replaceWith(fresh);else document.body.append(fresh);})();`;
|
||||
|
||||
// Existing native adapters and old compiled pages use this same canonical sponsor fragment.
|
||||
function mountSharedFooterBrands(html){
|
||||
if(window.top!==window.self)return;
|
||||
function sync(){for(const footer of document.querySelectorAll('footer.dune-shared-footer')){if(footer.querySelector('[data-footer-sponsors]'))continue;const template=document.createElement('template');template.innerHTML=html;const old=footer.querySelector('.dune-hosting-badge');if(old)old.replaceWith(template.content);else footer.insertBefore(template.content,footer.querySelector('small'));}}
|
||||
sync();new MutationObserver(sync).observe(document.body,{childList:true,subtree:true});
|
||||
}
|
||||
export function sharedFooterBrandScript(){return '\n;('+mountSharedFooterBrands.toString()+')('+JSON.stringify(FOOTER_SPONSORS)+');\n';}
|
||||
export function applySharedHeader(html,header,label){
|
||||
if(/<header\b[^>]*class="[^"]*dune-site-header/.test(html))return html.replace(/<header\b[^>]*class="[^"]*dune-site-header[^"]*"[^>]*>[\s\S]*?<\/header>/,header);
|
||||
// Non-homepage legacy mastheads are compiled into the shared header as before.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import test from 'node:test';
|
|||
import assert from 'node:assert/strict';
|
||||
import {readFile} from 'node:fs/promises';
|
||||
import {sharedHomepageHeaderScript} from '../scripts/homepage-header.mjs';
|
||||
import {sharedFooterBrandScript} from '../scripts/site-chrome.mjs';
|
||||
import {LocalD1} from './d1-adapter.mjs';
|
||||
import {createPanel} from '../control-panel/server.mjs';
|
||||
import {NATIVE_SERVICES,nativeServiceAccess} from '../control-panel/public/cp-v2/cp-v2-native-services.mjs';
|
||||
|
|
@ -11,7 +12,7 @@ test('actual CP router serves the dedicated clan page and assets without requiri
|
|||
try{
|
||||
for(const [file,mime]of [['clan-center.html','text/html'],['clan-center-entry.mjs','javascript'],['clan-center.css','text/css'],['v2/cp-v2-realm-design.mjs','javascript']]){
|
||||
const response=await app(new Request('https://cp.dunerealms.com/'+file));assert.equal(response.status,200,file);assert.ok(response.headers.get('content-type').includes(mime));
|
||||
if(file==='v2/cp-v2-realm-design.mjs')assert.equal(await response.text(),(await readFile(new URL('../web/realm-design.js',import.meta.url),'utf8'))+sharedHomepageHeaderScript());
|
||||
if(file==='v2/cp-v2-realm-design.mjs')assert.equal(await response.text(),(await readFile(new URL('../web/realm-design.js',import.meta.url),'utf8'))+sharedHomepageHeaderScript()+sharedFooterBrandScript());
|
||||
if(file.endsWith('.html')){const html=await response.text();assert.match(html,/id="dashboard"/);assert.doesNotMatch(html,/v2\/v2\.js|src="\/panel\.js"|id="portals"/);}
|
||||
}
|
||||
}finally{db.close();}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ test('homepage retains its original header and dropdowns while sharing the foote
|
|||
assert.throws(()=>assertSharedChrome(next.replace('<main',SHARED_HEADER+'<main'),SHARED_HEADER,'index.html'));
|
||||
assert(applySharedHeader(source,SHARED_HEADER,'preview/portal.html').includes('class="dune-site-header"'));
|
||||
});
|
||||
test('footer replacement retains memorial artwork and preserves separate legal content',()=>{
|
||||
test('footer replacement removes footer-only tribute but preserves dedicated memorial content and legal notice',()=>{
|
||||
const memorial='<aside class="dune-memorial"><img src="seal.png"><blockquote>Existing text</blockquote></aside>',legal='<aside class="legal-notice">Legal text</aside>';
|
||||
const next=applySharedFooter('<body>'+legal+'<footer>Old links'+memorial+'</footer></body>');
|
||||
const next=applySharedFooter('<body>'+legal+'<main>'+memorial+'</main><footer>Old links'+memorial+'</footer></body>');
|
||||
assert(next.includes(memorial));assert(next.includes(legal));assert.equal((next.match(/class="dune-memorial"/g)||[]).length,1);
|
||||
});
|
||||
test('all authored public pages can be normalised to one shared footer',()=>{
|
||||
|
|
|
|||
|
|
@ -44,3 +44,22 @@ test('native publisher and website build publish the same header and both presen
|
|||
assert(pub.includes('data-shared-header-source="homepage"'));
|
||||
assert(pub.includes('mybb/inc/plugins/dune_sections.php'));
|
||||
});
|
||||
test('shared footer canonical markers prevent legacy observers re-appending canonical links',()=>{
|
||||
assert.match(read('scripts/site-chrome.mjs'),/data-dune-api-footer="1" href="https:\/\/www\.dunerealms\.com\/api\.html"/);
|
||||
assert.match(read('scripts/site-chrome.mjs'),/data-bank-rates="1" href="https:\/\/www\.dunerealms\.com\/rates-and-charges\.html"/);
|
||||
const runtime=read('web/realm-design.js'),css=read('scripts/shared-footer.css');
|
||||
assert.match(runtime,/if\(embedded\)\{for\(const footer of footers\)footer\.hidden=true/);
|
||||
assert.match(runtime,/footer\.querySelectorAll\('.dune-memorial'\)/);
|
||||
assert.match(runtime,/keeper\.after\(notice\)/);
|
||||
assert.match(css,/footer\.dune-shared-footer nav\{display:flex!important/);
|
||||
assert.match(css,/html\.dune-embedded body\.dr-design footer\.dune-shared-footer/);
|
||||
});
|
||||
test('footer sponsors use the approved existing logos, version badge reads the authority, and native fallback avatars never force replacement',()=>{
|
||||
const chrome=read('scripts/site-chrome.mjs'),header=read('scripts/homepage-header.mjs'),runtime=read('web/realm-design.js'),support=read('scripts/osticket-presentation.css'),footer=read('scripts/shared-footer.css');
|
||||
assert.match(chrome,/corrino-group-v4\.png/);assert.match(chrome,/data:image\/svg\+xml;base64,/);
|
||||
assert.match(header,/\/api\/menu-badges/);assert.match(header,/\/release\.json/);assert.match(header,/releaseBadge\.textContent='Alpha '\+version/);
|
||||
assert.match(runtime,/\['mm','mp'\]\.includes\(fallback\)/);assert.match(runtime,/!u\.searchParams\.has\('forcedefault'\)/);assert.match(runtime,/support-avatar-default\.png/);
|
||||
assert.match(support,/\.thread-body \.attachments\{background:#17372c/);
|
||||
assert.match(footer,/\.dune-footer-sponsors\{flex-direction:row!important/);assert.match(footer,/a\.skip:not\(:focus-visible\)/);
|
||||
assert.match(read('scripts/mybb-presentation.css'),/\.wrapper>\.navigation\+br\{display:none!important/);
|
||||
});
|
||||
|
|
|
|||
BIN
website/web/assets/support-avatar-default.png
Normal file
BIN
website/web/assets/support-avatar-default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -39,12 +39,6 @@
|
|||
/* Shop SALES indicator v1: inactive until a real promotion is active */
|
||||
(()=>{let active=new URLSearchParams(location.search).get('sale-preview')==='1';if(active)document.body.classList.add('dune-sale-preview');const draw=()=>{for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a[href="https://shop.dunerealms.com/"]')){let badge=a.querySelector('.dune-sales-overlay');if(active&&!badge){badge=document.createElement('span');badge.className='dune-sales-overlay';badge.textContent='SALE';badge.setAttribute('aria-label','Shop sale active');a.append(badge);}else if(!active&&badge)badge.remove();a.classList.toggle('dune-shop-sale-active',active);}};window.addEventListener('dune:shop-promotions',e=>{active=e.detail?.active===true;draw();});draw();new MutationObserver(draw).observe(document.body,{childList:true,subtree:true});})();
|
||||
|
||||
/* Sir Patrick Stewart footer memorial */
|
||||
(()=>{const place=()=>{const header=document.querySelector('header.dune-site-header')||document.querySelector('body>header');const footer=document.querySelector('footer.dune-shared-footer')||document.querySelector('footer');if(!footer)return;const existing=document.querySelector('.dune-memorial');if(existing){if(existing.parentElement!==footer)footer.append(existing);return;}const tribute=document.createElement('aside');tribute.className='dune-memorial';tribute.setAttribute('aria-label','In memory of Sir Patrick Stewart');tribute.title='In memory of Sir Patrick Stewart';const portrait=document.createElement('img');portrait.src='https://www.dunerealms.com/assets/sir-patrick-stewart-memorial-v1.webp';portrait.alt='Sir Patrick Stewart, remembered within a heraldic shield with a black mourning ribbon';portrait.width=96;portrait.height=96;const text=document.createElement('span');text.textContent='In memory of';const name=document.createElement('strong');name.textContent='Sir Patrick Stewart';tribute.append(portrait,text,name);footer.append(tribute);};place();new MutationObserver(place).observe(document.body,{childList:true,subtree:true});})();
|
||||
|
||||
/* Memorial dedication box and candle */
|
||||
(()=>{function enhance(){const box=document.querySelector('.dune-memorial');if(!box||box.querySelector('.dune-memorial-dedication'))return;const dedication=document.createElement('div');dedication.className='dune-memorial-dedication';const role=document.createElement('p');role.textContent='Gurney Halleck · Dune (1984)';const quote=document.createElement('blockquote');quote.textContent='“May thy knife chip and shatter.”';const credit=document.createElement('small');credit.textContent='— Dune';dedication.append(role,quote,credit);const candle=document.createElement('span');candle.className='dune-memorial-candle';candle.setAttribute('role','img');candle.setAttribute('aria-label','A burning candle in remembrance');const flame=document.createElement('i');flame.className='dune-memorial-flame';candle.append(flame);box.append(dedication,candle);}enhance();new MutationObserver(enhance).observe(document.body,{childList:true,subtree:true});})();
|
||||
|
||||
/* DuneGit repository footer link */
|
||||
(()=>{function link(){const foot=document.querySelector('.dune-shared-footer');if(!foot)return;const nav=foot.querySelector('nav');if(!nav)return;let a=nav.querySelector('[data-dune-git-footer]');if(!a){a=document.createElement('a');a.dataset.duneGitFooter='1';nav.append(a);}a.href='https://www.dunerealms.com/git/unimatrix/MC';a.textContent='DuneGit';}link();new MutationObserver(link).observe(document.body,{childList:true});addEventListener('hashchange',link);})();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
if(accountMenu&&bar){bar.querySelector('.dr-nav-account')?.remove();accountMenu.classList.add('dr-account-menu');}
|
||||
if(bar&&!bar.querySelector('[data-staff-access]')){const staff=document.createElement('a');staff.className='dr-nav-account dr-staff-link';staff.dataset.staffAccess='';staff.hidden=true;staff.href='https://cp.dunerealms.com/#bureau/user-management';const icon=document.createElement('img');icon.src=root+'/assets/nav-staff-v2.webp';icon.alt='';staff.append(icon,document.createTextNode('Staff'));bar.insertBefore(staff,bar.querySelector(':scope>.dr-nav-account')||play);if(!embedded)fetch('https://cp.dunerealms.com/api/welcome',{credentials:'include',cache:'no-store',signal:AbortSignal.timeout(6000)}).then(r=>r.ok?r.json():null).then(context=>{staff.hidden=context?.staffAccess!==true;}).catch(()=>{});}
|
||||
}
|
||||
const memorial=header?.querySelector('.dune-memorial'),footer=document.querySelector('body>footer,.dune-shared-footer');if(memorial&&footer)footer.append(memorial);
|
||||
header?.querySelector('.dune-memorial')?.remove();
|
||||
// The host page owns one banner; embedded services keep their content width.
|
||||
if(!embedded&&!workspace&&!document.querySelector('.arrival-grid,.dune-support-workspace-hero')&&!document.querySelector('.dr-page-banner,.section-banner')&&header){
|
||||
const main=document.querySelector('main,#content,#main-content,.main-content,#container>#content');
|
||||
|
|
@ -39,6 +39,17 @@
|
|||
}
|
||||
if(nativeHost==='wiki'&&!embedded){const main=document.querySelector('.mw-body,#content,.main-content');if(main&&!document.querySelector('.dr-wiki-placeholder')){const notice=document.createElement('section');notice.className='dr-wiki-placeholder';const heading=document.createElement('h2');heading.textContent='The Dunopedia is being updated';const copy=document.createElement('p');copy.textContent='The existing wiki is an archive and may describe outdated features. Updated guides will be published here.';const link=document.createElement('a');link.href=root+'/manual.html';link.textContent='Open the player field manual →';notice.append(heading,copy,link);main.prepend(notice);}}
|
||||
function polishContent(){
|
||||
if(nativeHost==='support')for(const image of document.querySelectorAll('img.avatar[src]')){try{const u=new URL(image.src,location.href),fallback=u.searchParams.get('d')||u.searchParams.get('default');if((u.hostname==='gravatar.com'||u.hostname.endsWith('.gravatar.com'))&&u.pathname.startsWith('/avatar/')&&['mm','mp'].includes(fallback)&&!u.searchParams.has('f')&&!u.searchParams.has('forcedefault')){u.searchParams.delete('default');u.searchParams.set('d',root+'/assets/support-avatar-default.png');image.src=u.href;}}catch{}}
|
||||
// The common footer owns one visual instance; embedded workspaces leave it to their outer page.
|
||||
const footers=[...document.querySelectorAll('footer.dune-shared-footer')];
|
||||
if(embedded){for(const footer of footers)footer.hidden=true;}
|
||||
else if(footers.length){
|
||||
const keeper=footers.find(f=>f.parentElement===document.body)||footers[0];
|
||||
for(const footer of footers)for(const tribute of footer.querySelectorAll('.dune-memorial'))tribute.remove();
|
||||
for(const duplicate of footers){if(duplicate===keeper)continue;for(const notice of duplicate.querySelectorAll('.legal-notice'))keeper.after(notice);duplicate.remove();}
|
||||
const links=new Map();for(const a of keeper.querySelectorAll('nav a')){const previous=links.get(a.href);if(previous){for(const key of ['data-dune-git-footer','data-dune-api-footer','data-bank-rates'])if(a.hasAttribute(key))previous.setAttribute(key,a.getAttribute(key));a.remove();}else{links.set(a.href,a);if(a.href===root+'/api.html')a.setAttribute('data-dune-api-footer','1');if(a.href===root+'/rates-and-charges.html')a.setAttribute('data-bank-rates','1');}}
|
||||
}
|
||||
|
||||
if(nativeHost==='boards'){const nav=document.querySelector('#content>.navigation');if(nav&&document.querySelector('.dune-board-category')&&nav.textContent.trim()==='DuneRealms Forums'&&nav.querySelectorAll('a').length<=1)nav.hidden=true;for(const status of document.querySelectorAll('.forum_status[title],.subforumicon[title]')){const label=status.title;if(status.getAttribute('aria-label')!==label)status.setAttribute('aria-label',label);if(!status.classList.contains('ajax_mark_read'))status.setAttribute('role','img');}}
|
||||
const account=header?.querySelector('nav [data-dune-nav-group="My Account"]');if(account){account.classList.add('dr-account-menu');header.querySelector('.dr-header-bar>.dr-nav-account:not(.dr-staff-link)')?.remove();}
|
||||
if(document.querySelector('.dr-page-banner'))for(const h of document.querySelectorAll('main h1'))if(!h.classList.contains('dr-content-title')){h.classList.add('dr-content-title');h.setAttribute('role','heading');h.setAttribute('aria-level','2');}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff