annotate service/arduinoNode/static/index.html @ 198:06795f84fe29

arduinoNode config. missing import Ignore-this: d2fb9c1c35ff9b30f0b7b0ee67342821
author drewp@bigasterisk.com
date Sun, 04 Oct 2015 04:15:57 -0700
parents 35e07a9f3287
children f8ffb9d8d982
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
1 <!doctype html>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
2 <html>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
3 <head>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
4 <title>arduinoNode</title>
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
5 <meta name=viewport content="width=device-width, initial-scale=1">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
6 <meta charset="utf-8" />
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
7 <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
8 <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
9 <link rel="import" href="/lib/polymer/1.0.9/iron-ajax/iron-ajax.html">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
10 <link rel="import" href="/lib/polymer/1.0.9/iron-flex-layout/iron-flex-layout.html">
198
06795f84fe29 arduinoNode config. missing import
drewp@bigasterisk.com
parents: 194
diff changeset
11 <link rel="import" href="/lib/polymer/1.0.9/paper-button/paper-button.html">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
12 <link rel="import" href="/room/ari/static/rdf-observe.html">
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
13 <link rel="import" href="/room/ari/static/rdf-oneshot.html">
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
14 <link rel="import" href="/room/ari/static/rdf-uri.html">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
15 <link rel="import" href="static/output-widgets.html">
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
16 <style>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
17 body {
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
18 font-family: monospace;
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
19 display: flex;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
20 flex-direction: column;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
21 margin: 0;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
22 height: 100vh;
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
23 }
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
24 </style>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
25 </head>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
26 <body>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
27 <script>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
28 window.NS = {
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
29 dev: 'http://projects.bigasterisk.com/device/',
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
30 room: 'http://projects.bigasterisk.com/room/',
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
31 rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
187
fc5fdcc3ed4a board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents: 173
diff changeset
32 sensor: 'http://bigasterisk.com/homeauto/sensor/'
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
33 };
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
34 </script>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
35
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
36 <dom-module id="linked-uri">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
37 <template>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
38 <a href$="{{href}}">{{compactUri(href)}}</a>
173
0daa8cbbd8f6 handle compact/full uris better, but still not always right
drewp@bigasterisk.com
parents: 171
diff changeset
39 </template>
187
fc5fdcc3ed4a board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents: 173
diff changeset
40 <script>
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
41 HTMLImports.whenReady(function () {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
42 Polymer({
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
43 is: 'linked-uri',
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
44 properties: { href: { notify: true } },
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
45 behaviors: [BigastUri]
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
46 });
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
47 });
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
48 </script>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
49 </dom-module>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
50
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
51 <!-- subj/pred are compact uris -->
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
52 <dom-module id="watched-subgraph">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
53 <style>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
54 .read { font-weight: bold; }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
55 </style>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
56 <template>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
57 <rdf-observe graph="{{graph}}" subject="{{subj}}" predicate="{{pred}}" out="{{out}}">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
58 </rdf-observe>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
59
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
60 <div><span>{{compactUri(subj)}}</span>, <span>{{compactUri(pred)}}</span>,
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
61 <span class="read">{{formatted(out)}}</span>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
62 </div>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
63
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
64 </template>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
65 <script>
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
66 HTMLImports.whenReady(function () {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
67 Polymer({
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
68 is: 'watched-subgraph',
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
69 properties: {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
70 graph: { notify: true },
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
71 out: { notify: true },
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
72 pred: { notify: true },
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
73 subj: { notify: true }
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
74 },
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
75 behaviors: [BigastUri],
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
76 formatted: function (out) {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
77 var obj = out[this.compactUri(this.pred)];
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
78 if (typeof obj == 'string') {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
79 return this.compactUri(obj);
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
80 } else {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
81 return obj['@value'];
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
82 }
187
fc5fdcc3ed4a board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents: 173
diff changeset
83 }
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
84 });
187
fc5fdcc3ed4a board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents: 173
diff changeset
85 });
fc5fdcc3ed4a board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents: 173
diff changeset
86 </script>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
87 </dom-module>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
88
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
89 <dom-module id="arduinonode-boards">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
90 <style>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
91 h1 {
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
92 margin: 0;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
93 font-size: 130%;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
94 }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
95 ul {
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
96 padding-left: 5px;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
97 }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
98 .board, .device {
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
99 border: 1px solid gray;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
100 border-radius: 10px;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
101 margin: 13px;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
102 padding: 7px;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
103 box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.14);
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
104 }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
105 .board {
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
106 background: rgb(244, 244, 244);
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
107 }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
108 .device {
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
109 background: #fff;
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
110 }
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
111 </style>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
112 <template>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
113 <iron-ajax url="boards" auto="true" handle-as="json"
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
114 last-response="{{ret}}"></iron-ajax>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
115 <template is="dom-repeat" items="{{ret.boards}}" as="board">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
116 <div class="board">
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
117 <h1>Board <linked-uri href$="{{board.uri}}"></linked-uri></h1>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
118 <h2>Devices</h2>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
119 <ul>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
120 <template is="dom-repeat" items="{{board.devices}}" as="dev">
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
121 <div class="device">
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
122 <h1>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
123 <span>{{dev.className}}</span>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
124 <linked-uri href$="{{dev.uri}}"></linked-uri>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
125 </h1>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
126 <template is="dom-if" if="{{dev.watchPrefixes.length}}">
171
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
127 <div>watching:</div>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
128 <ul>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
129 <template is="dom-repeat" items="{{dev.watchPrefixes}}" as="prefix">
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
130 <watched-subgraph graph="{{board.graph}}" subj="{{prefix.0}}" pred="{{prefix.1}}"></watched-subgraph>
171
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
131 </template>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
132 </ul>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
133 </template>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
134
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
135 <template is="dom-if" if="{{dev.outputWidgets.length}}">
171
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
136 <div>send output:</div>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
137 <ul>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
138 <template is="dom-repeat" items="{{dev.outputWidgets}}" as="out">
171
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
139 <div>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
140 <output-widget-any desc="{{out}}"></output-widget-any>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
141 </div>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
142 </template>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
143 </ul>
4d2df276baae clean up rdf-observe demo ui
drewp@bigasterisk.com
parents: 170
diff changeset
144 </template>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
145 </div>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
146 </template>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
147 </ul>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
148 </div>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
149 </template>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
150 </template>
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
151 <script>
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
152 HTMLImports.whenReady(function () {
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
153 Polymer({
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
154 is: 'arduinonode-boards',
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
155 behaviors: [BigastUri]
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
156 });
193
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
157 });
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
158 </script>
960b3b4cdd29 rewrite to polymer 1
drewp@bigasterisk.com
parents: 187
diff changeset
159 </dom-module>
194
35e07a9f3287 fix arduinoNode for safari
drewp@bigasterisk.com
parents: 193
diff changeset
160 <arduinonode-boards></arduinonode-boards>
170
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
161 </body>
376599552a4c polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff changeset
162 </html>