view 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 source

(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);   
})();