diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/service/shuttlepro/gui.js	Fri Oct 11 22:36:41 2013 -0700
@@ -0,0 +1,20 @@
+(function () {
+    function abbreviateTrig(trig) {
+        // prefixes, abbreviations, make everything into links, etc
+        return trig;
+    }
+    
+    var model = {
+        current: ko.observable("...")
+    };
+    model.refreshGraph = function() {
+        $.ajax({
+            url: "graph",
+            success: function(data) {
+                model.current(abbreviateTrig(data));
+            }
+        });
+    };
+    model.refreshGraph();
+    ko.applyBindings(model);   
+})();