Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/styles/mash.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ body {
color: inherit;
}

solid-panes-header {
solid-panes-header, #PageHeader {
position: fixed;
top: 0;
left: 0;
Expand Down Expand Up @@ -1642,6 +1642,7 @@ label:focus-visible {
/* Generated by AI */
@media screen and (max-width: 768px) {
solid-panes-header,
#PageHeader,
#PageFooter {
width: 100%;
}
Expand Down
130 changes: 34 additions & 96 deletions static/browse-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<script type="text/javascript" src="mashlib.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const authn = SolidLogic.authn
const authSession = SolidLogic.authSession
const store = SolidLogic.store
const dom = document
// Disable cross-site proxy - modern Solid servers support CORS
// $rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}'
Expand All @@ -37,14 +34,10 @@

var subject = $rdf.sym(uri);
outliner.GotoSubject(subject, true, undefined, true, undefined);
mungeLoginArea();
}

const uriField = dom.getElementById('uriField')
const goButton = dom.getElementById('goButton')
const loginButtonArea = document.getElementById("loginButtonArea");
const webIdArea = dom.getElementById('webId')
const banner = dom.getElementById('PageHeader')
const pageHeader = dom.getElementById('PageHeader')

function updateHeaderOffset () {
Expand All @@ -55,7 +48,7 @@

window.addEventListener('resize', updateHeaderOffset)
updateHeaderOffset()

uriField.addEventListener('keyup', function (e) {
if (e.keyCode === 13) {
go(e)
Expand All @@ -68,82 +61,52 @@
uriField.value = initial
go()
}
async function mungeLoginArea(){
loginButtonArea.innerHTML="";
if(uriField.value) {
loginButtonArea.appendChild(UI.login.loginStatusBox(document, null, {}))
}
const me = authn.currentUser()
if (me) {
const logoutButton = loginButtonArea.querySelector('input');
logoutButton.value = "Logout";
let displayId = `&lt;${me.value}>`;
webIdArea.innerHTML = displayId;
banner.style.backgroundColor="#bbccbb";
} else {
banner.style.backgroundColor="#ccbbbb";
}
loginButtonArea.style.display="inline-block";
updateHeaderOffset()
}

if (authSession) {
authSession.events.on("login", () => {
mungeLoginArea();
go()
})
authSession.events.on("logout", () => {
mungeLoginArea();
webIdArea.innerHTML = "public user";
go()
})
authSession.events.on("sessionRestore", (url) => {
mungeLoginArea();
go()
})
}
mungeLoginArea();
});
</script>
</head>
<body>
<header id="PageHeader" role="banner" class="header-mash">
SolidOS Databrowser
<div class="input-row" id="inputArea">
Viewing <input id="uriField" type="text" class="uri-field" placeholder="enter a pod address e.g. https://you.solidcommunity.net/"/> <input type="button" id="goButton" value="Go" />
<solid-ui-provider>
<header id="PageHeader" role="banner" class="header-mash">
SolidOS Databrowser
<div class="input-row" id="inputArea">
Viewing <input id="uriField" type="text" class="uri-field" placeholder="enter a pod address e.g. https://you.solidcommunity.net/"/> <input type="button" id="goButton" value="Go" />
</div>
</header>
<div class="user-row">
<solid-ui-account></solid-ui-account>
</div>
</header>
<div class="user-row">
As user <span id="webId">&lt;public user></span>
<span id="loginButtonArea"></span>
</div>
<main id="MainContent" tabindex="-1" aria-live="polite" class="browser-main">
<main id="MainContent" tabindex="-1" aria-live="polite" class="browser-main">
<table
id="OutlineView"
class="outline-view"
aria-label="Resource browser"
style="width: 100%"
>
</table>

<table
id="OutlineView"
class="outline-view"
aria-label="Resource browser"
style="width: 100%"
>
</table>
<section
id="GlobalDashboard"
class="global-dashboard"
aria-label="Dashboard"
hidden
>
</section>

<section
id="GlobalDashboard"
class="global-dashboard"
aria-label="Dashboard"
hidden
>
</section>
</main>

</main>
<footer id="PageFooter" role="contentinfo"></footer>
</solid-ui-provider>

<footer id="PageFooter" role="contentinfo"></footer>
<style>
body {
padding-top: calc(var(--browse-header-offset, var(--app-header-height, 3.8rem)) + 0.35rem);
}
.outline-view {
width: 100%;
}
.header-mash {
padding:1em !important;
}
.input-row {
}
.browser-main {
margin-top: 0 !important;
}
Expand All @@ -153,38 +116,13 @@
padding-bottom: 0.5em;
margin-left:1em;
}
#loginButtonArea input {
display:inline-block;
margin:0.25em !important;
padding:0.25em !important;
}
#webId {
display:inline-block;
padding-top:0.6em;
padding-bottom:0.6em;
}
#uriField, .uri-field {
font-size:100%;
min-width:25em;
padding:0.5em;
width:70%;
margin-top:0.6em !important;
}

