|
18 | 18 | <script type="text/javascript" src="mashlib.js"></script> |
19 | 19 | <script> |
20 | 20 | document.addEventListener('DOMContentLoaded', function() { |
21 | | - const authn = SolidLogic.authn |
22 | | - const authSession = SolidLogic.authSession |
23 | | - const store = SolidLogic.store |
24 | 21 | const dom = document |
25 | 22 | // Disable cross-site proxy - modern Solid servers support CORS |
26 | 23 | // $rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}' |
|
37 | 34 |
|
38 | 35 | var subject = $rdf.sym(uri); |
39 | 36 | outliner.GotoSubject(subject, true, undefined, true, undefined); |
40 | | - mungeLoginArea(); |
41 | 37 | } |
42 | 38 |
|
43 | 39 | const uriField = dom.getElementById('uriField') |
44 | 40 | const goButton = dom.getElementById('goButton') |
45 | | - const loginButtonArea = document.getElementById("loginButtonArea"); |
46 | | - const webIdArea = dom.getElementById('webId') |
47 | | - const banner = dom.getElementById('inputArea') |
48 | 41 | const pageHeader = dom.getElementById('PageHeader') |
49 | 42 |
|
50 | 43 | function updateHeaderOffset () { |
|
55 | 48 |
|
56 | 49 | window.addEventListener('resize', updateHeaderOffset) |
57 | 50 | updateHeaderOffset() |
58 | | - |
| 51 | + |
59 | 52 | uriField.addEventListener('keyup', function (e) { |
60 | 53 | if (e.keyCode === 13) { |
61 | 54 | go(e) |
|
68 | 61 | uriField.value = initial |
69 | 62 | go() |
70 | 63 | } |
71 | | - async function mungeLoginArea(){ |
72 | | - loginButtonArea.innerHTML=""; |
73 | | - if(uriField.value) { |
74 | | - loginButtonArea.appendChild(UI.login.loginStatusBox(document, null, {})) |
75 | | - } |
76 | | - const me = authn.currentUser() |
77 | | - if (me) { |
78 | | - const logoutButton = loginButtonArea.querySelector('input'); |
79 | | - logoutButton.value = "Logout"; |
80 | | - let displayId = `<${me.value}>`; |
81 | | - webIdArea.innerHTML = displayId; |
82 | | - banner.style.backgroundColor="#bbccbb"; |
83 | | - } else { |
84 | | - banner.style.backgroundColor="#ccbbbb"; |
85 | | - } |
86 | | - loginButtonArea.style.display="inline-block"; |
87 | | - updateHeaderOffset() |
88 | | - } |
89 | | - |
90 | | - if (authSession) { |
91 | | - authSession.events.on("login", () => { |
92 | | - mungeLoginArea(); |
93 | | - go() |
94 | | - }) |
95 | | - authSession.events.on("logout", () => { |
96 | | - mungeLoginArea(); |
97 | | - webIdArea.innerHTML = "public user"; |
98 | | - go() |
99 | | - }) |
100 | | - authSession.events.on("sessionRestore", (url) => { |
101 | | - mungeLoginArea(); |
102 | | - go() |
103 | | - }) |
104 | | - } |
105 | | - mungeLoginArea(); |
106 | 64 | }); |
107 | 65 | </script> |
108 | 66 | </head> |
109 | 67 | <body> |
110 | | - <header id="PageHeader" role="banner" class="header-mash"> |
111 | | - SolidOS Databrowser |
112 | | - <div class="input-row" id="inputArea"> |
113 | | - 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" /> |
| 68 | + <solid-ui-provider> |
| 69 | + <header id="PageHeader" role="banner" class="header-mash"> |
| 70 | + SolidOS Databrowser |
| 71 | + <div class="input-row" id="inputArea"> |
| 72 | + 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" /> |
| 73 | + </div> |
| 74 | + </header> |
| 75 | + <div class="user-row"> |
| 76 | + <solid-ui-account></solid-ui-account> |
114 | 77 | </div> |
115 | | - </header> |
116 | | - <div class="user-row"> |
117 | | - As user <span id="webId"><public user></span> |
118 | | - <span id="loginButtonArea"></span> |
119 | | - </div> |
120 | | - <main id="MainContent" tabindex="-1" aria-live="polite" class="browser-main"> |
| 78 | + <main id="MainContent" tabindex="-1" aria-live="polite" class="browser-main"> |
| 79 | + <table |
| 80 | + id="OutlineView" |
| 81 | + class="outline-view" |
| 82 | + aria-label="Resource browser" |
| 83 | + style="width: 100%" |
| 84 | + > |
| 85 | + </table> |
121 | 86 |
|
122 | | - <table |
123 | | - id="OutlineView" |
124 | | - class="outline-view" |
125 | | - aria-label="Resource browser" |
126 | | - style="width: 100%" |
127 | | - > |
128 | | - </table> |
| 87 | + <section |
| 88 | + id="GlobalDashboard" |
| 89 | + class="global-dashboard" |
| 90 | + aria-label="Dashboard" |
| 91 | + hidden |
| 92 | + > |
| 93 | + </section> |
129 | 94 |
|
130 | | - <section |
131 | | - id="GlobalDashboard" |
132 | | - class="global-dashboard" |
133 | | - aria-label="Dashboard" |
134 | | - hidden |
135 | | - > |
136 | | - </section> |
| 95 | + </main> |
137 | 96 |
|
138 | | - </main> |
| 97 | + <footer id="PageFooter" role="contentinfo"></footer> |
| 98 | + </solid-ui-provider> |
139 | 99 |
|
140 | | - <footer id="PageFooter" role="contentinfo"></footer> |
141 | 100 | <style> |
142 | 101 | body { |
143 | 102 | padding-top: calc(var(--browse-header-offset, var(--app-header-height, 3.8rem)) + 0.35rem); |
144 | 103 | } |
| 104 | + .outline-view { |
| 105 | + width: 100%; |
| 106 | + } |
145 | 107 | .header-mash { |
146 | 108 | padding:1em !important; |
147 | 109 | background-color:#ccbbbb !important; |
148 | 110 | } |
149 | | - .input-row { |
150 | | - } |
151 | 111 | .browser-main { |
152 | 112 | margin-top: 0 !important; |
153 | 113 | } |
|
157 | 117 | padding-bottom: 0.5em; |
158 | 118 | margin-left:1em; |
159 | 119 | } |
160 | | - #loginButtonArea input { |
161 | | - display:inline-block; |
162 | | - margin:0.25em !important; |
163 | | - padding:0.25em !important; |
164 | | - } |
165 | | - #webId { |
166 | | - display:inline-block; |
167 | | - padding-top:0.6em; |
168 | | - padding-bottom:0.6em; |
169 | | - } |
170 | 120 | #uriField, .uri-field { |
171 | 121 | font-size:100%; |
172 | 122 | min-width:25em; |
173 | 123 | padding:0.5em; |
174 | 124 | width:70%; |
175 | 125 | margin-top:0.6em !important; |
176 | 126 | } |
177 | | - |
178 | | - /* Local fix: make full-screen idp popup overlay appear above all fixed page elements */ |
179 | | - div[style*="position: fixed"][style*="justify-content: center"][style*="align-items: center"], |
180 | | - div[style*="min-width: 400px"][style*="box-shadow"], |
181 | | - div[style*="z-index : 10"], |
182 | | - div[style*="z-index: 10"] { |
183 | | - z-index: 2147483647 !important; |
184 | | - top: 0 !important; |
185 | | - left: 0 !important; |
186 | | - right: 0 !important; |
187 | | - bottom: 0 !important; |
188 | | - justify-content: center !important; |
189 | | - align-items: center !important; |
190 | | - } |
191 | | - |
192 | 127 | </style> |
193 | 128 |
|
194 | 129 | </body> |
|
0 commit comments