Skip to content

Commit f7139eb

Browse files
author
Tim Berners-Lee
committed
generalize attachmentList, more feross-standard
1 parent 9460289 commit f7139eb

8 files changed

Lines changed: 258 additions & 224 deletions

File tree

lib/icons/noun_145978.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/icons/noun_289243.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/icons/noun_534313.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/acl-control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) {
239239
}
240240
}
241241
var tr = middleTable.appendChild(
242-
UI.widgets.personTR(dom, $rdf.sym(pred), $rdf.sym(obj), opt))
242+
UI.widgets.personTR(dom, ACL(pred), $rdf.sym(obj), opt))
243243
tr.predObj = [pred.uri, obj.uri]
244244

245245
}

src/signin.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,22 @@ UI.widgets.ensureTypeIndexes = function(context) {
233233
// Returns promise of context with arrays of symbols
234234
// context.instances
235235
// context.containers
236+
// 2016-12-11 change to inclde forClass arc a la
237+
// https://github.com/solid/solid/blob/master/proposals/data-discovery.md
236238
//
237239
UI.widgets.findAppInstances = function(context, klass) {
238240
return new Promise(function(resolve, reject){
239241
var kb = UI.store, ns = UI.ns, me = context.me, fetcher = UI.store.fetcher;
240242
UI.widgets.loadTypeIndexes(context)
241243
.then(function(indexes){
242244
var ix = context.index.private.concat(context.index.public);
243-
var instances = kb.each(klass, ns.solid('instance'));
244-
var containers = kb.each(klass, ns.solid('instanceContainer'));
245+
var registrations = kb.each(undefined, ns.solid('forClass'), klass)
246+
var instances = []
247+
var containers = []
248+
for (var r=0; r < registrations.length; r++) {
249+
instances = instances.concat(kb.each(klass, ns.solid('instance')))
250+
containers = containers.concat(kb.each(klass, ns.solid('instanceContainer')))
251+
}
245252
if (containers.length) {
246253
fetcher.load(containers).then(function(xhrs){
247254
for (var i=0; i<containers.length; i++) {
@@ -276,18 +283,26 @@ UI.widgets.registrationControl = function(context, instance, klass) {
276283
var tbody = box.children[0].children[0];
277284
var form = kb.bnode();// @@ say for now
278285

286+
var registrationStatements = function(index){
287+
var registrations = kb.each(undefined, ns.solid('instance'), instance)
288+
.filter(function(r){return kb.holds(r, ns.solid('forClass'), klass)})
289+
var reg = registrations.length ? registrations[0] : UI.widgets.newThing(index)
290+
return [ $rdf.st(reg, ns.solid('instance'), instance, index),
291+
$rdf.st(reg, ns.solid('forClass'), klass, index),];
292+
}
293+
279294
if (context.index.public && context.index.public.length >0) {
280295
var index = context.index.public[0];
281-
var statement = $rdf.st(klass, ns.solid('instance'), instance, index);
296+
var statements = registrationStatements(index)
282297
tbody.children[0].appendChild(UI.widgets.buildCheckboxForm(
283-
context.dom, UI.store, "Public link to this " + context.noun, null, statement, form, index));
298+
context.dom, UI.store, "Public link to this " + context.noun, null, statements, form, index));
284299
}
285300

286301
if (context.index.private && context.index.private.length >0) {
287302
var index = context.index.private[0];
288-
var statement = $rdf.st(klass, ns.solid('instance'), instance, index);
303+
var statements = registrationStatements(index)
289304
tbody.children[1].appendChild(UI.widgets.buildCheckboxForm(
290-
context.dom, UI.store, "Personal note of this " + context.noun, null, statement, form, index));
305+
context.dom, UI.store, "Personal note of this " + context.noun, null, statements, form, index));
291306
}
292307

293308
// UI.widgets.buildCheckboxForm(dom, kb, lab, del, ins, form, store)

src/tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ UI.tabs.tabWidget = function(options){
141141
} else {
142142
if (bodyDiv.asSetttings !== false){
143143
bodyDiv.innerHTML = 'loading item ...' + item
144-
options.showMain(bodyDiv, ele.subject)
144+
options.renderMain(bodyDiv, ele.subject)
145145
bodyDiv.asSetttings = false
146146
}
147147
}

0 commit comments

Comments
 (0)