Mercurial > code > home > repos > homeauto
annotate service/shuttlepro/gui.js @ 130:57ae7dc0f417
new shuttlepro web service with /graph
Ignore-this: 1c8e71aad6ab24fa24532f4e5e01d2d9
author | drewp@bigasterisk.com |
---|---|
date | Fri, 11 Oct 2013 22:36:41 -0700 |
parents | |
children |
rev | line source |
---|---|
130 | 1 (function () { |
2 function abbreviateTrig(trig) { | |
3 // prefixes, abbreviations, make everything into links, etc | |
4 return trig; | |
5 } | |
6 | |
7 var model = { | |
8 current: ko.observable("...") | |
9 }; | |
10 model.refreshGraph = function() { | |
11 $.ajax({ | |
12 url: "graph", | |
13 success: function(data) { | |
14 model.current(abbreviateTrig(data)); | |
15 } | |
16 }); | |
17 }; | |
18 model.refreshGraph(); | |
19 ko.applyBindings(model); | |
20 })(); |