Changeset 6047

Show
Ignore:
Timestamp:
04/12/10 19:38:25 (3 years ago)
Author:
Cyrus
Message:

nyu2: More work

Location:
luci2/cbi2/htdocs
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • luci2/cbi2/htdocs/nyu2.js

    r6037 r6047  
    5656    dhtmlHistory.addListener(load); //On history change, call 'load' function  
    5757}); 
    58  
    59  
    60 nyu2_fon_require(new Array("cbi2rpc", "validator", "widget"), 
    61 function() { 
    62     var rpcProxy = new CBI2Proxy("luci2/json"); 
    63     rpcProxy.invoke({"method": "dispatchTree"}, nyu2_init_tree); 
    64 }); 
    65  
    66 function nyu2_init_tree(object) { 
    67     nyu2_tree = object; 
    68 } 
  • luci2/cbi2/htdocs/nyu2/widget.js

    r6038 r6047  
    8585 
    8686widgets.depend = Class.create(Widget, { 
     87    isContainer: true, 
     88    isNamespace: true, 
     89 
    8790    initialize: function($super, parent, name, options) { 
    8891        $super(parent, name, options); 
     
    118121        } 
    119122        this.active = !this.active; 
     123        this.namespace.node.fire("nyu2:updated"); 
    120124    }, 
    121125 
     
    134138        var self = this; 
    135139        b.on("submit", function() { self.submit(); }); 
     140        this.node.on("change", function() { this.fire("nyu2:updated"); }); 
    136141    }, 
    137142 
     
    189194}); 
    190195 
     196widgets.menu = Class.create(Widget, { 
     197    isNamespace: true, 
     198 
     199    initialize: function($super, parent, name, options) { 
     200        $super(parent, name, options); 
     201        this.header.update(options.caption); 
     202    } 
     203}); 
     204 
     205widgets.entry = Class.create(Widget, { 
     206    initialize: function($super, parent, name, options) { 
     207        $super(parent, name, options); 
     208        this.body.update(options.caption); 
     209        this.node.on("click", 
     210                function() { this.fire("nyu2:navigate", options.page); }); 
     211    } 
     212}); 
     213 
    191214nyu2_notify_loaded("widget");