/* Local fix: make full-screen idp popup overlay appear above all fixed page elements */
div[style*="position: fixed"][style*="justify-content: center"][style*="align-items: center"],
div[style*="min-width: 400px"][style*="box-shadow"],
div[style*="z-index : 10"],
div[style*="z-index: 10"] {
z-index: 2147483647 !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
justify-content: center !important;
align-items: center !important;
}

</style>

</body>
Expand Down
78 changes: 5 additions & 73 deletions static/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<script type="text/javascript" src="mashlib.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const authn = SolidLogic.authn
const authSession = SolidLogic.authSession
const store = SolidLogic.store
const dom = document
// Disable cross-site proxy - modern Solid servers support CORS
// $rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}'
Expand All @@ -37,15 +34,11 @@

var subject = $rdf.sym(uri);
outliner.GotoSubject(subject, true, undefined, true, undefined);
mungeLoginArea();
}

const uriField = dom.getElementById('uriField')
const goButton = dom.getElementById('goButton')
const loginButtonArea = document.getElementById("loginButtonArea");
const webIdArea = dom.getElementById('webId')
const banner = dom.getElementById('PageHeader')
const pageHeader = dom.querySelector('solid-panes-header')
const pageHeader = dom.getElementById('PageHeader')

function updateHeaderOffset () {
if (!pageHeader) return
Expand All @@ -68,41 +61,6 @@
uriField.value = initial
go()
}
async function mungeLoginArea(){
loginButtonArea.innerHTML="";
if(uriField.value) {
loginButtonArea.appendChild(UI.login.loginStatusBox(document, null, {}))
}
const me = authn.currentUser()
if (me) {
const logoutButton = loginButtonArea.querySelector('input');
logoutButton.value = "Logout";
let displayId = `&lt;${me.value}>`;
webIdArea.innerHTML = displayId;
banner.style.backgroundColor="#bbccbb";
} else {
banner.style.backgroundColor="#ccbbbb";
}
loginButtonArea.style.display="inline-block";
updateHeaderOffset()
}

if (authSession) {
authSession.events.on("login", () => {
mungeLoginArea();
go()
})
authSession.events.on("logout", () => {
mungeLoginArea();
webIdArea.innerHTML = "public user";
go()
})
authSession.events.on("sessionRestore", (url) => {
mungeLoginArea();
go()
})
}
mungeLoginArea();
});
</script>
</head>
Expand All @@ -115,11 +73,9 @@
</div>
</header>
<div class="user-row">
As user <span id="webId">&lt;public user></span>
<span id="loginButtonArea"></span>
<solid-ui-account></solid-ui-account>
</div>
<main id="MainContent" tabindex="-1" aria-live="polite" class="browser-main">

<table
id="OutlineView"
class="outline-view"
Expand All @@ -142,14 +98,15 @@
</solid-ui-provider>

<style>
body {
padding-top: calc(var(--browse-header-offset, var(--app-header-height, 3.8rem)) + 0.35rem);
}
.outline-view {
width: 100%;
}
.header-mash {
padding:1em !important;
}
.input-row {
}
.browser-main {
margin-top: 0 !important;
}
Expand All @@ -159,38 +116,13 @@
padding-bottom: 0.5em;
margin-left:1em;
}
#loginButtonArea input {
display:inline-block;
margin:0.25em !important;
padding:0.25em !important;
}
#webId {
display:inline-block;
padding-top:0.6em;
padding-bottom:0.6em;
}
#uriField, .uri-field {
font-size:100%;
min-width:25em;
padding:0.5em;
width:70%;
margin-top:0.6em !important;
}

/* Local fix: make full-screen idp popup overlay appear above all fixed page elements */
div[style*="position: fixed"][style*="justify-content: center"][style*="align-items: center"],
div[style*="min-width: 400px"][style*="box-shadow"],
div[style*="z-index : 10"],
div[style*="z-index: 10"] {
z-index: 2147483647 !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
justify-content: center !important;
align-items: center !important;
}

</style>

</body>
Expand Down
Loading