Skip to content

Commit

Permalink
Add profile input.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Sep 25, 2018
1 parent 24ef8a4 commit 40fba52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ <h1>Profile viewer</h1>
You are logged in as <span id="user"></span>.
<button>Log out</button>
</p>
<p>
<label for="profile">Profile:</label>
<input id="profile">
<button id="view">View</button>
</p>
<script src="scripts/jquery.js"></script>
<script src="scripts/solid-auth-client.bundle.js"></script>
<script src="scripts/main.js"></script>
Expand Down
7 changes: 6 additions & 1 deletion scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ solid.auth.trackSession(session => {
const loggedIn = !!session;
$('#login').toggle(!loggedIn);
$('#logout').toggle(loggedIn);
$('#user').text(session && session.webId);
if (loggedIn) {
$('#user').text(session.webId);
// Use the user's WebID as default profile
if (!$('#profile').val())
$('#profile').val(session.webId);
}
});
10 changes: 9 additions & 1 deletion styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ body {
margin: 0 auto;
}

body, input {
body, input, button {
font: 11pt/1.3 "Helvetiva Neue", Helvetica, Arial, sans-serif;
}

button, label {
font-weight: bold;
}

#profile {
width: 400px;
}

0 comments on commit 40fba52

Please sign in to comment.