diff --git a/light9/web/edit-choice-demo.html b/light9/web/edit-choice-demo.html --- a/light9/web/edit-choice-demo.html +++ b/light9/web/edit-choice-demo.html @@ -3,7 +3,8 @@ - + + diff --git a/light9/web/edit-choice.coffee b/light9/web/edit-choice.coffee --- a/light9/web/edit-choice.coffee +++ b/light9/web/edit-choice.coffee @@ -42,13 +42,14 @@ window.setupDrop = (senseElem, highlight -Polymer - is: "edit-choice", - properties: +class EditChoice extends Polymer.Element + @is: "edit-choice", + @properties: graph: {type: Object, notify: true}, uri: {type: String, notify: true}, - ready: -> + connectedCallback: -> + super.connectedCallback() @uri = null setupDrop @$.box, @$.box, null, (uri) => @uri=uri @@ -57,3 +58,4 @@ Polymer unlink: -> @uri = null +customElements.define(EditChoice.is, EditChoice) \ No newline at end of file diff --git a/light9/web/edit-choice.html b/light9/web/edit-choice.html --- a/light9/web/edit-choice.html +++ b/light9/web/edit-choice.html @@ -9,6 +9,7 @@ display: inline-block; background: #141448; min-width: 10em; + padding: 3px 8px; } #box.dragging { background: rgba(126, 52, 245, 0.0784313725490196); diff --git a/light9/web/edit-choice_test.html b/light9/web/edit-choice_test.html new file mode 100644 --- /dev/null +++ b/light9/web/edit-choice_test.html @@ -0,0 +1,58 @@ + + + + edit-choice test + + + + + + + + + + + + +

Index

+
+
+ + + +
+ + + + diff --git a/light9/web/graph.coffee b/light9/web/graph.coffee --- a/light9/web/graph.coffee +++ b/light9/web/graph.coffee @@ -139,8 +139,10 @@ class window.SyncedGraph @clearGraph() if @patchSenderUrl - @_client = new RdfDbClient(@patchSenderUrl, @_clearGraphOnNewConnection.bind(@), - @_applyPatch.bind(@), @setStatus) + @_client = new RdfDbClient(@patchSenderUrl, + @_clearGraphOnNewConnection.bind(@), + @_applyPatch.bind(@), + @setStatus) clearGraph: -> # just deletes the statements; watchers are unaffected. @@ -185,6 +187,8 @@ class window.SyncedGraph patch = {delQuads: [], addQuads: []} parser = N3.Parser() parser.parse trig, (error, quad, prefixes) => + if error + throw new Error(error) if (quad) patch.addQuads.push(quad) else @@ -287,10 +291,13 @@ class window.SyncedGraph labelOrTail: (uri) -> try - @graph.stringValue(uri, @graph.Uri('rdfs:label')) + ret = @stringValue(uri, @Uri('rdfs:label')) catch - words = uri.split('/') - words[words.length-1] + words = uri.value.split('/') + ret = words[words.length-1] + if not ret + ret = uri.value + return ret objects: (s, p) -> @_autoDeps.askedFor(s, p, null, null) diff --git a/light9/web/paint/paint-report-elements.html b/light9/web/paint/paint-report-elements.html --- a/light9/web/paint/paint-report-elements.html +++ b/light9/web/paint/paint-report-elements.html @@ -49,7 +49,7 @@
-
+
diff --git a/light9/web/rdfdb-synced-graph.html b/light9/web/rdfdb-synced-graph.html --- a/light9/web/rdfdb-synced-graph.html +++ b/light9/web/rdfdb-synced-graph.html @@ -1,9 +1,12 @@ - + + + + diff --git a/light9/web/rdfdb-synced-graph_test.html b/light9/web/rdfdb-synced-graph_test.html new file mode 100644 --- /dev/null +++ b/light9/web/rdfdb-synced-graph_test.html @@ -0,0 +1,52 @@ + + + + rdfdb-synced-graph test + + + + + + + + + + + +
+
+ + + +
+ + + + diff --git a/light9/web/resource-display.html b/light9/web/resource-display.html --- a/light9/web/resource-display.html +++ b/light9/web/resource-display.html @@ -1,23 +1,48 @@ - + - diff --git a/light9/web/resource-display_test.html b/light9/web/resource-display_test.html --- a/light9/web/resource-display_test.html +++ b/light9/web/resource-display_test.html @@ -3,32 +3,120 @@ resource-display test - - - - - -
- -
-
+ + + + + + + + + +
+
+ + + +
- + mocha.run(); + diff --git a/light9/web/style.css b/light9/web/style.css --- a/light9/web/style.css +++ b/light9/web/style.css @@ -145,34 +145,7 @@ button a { .vari { color: white; } -a.resource { - color: inherit; - text-decoration: none; -} -.resource { - border: 1px solid #545454; - border-radius: 5px; - padding: 1px; - margin: 2px; - background: rgb(49, 49, 49); - display: inline-block; - text-shadow: 1px 1px 2px black; -} -.resource.minor { - background: none; - border: none; -} -.resource a { - color: rgb(150, 150, 255); - padding: 1px; - display: inline-block; -} -.resource.minor a { - text-decoration: none; - color: rgb(155, 155, 193); - padding: 0 -} .sub { display: inline-block; vertical-align: top;