solid-panes 4.2.6 → 4.4.1-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +45 -1
  2. package/dist/0314353e28ce6e5539af.svg +9 -0
  3. package/dist/04567ff683933c35c465.png +0 -0
  4. package/dist/10163fd9b5a0e00d63a0.png +0 -0
  5. package/dist/1234dcb2eec2e45f252b.png +0 -0
  6. package/dist/20899934157df4db56cb.png +0 -0
  7. package/dist/33760bf79f097f449da5.png +0 -0
  8. package/dist/4cceba29ab33b1ddd9bb.svg +6 -0
  9. package/dist/578d2b6ed32e7624164e.png +0 -0
  10. package/dist/5f62a5b2b7e99b9640c7.png +0 -0
  11. package/dist/6525766ecd288ec60129.png +0 -0
  12. package/dist/7800be6f6c4b5b0f4f20.png +0 -0
  13. package/dist/7b7538c6f6b317968009.svg +9 -0
  14. package/dist/92d03142abe6efc0b42d.svg +6 -0
  15. package/dist/976473cf5fe24d657d4b.png +0 -0
  16. package/dist/RDFXMLPane.css +70 -0
  17. package/dist/RDFXMLPane.d.ts +13 -0
  18. package/dist/RDFXMLPane.d.ts.map +1 -0
  19. package/dist/RDFXMLPane.js +46 -4
  20. package/dist/bda84f59e7216675a208.png +0 -0
  21. package/dist/cd68e8f3990ba8b2139e.png +0 -0
  22. package/dist/dashboard/basicPreferences.d.ts.map +1 -1
  23. package/dist/dashboard/basicPreferences.js +1 -0
  24. package/dist/dashboard/dashboardPane.d.ts.map +1 -1
  25. package/dist/dashboard/dashboardPane.js +9 -3
  26. package/dist/dashboard/homepage.d.ts +1 -1
  27. package/dist/dashboard/homepage.d.ts.map +1 -1
  28. package/dist/dashboard/homepage.js +5 -35
  29. package/dist/dataContentPane.css +271 -0
  30. package/dist/dataContentPane.d.ts +14 -0
  31. package/dist/dataContentPane.d.ts.map +1 -0
  32. package/dist/dataContentPane.js +68 -101
  33. package/dist/defaultPane.css +97 -0
  34. package/dist/defaultPane.d.ts +14 -0
  35. package/dist/defaultPane.d.ts.map +1 -0
  36. package/dist/defaultPane.js +9 -2
  37. package/dist/e7074a7e2cb69e51cfd3.png +0 -0
  38. package/dist/f3772696fb7ee53c23d8.png +0 -0
  39. package/dist/form/formPane.css +120 -0
  40. package/dist/form/pane.d.ts +4 -0
  41. package/dist/form/pane.d.ts.map +1 -0
  42. package/dist/form/pane.js +120 -54
  43. package/dist/home/homePane.d.ts.map +1 -1
  44. package/dist/home/homePane.js +2 -0
  45. package/dist/humanReadablePane.css +129 -0
  46. package/dist/humanReadablePane.d.ts +13 -0
  47. package/dist/humanReadablePane.d.ts.map +1 -0
  48. package/dist/humanReadablePane.js +53 -16
  49. package/dist/icons/clock.svg +7 -0
  50. package/dist/icons/comment.svg +6 -0
  51. package/dist/icons/dashboard.svg +9 -0
  52. package/dist/icons/downArrow.svg +6 -0
  53. package/dist/icons/folder.svg +6 -0
  54. package/dist/icons/friends.svg +9 -0
  55. package/dist/icons/help.svg +8 -0
  56. package/dist/icons/iconHelper.d.ts +2 -0
  57. package/dist/icons/iconHelper.d.ts.map +1 -0
  58. package/dist/icons/iconHelper.js +23 -0
  59. package/dist/icons/menu.svg +8 -0
  60. package/dist/icons/person.svg +6 -0
  61. package/dist/icons/personInCircle.svg +8 -0
  62. package/dist/icons/sharing.svg +10 -0
  63. package/dist/icons/signOut.svg +8 -0
  64. package/dist/icons/signUp.svg +9 -0
  65. package/dist/icons/star.svg +3 -0
  66. package/dist/imagePane.css +4 -0
  67. package/dist/imagePane.d.ts +12 -0
  68. package/dist/imagePane.d.ts.map +1 -0
  69. package/dist/imagePane.js +19 -21
  70. package/dist/index.d.ts +5 -4
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +19 -4
  73. package/dist/internal/internalPane.css +14 -0
  74. package/dist/internal/internalPane.d.ts +1 -0
  75. package/dist/internal/internalPane.d.ts.map +1 -1
  76. package/dist/internal/internalPane.js +6 -6
  77. package/dist/mainPage/footer.d.ts +14 -2
  78. package/dist/mainPage/footer.d.ts.map +1 -1
  79. package/dist/mainPage/footer.js +21 -13
  80. package/dist/mainPage/header.d.ts +16 -1
  81. package/dist/mainPage/header.d.ts.map +1 -1
  82. package/dist/mainPage/header.js +179 -61
  83. package/dist/mainPage/index.d.ts +16 -1
  84. package/dist/mainPage/index.d.ts.map +1 -1
  85. package/dist/mainPage/index.js +61 -7
  86. package/dist/mainPage/menu.css +243 -0
  87. package/dist/mainPage/menu.d.ts +7 -0
  88. package/dist/mainPage/menu.d.ts.map +1 -0
  89. package/dist/mainPage/menu.js +436 -0
  90. package/dist/n3Pane.css +49 -0
  91. package/dist/n3Pane.d.ts +13 -0
  92. package/dist/n3Pane.d.ts.map +1 -0
  93. package/dist/n3Pane.js +36 -4
  94. package/dist/outline/context.d.ts +2 -2
  95. package/dist/outline/context.d.ts.map +1 -1
  96. package/dist/outline/context.js +5 -2
  97. package/dist/outline/manager.css +12 -14
  98. package/dist/outline/manager.js +172 -82
  99. package/dist/outline/userInput.js +6 -3
  100. package/dist/pad/padPane.css +40 -0
  101. package/dist/pad/padPane.d.ts +1 -0
  102. package/dist/pad/padPane.d.ts.map +1 -1
  103. package/dist/pad/padPane.js +33 -22
  104. package/dist/playlist/playlistPane.js +2 -6
  105. package/dist/profileUtils/ownerProfile.d.ts +5 -0
  106. package/dist/profileUtils/ownerProfile.d.ts.map +1 -0
  107. package/dist/profileUtils/ownerProfile.js +84 -0
  108. package/dist/registerPanes.js +12 -12
  109. package/dist/schedule/schedulePane.css +294 -0
  110. package/dist/schedule/schedulePane.d.ts +23 -0
  111. package/dist/schedule/schedulePane.d.ts.map +1 -0
  112. package/dist/schedule/schedulePane.js +161 -61
  113. package/dist/slideshow/slideshowPane.js +1 -1
  114. package/dist/social/editProfileDetails.d.ts +19 -0
  115. package/dist/social/editProfileDetails.d.ts.map +1 -0
  116. package/dist/social/editProfileDetails.js +362 -0
  117. package/dist/social/icons.d.ts +7 -0
  118. package/dist/social/icons.d.ts.map +1 -0
  119. package/dist/social/icons.js +95 -0
  120. package/dist/social/socialPane.css +1464 -0
  121. package/dist/social/socialPane.d.ts +30 -0
  122. package/dist/social/socialPane.d.ts.map +1 -0
  123. package/dist/social/socialPane.js +651 -0
  124. package/dist/social/socialSections.d.ts +77 -0
  125. package/dist/social/socialSections.d.ts.map +1 -0
  126. package/dist/social/socialSections.js +393 -0
  127. package/dist/social/spinner.d.ts +3 -0
  128. package/dist/social/spinner.d.ts.map +1 -0
  129. package/dist/social/spinner.js +13 -0
  130. package/dist/social/triage.d.ts +17 -0
  131. package/dist/social/triage.d.ts.map +1 -0
  132. package/dist/social/triage.js +79 -0
  133. package/dist/solid-panes.js +49544 -18164
  134. package/dist/solid-panes.js.map +1 -1
  135. package/dist/solid-panes.min.js +3884 -240
  136. package/dist/solid-panes.min.js.map +1 -1
  137. package/dist/{style → styles}/tabbedtab.css +0 -281
  138. package/dist/styles/utilities.css +5 -0
  139. package/dist/tabbed/tabbedPane.d.ts.map +1 -1
  140. package/dist/tabbed/tabbedPane.js +2 -0
  141. package/dist/versionInfo.js +14 -14
  142. package/package.json +37 -31
  143. package/dist/socialPane.js +0 -430
