Mercurial > code > home > repos > homeauto
diff service/arduinoNode/static/index.html @ 992:ed1f54d81fc9
board control ui: output-rgb, fix ajax protocol, display output uris
Ignore-this: f3d3e6739851232d2177eacdd833c16
darcs-hash:20150708082237-312f9-e3ed5292c58b3463bd48f8da6f98e7414f45f84b
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Wed, 08 Jul 2015 01:22:37 -0700 |
parents | e9ed6159b5fa |
children | 960b3b4cdd29 |
line wrap: on
line diff
--- a/service/arduinoNode/static/index.html Wed Jul 08 01:21:02 2015 -0700 +++ b/service/arduinoNode/static/index.html Wed Jul 08 01:22:37 2015 -0700 @@ -21,6 +21,7 @@ dev: 'http://projects.bigasterisk.com/device/', room: 'http://projects.bigasterisk.com/room/', rdfs: 'http://www.w3.org/2000/01/rdf-schema#', + sensor: 'http://bigasterisk.com/homeauto/sensor/' }; </script> @@ -46,29 +47,42 @@ <polymer-element name="linked-uri" noscript attributes="href"> <template> - <a href="{{href}}">{{href}}</a> + <a href="{{href}}">{{href | compactUri}}</a> </template> </polymer-element> <!-- subj/pred are compact uris --> - <polymer-element name="watched-subgraph" noscript attributes="subj pred"> + <polymer-element name="watched-subgraph" attributes="graph subj pred"> <template> <style> .read { font-weight: bold; } </style> <rdf-observe - graph="http://dash:9059/graph" xtodo="get host here" + graph="{{graph}}" subject="{{subj}}" predicate="{{pred}}" out="{{out}}"> </rdf-observe> - <div>{{subj}}, {{pred}}, - <span class="read">{{out[pred]['@value']}}</span> + <div>{{subj | compactUri}}, {{pred | compactUri}}, + <span class="read">{{formattedOut}}</span> </div> </template> + <script> + Polymer({ + outChanged: function() { + var obj = this.out[this.pred]; + if (typeof(obj) == 'string') { + this.formattedOut = PolymerExpressions.prototype.compactUri(obj); + } else { + this.formattedOut = obj['@value']; + } + } + }); + </script> + </polymer-element> <polymer-element name="arduinonode-boards" noscript> @@ -117,6 +131,7 @@ <ul> <template repeat="{{prefix in dev.watchPrefixes}}"> <watched-subgraph + graph="{{board.graph}}" subj="{{prefix[0] | compactUri}}" pred="{{prefix[1] | compactUri}}"></watched-subgraph> </template>