Skip to content

Commit deeb322

Browse files
committed
show friends list if logged in or not
1 parent 5fa2f9d commit deeb322

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

src/socialPane.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,14 @@ export const socialPane = {
192192
img.className = foafPicStyle
193193
tools.appendChild(img)
194194
}
195-
const name = kb.anyValue(s, foaf('name')) || '???'
195+
const name = kb.anyValue(s, vcard('fn')) || '???'
196196
let h3 = dom.createElement('H3')
197-
h3.appendChild(dom.createTextNode(name))
197+
h3.appendChild(dom.createTextNode(name + '\'s Friends'))
198+
tools.appendChild(h3)
198199

199-
let me = authn.currentUser()
200+
const me = authn.currentUser()
200201
const meUri = me ? me.uri : null
201202

202-
// @@ Add: event handler to redraw the stuff below when me changes.
203-
const loginOutButton = UI.login.loginStatusBox(dom, webIdUri => {
204-
me = kb.sym(webIdUri)
205-
// @@ To be written: redraw as a function the new me
206-
// @@ refresh the sidebars
207-
UI.widgets.refreshTree(div) // this refreshes the middle at least
208-
})
209-
210-
tips.appendChild(loginOutButton)
211-
212203
const thisIsYou = me && kb.sameThings(me, s)
213204

214205
const knows = foaf('knows')
@@ -226,8 +217,9 @@ export const socialPane = {
226217
let editable = false
227218
let incoming
228219
let outgoing
220+
229221
if (me) {
230-
// The definition of FAF personal profile document is ..
222+
// The definition of FOAF personal profile document is ..
231223
const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic
232224
let message = ''
233225
for (let i = 0; i < works.length; i++) {
@@ -238,28 +230,30 @@ export const socialPane = {
238230
foaf('PersonalProfileDocument')
239231
)
240232
) {
241-
editable = outliner.UserInput.sparqler.editable(works[i].uri, kb)
233+
const doc = works[i]
234+
editable = outliner.UserInput.sparqler.editable(doc.uri, kb)
242235
if (!editable) {
243236
message +=
244237
'Your profile <' +
245-
UI.utils.escapeForXML(works[i].uri) +
238+
UI.utils.escapeForXML(doc.uri) +
246239
'> is not remotely editable.'
247240
} else {
248-
profile = works[i]
241+
profile = doc
249242
break
250243
}
251244
}
252245
}
253246

247+
/*
254248
if (!profile) {
255249
say(
256250
message + '\nI couldn\'t find your editable personal profile document.'
257251
)
258252
} else {
259253
say('Editing your profile ' + profile + '.')
260-
// Do I have an EDITABLE profile?
261254
editable = outliner.UserInput.sparqler.editable(profile.uri, kb)
262255
}
256+
*/
263257

264258
if (thisIsYou) {
265259
// This is about me
@@ -445,10 +439,11 @@ export const socialPane = {
445439
} */
446440
// //////////////////////////////////// Basic info on left
447441

442+
/*
448443
h3 = dom.createElement('h3')
449444
h3.appendChild(dom.createTextNode('Basic Information'))
450445
tools.appendChild(h3)
451-
446+
*/
452447
// For each home page like thing make a label which will
453448
// make sense and add the domain (like "w3.org blog") if there are more than one of the same type
454449
//

0 commit comments

Comments
 (0)