@@ -1,430 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.socialPane = void 0;
7
- var UI = _interopRequireWildcard(require("solid-ui"));
8
- var _solidLogic = require("solid-logic");
9
- var $rdf = _interopRequireWildcard(require("rdflib"));
10
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
- /* Social Pane
12
- **
13
- ** This outline pane provides social network functions
14
- ** Using for example the FOAF ontology.
15
- ** Goal: A *distributed* version of facebook, advogato, etc etc
16
- ** - Similarly easy user interface, but data storage distributed
17
- ** - Read and write both user-private (address book) and public data clearly
18
- ** -- todo: use common code to get username and load profile and set 'me'
19
- */
20
-
21
- const socialPane = exports.socialPane = {
22
- icon: UI.icons.originalIconBase + 'foaf/foafTiny.gif',
23
- name: 'social',
24
- label: function (subject, context) {
25
- const kb = context.session.store;
26
- const types = kb.findTypeURIs(subject);
27
- if (types[UI.ns.foaf('Person').uri] || types[UI.ns.vcard('Individual').uri]) {
28
- return 'Friends';
29
- }
30
- return null;
31
- },
32
- render: function (s, context) {
33
- const dom = context.dom;
34
- const common = function (x, y) {
35
- // Find common members of two lists
36
- const both = [];
37
- for (let i = 0; i < x.length; i++) {
38
- for (let j = 0; j < y.length; j++) {
39
- if (y[j].sameTerm(x[i])) {
40
- both.push(y[j]);
41
- break;
42
- }
43
- }
44
- }
45
- return both;
46
- };
47
- const people = function (n) {
48
- let res = ' ';
49
- res += n || 'no';
50
- if (n === 1) return res + ' person';
51
- return res + ' people';
52
- };
53
- const say = function (str) {
54
- console.log(str);
55
- const p = dom.createElement('p');
56
- p.textContent = str;
57
- tips.appendChild(p);
58
- };
59
- const link = function (contents, uri) {
60
- if (!uri) return contents;
61
- const a = dom.createElement('a');
62
- a.setAttribute('href', uri);
63
- a.appendChild(contents);
64
- return a;
65
- };
66
- const text = function (str) {
67
- return dom.createTextNode(str);
68
- };
69
- const buildCheckboxForm = function (lab, statement, state) {
70
- const f = dom.createElement('form');
71
- const input = dom.createElement('input');
72
- f.appendChild(input);
73
- const tx = dom.createTextNode(lab);
74
- tx.className = 'question';
75
- f.appendChild(tx);
76
- input.setAttribute('type', 'checkbox');
77
- const boxHandler = function (_e) {
78
- tx.className = 'pendingedit';
79
- // alert('Should be greyed out')
80
- if (this.checked) {
81
- // Add link
82
- try {
83
- outliner.UserInput.sparqler.insert_statement(statement, function (uri, success, errorBody) {
84
- tx.className = 'question';
85
- if (!success) {
86
- UI.log.alert(null, 'Message', 'Error occurs while inserting ' + statement + '\n\n' + errorBody);
87
- input.checked = false; // rollback UI
88
- return;
89
- }
90
- kb.add(statement.subject, statement.predicate, statement.object, statement.why);
91
- });
92
- } catch (e) {
93
- UI.log.error('Data write fails:' + e);
94
- UI.log.alert('Data write fails:' + e);
95
- input.checked = false; // rollback UI
96
- tx.className = 'question';
97
- }
98
- } else {
99
- // Remove link
100
- try {
101
- outliner.UserInput.sparqler.delete_statement(statement, function (uri, success, errorBody) {
102
- tx.className = 'question';
103
- if (!success) {
104
- UI.log.alert('Error occurs while deleting ' + statement + '\n\n' + errorBody);
105
- this.checked = true; // Rollback UI
106
- } else {
107
- kb.removeMany(statement.subject, statement.predicate, statement.object, statement.why);
108
- }
109
- });
110
- } catch (e) {
111
- UI.log.alert('Delete fails:' + e);
112
- this.checked = true; // Rollback UI
113
- // return
114
- }
115
- }
116
- };
117
- input.checked = state;
118
- input.addEventListener('click', boxHandler, false);
119
- return f;
120
- };
121
- const oneFriend = function (friend, _confirmed) {
122
- return UI.widgets.personTR(dom, UI.ns.foaf('knows'), friend, {});
123
- };
124
-
125
- // ////////// Body of render():
126
-
127
- const outliner = context.getOutliner(dom);
128
- const kb = context.session.store;
129
- const div = dom.createElement('div');
130
- div.setAttribute('class', 'socialPane');
131
- const foaf = UI.ns.foaf;
132
- const vcard = UI.ns.vcard;
133
-
134
- // extracted from tabbedtab.css 2017-03-21
135
- const navBlockStyle = 'background-color: #eee; width: 25%; border: 0; padding: 0.5em; margin: 0;';
136
- const mainBlockStyle = 'background-color: #fff; color: #000; width: 46%; margin: 0; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 0;';
137
- const foafPicStyle = ' width: 100% ; border: none; margin: 0; padding: 0;';
138
- const structure = div.appendChild(dom.createElement('table'));
139
- const tr = structure.appendChild(dom.createElement('tr'));
140
- const left = tr.appendChild(dom.createElement('td'));
141
- const middle = tr.appendChild(dom.createElement('td'));
142
- const right = tr.appendChild(dom.createElement('td'));
143
- const tools = left;
144
- tools.style.cssText = navBlockStyle;
145
- const mainTable = middle.appendChild(dom.createElement('table'));
146
- mainTable.style.cssText = mainBlockStyle;
147
- const tips = right;
148
- tips.style.cssText = navBlockStyle;
149
-
150
- // Image top left
151
- const src = kb.any(s, foaf('img')) || kb.any(s, foaf('depiction'));
152
- if (src) {
153
- const img = dom.createElement('IMG');
154
- img.setAttribute('src', src.uri); // w640 h480
155
- // img.className = 'foafPic'
156
- img.style.cssText = foafPicStyle;
157
- tools.appendChild(img);
158
- }
159
- const name = kb.anyValue(s, foaf('name')) || '???';
160
- let h3 = dom.createElement('H3');
161
- h3.appendChild(dom.createTextNode(name));
162
- let me = _solidLogic.authn.currentUser();
163
- const meUri = me ? me.uri : null;
164
-
165
- // @@ Add: event handler to redraw the stuff below when me changes.
166
- const loginOutButton = UI.login.loginStatusBox(dom, webIdUri => {
167
- me = kb.sym(webIdUri);
168
- // @@ To be written: redraw as a function the new me
169
- // @@ refresh the sidebars
170
- UI.widgets.refreshTree(div); // this refreshes the middle at least
171
- });
172
- tips.appendChild(loginOutButton);
173
- const thisIsYou = me && kb.sameThings(me, s);
174
- const knows = foaf('knows');
175
- // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')
176
- const familiar = kb.anyValue(s, foaf('givenname')) || kb.anyValue(s, foaf('firstName')) || kb.anyValue(s, foaf('nick')) || kb.anyValue(s, foaf('name')) || kb.anyValue(s, vcard('fn'));
177
- const friends = kb.each(s, knows);
178
-
179
- // Do I have a public profile document?
180
- let profile = null; // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }
181
- let editable = false;
182
- let incoming;
183
- let outgoing;
184
- if (me) {
185
- // The definition of FAF personal profile document is ..
186
- const works = kb.each(undefined, foaf('primaryTopic'), me); // having me as primary topic
187
- let message = '';
188
- for (let i = 0; i < works.length; i++) {
189
- if (kb.whether(works[i], UI.ns.rdf('type'), foaf('PersonalProfileDocument'))) {
190
- editable = outliner.UserInput.sparqler.editable(works[i].uri, kb);
191
- if (!editable) {
192
- message += 'Your profile <' + UI.utils.escapeForXML(works[i].uri) + '> is not remotely editable.';
193
- } else {
194
- profile = works[i];
195
- break;
196
- }
197
- }
198
- }
199
- if (!profile) {
200
- say(message + '\nI couldn\'t find your editable personal profile document.');
201
- } else {
202
- say('Editing your profile ' + profile + '.');
203
- // Do I have an EDITABLE profile?
204
- editable = outliner.UserInput.sparqler.editable(profile.uri, kb);
205
- }
206
- if (thisIsYou) {
207
- // This is about me
208
- // pass... @@
209
- } else {
210
- // This is about someone else
211
- // My relationship with this person
212
-
213
- h3 = dom.createElement('h3');
214
- h3.appendChild(dom.createTextNode('You and ' + familiar));
215
- tools.appendChild(h3);
216
- const cme = kb.canon(me);
217
- incoming = kb.whether(s, knows, cme);
218
- outgoing = false;
219
- const outgoingSt = kb.statementsMatching(cme, knows, s);
220
- if (outgoingSt.length) {
221
- outgoing = true;
222
- if (!profile) profile = outgoingSt[0].why;
223
- }
224
- const tr = dom.createElement('tr');
225
- tools.appendChild(tr);
226
- const youAndThem = function () {
227
- tr.appendChild(link(text('You'), meUri));
228
- tr.appendChild(text(' and '));
229
- tr.appendChild(link(text(familiar), s.uri));
230
- };
231
- if (!incoming) {
232
- if (!outgoing) {
233
- youAndThem();
234
- tr.appendChild(text(' have not said you know each other.'));
235
- } else {
236
- tr.appendChild(link(text('You'), meUri));
237
- tr.appendChild(text(' know '));
238
- tr.appendChild(link(text(familiar), s.uri));
239
- tr.appendChild(text(' (unconfirmed)'));
240
- }
241
- } else {
242
- if (!outgoing) {
243
- tr.appendChild(link(text(familiar), s.uri));
244
- tr.appendChild(text(' knows '));
245
- tr.appendChild(link(text('you'), meUri));
246
- tr.appendChild(text(' (unconfirmed).')); // @@
247
- tr.appendChild(text(' confirm you know '));
248
- tr.appendChild(link(text(familiar), s.uri));
249
- tr.appendChild(text('.'));
250
- } else {
251
- youAndThem();
252
- tr.appendChild(text(' say you know each other.'));
253
- }
254
- }
255
- if (editable) {
256
- const f = buildCheckboxForm('You know ' + familiar, new $rdf.Statement(me, knows, s, profile), outgoing);
257
- tools.appendChild(f);
258
- } // editable
259
-
260
- // //////////////// Mutual friends
261
- if (friends) {
262
- const myFriends = kb.each(me, foaf('knows'));
263
- if (myFriends.length) {
264
- const mutualFriends = common(friends, myFriends);
265
- const tr = dom.createElement('tr');
266
- tools.appendChild(tr);
267
- tr.appendChild(dom.createTextNode('You' + (familiar ? ' and ' + familiar : '') + ' know' + people(mutualFriends.length) + ' found in common'));
268
- if (mutualFriends) {
269
- for (let i = 0; i < mutualFriends.length; i++) {
270
- tr.appendChild(dom.createTextNode(', ' + UI.utils.label(mutualFriends[i])));
271
- }
272
- }
273
- }
274
- const tr = dom.createElement('tr');
275
- tools.appendChild(tr);
276
- } // friends
277
- } // About someone else
278
- } // me is defined
279
- // End of you and s
280
-
281
- // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))
282
-
283
- // ///////////////////////////////////////////// Main block
284
- //
285
- // Should: Find the intersection and difference sets
286
-
287
- // List all x such that s knows x.
288
- UI.widgets.attachmentList(dom, s, mainTable, {
289
- doc: profile,
290
- modify: !!editable,
291
- predicate: foaf('knows'),
292
- noun: 'friend'
293
- });
294
-
295
- // Figure out which are reciprocated:
296
- // @@ Does not look up profiles
297
- // Does distinguish reciprocated from unreciprocated friendships
298
- //
299
- function _triageFriends(s) {
300
- outgoing = kb.each(s, foaf('knows'));
301
- incoming = kb.each(undefined, foaf('knows'), s); // @@ have to load the friends
302
- const confirmed = [];
303
- const unconfirmed = [];
304
- const requests = [];
305
- for (let i = 0; i < outgoing.length; i++) {
306
- const friend = outgoing[i];
307
- let found = false;
308
- for (let j = 0; j < incoming.length; j++) {
309
- if (incoming[j].sameTerm(friend)) {
310
- found = true;
311
- break;
312
- }
313
- }
314
- if (found) confirmed.push(friend);else unconfirmed.push(friend);
315
- } // outgoing
316
-
317
- for (let i = 0; i < incoming.length; i++) {
318
- const friend = incoming[i];
319
- // var lab = UI.utils.label(friend)
320
- let found = false;
321
- for (let j = 0; j < outgoing.length; j++) {
322
- if (outgoing[j].sameTerm(friend)) {
323
- found = true;
324
- break;
325
- }
326
- }
327
- if (!found) requests.push(friend);
328
- } // incoming
329
-
330
- const cases = [['Acquaintances', outgoing], ['Mentioned as acquaintances by: ', requests]];
331
- for (let i = 0; i < cases.length; i++) {
332
- const thisCase = cases[i];
333
- const friends = thisCase[1];
334
- if (friends.length === 0) continue; // Skip empty sections (sure?)
335
-
336
- const h3 = dom.createElement('h3');
337
- h3.textContent = thisCase[0];
338
- const htr = dom.createElement('tr');
339
- htr.appendChild(h3);
340
- mainTable.appendChild(htr);
341
- const items = [];
342
- for (let j9 = 0; j9 < friends.length; j9++) {
343
- items.push([UI.utils.label(friends[j9]), friends[j9]]);
344
- }
345
- items.sort();
346
- let last = null;
347
- let fr;
348
- for (let j7 = 0; j7 < items.length; j7++) {
349
- fr = items[j7][1];
350
- if (fr.sameTerm(last)) continue; // unique
351
- last = fr;
352
- if (UI.utils.label(fr) !== '...') {
353
- // This check is to avoid bnodes with no labels attached
354
- // appearing in the friends list with "..." - Oshani
355
- mainTable.appendChild(oneFriend(fr));
356
- }
357
- }
358
- }
359
- }
360
- /* if ($rdf.keepThisCodeForLaterButDisableFerossConstantConditionPolice) {
361
- triageFriends(s)
362
- } */
363
- // //////////////////////////////////// Basic info on left
364
-
365
- h3 = dom.createElement('h3');
366
- h3.appendChild(dom.createTextNode('Basic Information'));
367
- tools.appendChild(h3);
368
-
369
- // For each home page like thing make a label which will
370
- // make sense and add the domain (like "w3.org blog") if there are more than one of the same type
371
- //
372
- const preds = [UI.ns.foaf('homepage'), UI.ns.foaf('weblog'), UI.ns.foaf('workplaceHomepage'), UI.ns.foaf('schoolHomepage')];
373
- for (let i6 = 0; i6 < preds.length; i6++) {
374
- const pred = preds[i6];
375
- const sts = kb.statementsMatching(s, pred);
376
- if (sts.length === 0) {
377
- // if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
378
- } else {
379
- const uris = [];
380
- for (let j5 = 0; j5 < sts.length; j5++) {
381
- const st = sts[j5];
382
- if (st.object.uri) uris.push(st.object.uri); // Ignore if not symbol
383
- }
384
- uris.sort();
385
- let last2 = '';
386
- let lab2;
387
- for (let k = 0; k < uris.length; k++) {
388
- const uri = uris[k];
389
- if (uri === last2) continue; // uniques only
390
- last2 = uri;
391
- let hostlabel = '';
392
- lab2 = UI.utils.label(pred);
393
- if (uris.length > 1) {
394
- const l = uri.indexOf('//');
395
- if (l > 0) {
396
- let r = uri.indexOf('/', l + 2);
397
- const r2 = uri.lastIndexOf('.', r);
398
- if (r2 > 0) r = r2;
399
- hostlabel = uri.slice(l + 2, r);
400
- }
401
- }
402
- if (hostlabel) lab2 = hostlabel + ' ' + lab2; // disambiguate
403
- const t = dom.createTextNode(lab2);
404
- const a = dom.createElement('a');
405
- a.appendChild(t);
406
- a.setAttribute('href', uri);
407
- const d = dom.createElement('div');
408
- // d.className = 'social_linkButton'
409
- d.style.cssText = 'width: 80%; background-color: #fff; border: solid 0.05em #ccc; margin-top: 0.1em; margin-bottom: 0.1em; padding: 0.1em; text-align: center;';
410
- d.appendChild(a);
411
- tools.appendChild(d);
412
- }
413
- }
414
- }
415
- const preds2 = [UI.ns.foaf('openid'), UI.ns.foaf('nick')];
416
- for (let i2 = 0; i2 < preds2.length; i2++) {
417
- const pred = preds2[i2];
418
- const sts2 = kb.statementsMatching(s, pred);
419
- if (sts2.length === 0) {
420
- // if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
421
- } else {
422
- outliner.appendPropertyTRs(tools, sts2, false, function (_pred) {
423
- return true;
424
- });
425
- }
426
- }
427
- return div;
428
- } // render()
429
- }; //
430
- // ends