annotate service/shuttlepro/gui.js @ 799:e0e623c01a69

ts build is part of docker now; new web debug console
author drewp@bigasterisk.com
date Fri, 01 Jan 2021 14:17:12 -0800
parents 57ae7dc0f417
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
130
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
1 (function () {
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
2 function abbreviateTrig(trig) {
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
3 // prefixes, abbreviations, make everything into links, etc
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
4 return trig;
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
5 }
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
6
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
7 var model = {
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
8 current: ko.observable("...")
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
9 };
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
10 model.refreshGraph = function() {
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
11 $.ajax({
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
12 url: "graph",
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
13 success: function(data) {
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
14 model.current(abbreviateTrig(data));
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
15 }
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
16 });
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
17 };
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
18 model.refreshGraph();
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
19 ko.applyBindings(model);
57ae7dc0f417 new shuttlepro web service with /graph
drewp@bigasterisk.com
parents:
diff changeset
20 })();