# HG changeset patch # User Drew Perttula # Date 1525421118 0 # Node ID f2265601ead6cdab7444237e78e7ca525aae30c9 # Parent bd0c83b063df9cc1e0c0eec788bfe23b1f271f87 edit-choice/etc fixes and tests Ignore-this: 8676aaddd402c023712efb4f4112d982 diff -r bd0c83b063df -r f2265601ead6 light9/web/edit-choice-demo.html --- a/light9/web/edit-choice-demo.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/edit-choice-demo.html Fri May 04 08:05:18 2018 +0000 @@ -3,7 +3,8 @@ - + + diff -r bd0c83b063df -r f2265601ead6 light9/web/edit-choice.coffee --- a/light9/web/edit-choice.coffee Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/edit-choice.coffee Fri May 04 08:05:18 2018 +0000 @@ -42,13 +42,14 @@ -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 @@ unlink: -> @uri = null +customElements.define(EditChoice.is, EditChoice) \ No newline at end of file diff -r bd0c83b063df -r f2265601ead6 light9/web/edit-choice.html --- a/light9/web/edit-choice.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/edit-choice.html Fri May 04 08:05:18 2018 +0000 @@ -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 -r bd0c83b063df -r f2265601ead6 light9/web/edit-choice_test.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/web/edit-choice_test.html Fri May 04 08:05:18 2018 +0000 @@ -0,0 +1,58 @@ + + + + edit-choice test + + + + + + + + + + + + +

Index

+
+
+ + + +
+ + + + diff -r bd0c83b063df -r f2265601ead6 light9/web/graph.coffee --- a/light9/web/graph.coffee Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/graph.coffee Fri May 04 08:05:18 2018 +0000 @@ -139,8 +139,10 @@ @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 @@ 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 @@ 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 -r bd0c83b063df -r f2265601ead6 light9/web/paint/paint-report-elements.html --- a/light9/web/paint/paint-report-elements.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/paint/paint-report-elements.html Fri May 04 08:05:18 2018 +0000 @@ -49,7 +49,7 @@
-
+
diff -r bd0c83b063df -r f2265601ead6 light9/web/rdfdb-synced-graph.html --- a/light9/web/rdfdb-synced-graph.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/rdfdb-synced-graph.html Fri May 04 08:05:18 2018 +0000 @@ -1,9 +1,12 @@ - + + + + diff -r bd0c83b063df -r f2265601ead6 light9/web/rdfdb-synced-graph_test.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/web/rdfdb-synced-graph_test.html Fri May 04 08:05:18 2018 +0000 @@ -0,0 +1,52 @@ + + + + rdfdb-synced-graph test + + + + + + + + + + + +
+
+ + + +
+ + + + diff -r bd0c83b063df -r f2265601ead6 light9/web/resource-display.html --- a/light9/web/resource-display.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/resource-display.html Fri May 04 08:05:18 2018 +0000 @@ -1,23 +1,48 @@ - + - diff -r bd0c83b063df -r f2265601ead6 light9/web/resource-display_test.html --- a/light9/web/resource-display_test.html Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/resource-display_test.html Fri May 04 08:05:18 2018 +0000 @@ -3,32 +3,120 @@ resource-display test - - - - - -
- -
-
+ + + + + + + + + +
+
+ + + +
- + mocha.run(); + diff -r bd0c83b063df -r f2265601ead6 light9/web/style.css --- a/light9/web/style.css Fri May 04 07:58:13 2018 +0000 +++ b/light9/web/style.css Fri May 04 08:05:18 2018 +0000 @@ -145,34 +145,7 @@ .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;