From f909c2409ffdf1fbd920b0c6aa8374b34e674579 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 17 Mar 2009 10:33:51 +0000 Subject: [PATCH] begin implementation of the SideBar --- deluge/ui/web/js/deluge-bars.js | 46 ++++++++++++++++++++++----------- deluge/ui/web/js/deluge-ui.js | 9 ++++--- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/deluge/ui/web/js/deluge-bars.js b/deluge/ui/web/js/deluge-bars.js index 75eadfbfc..089cf6e8b 100644 --- a/deluge/ui/web/js/deluge-bars.js +++ b/deluge/ui/web/js/deluge-bars.js @@ -183,20 +183,6 @@ Deluge.ToolBar.Bar = new Ext.Toolbar({ listeners: {'render': Deluge.ToolBar.onToolbarRender, scope: Deluge.ToolBar} }); - - -Deluge.SideBar = { - region: 'west', - id: 'sidebar', - cls: 'deluge-sidebar', - title: _('Sidebar'), - split: true, - width: 200, - minSize: 175, - collapsible: true, - margins: '5 0 0 5' -}; - Deluge.StatusBar = { onRender: function() { this.bound = { @@ -341,4 +327,34 @@ Deluge.StatusBar.Bar = new Ext.StatusBar({ defaultIconCls: 'x-not-connected', defaultText: _('Not Connected'), listeners: {'render': {scope: Deluge.StatusBar, fn: Deluge.StatusBar.onRender}} -}); \ No newline at end of file +}); + +Deluge.SideBar = { + + onRender: function(bar) { + this.Bar = bar; + Deluge.Events.on("disconnect", this.onDisconnect); + }, + + onDisconnect: function() { + + }, + + update: function(filters) { + + } +}; + +Deluge.SideBar.Config = { + region: 'west', + id: 'sidebar', + cls: 'deluge-sidebar', + title: _('Sidebar'), + layout: 'accordion', + split: true, + width: 200, + minSize: 175, + collapsible: true, + margins: '5 0 0 5', + listeners: {'render': {scope: Deluge.SideBar, fn: Deluge.SideBar.onRender}} +} \ No newline at end of file diff --git a/deluge/ui/web/js/deluge-ui.js b/deluge/ui/web/js/deluge-ui.js index f1d9ac9d9..e7798d824 100644 --- a/deluge/ui/web/js/deluge-ui.js +++ b/deluge/ui/web/js/deluge-ui.js @@ -32,7 +32,11 @@ Deluge.Ui = { title: 'Deluge', layout: 'border', tbar: Deluge.ToolBar.Bar, - items: [Deluge.SideBar, Deluge.Details.Panel, Deluge.Torrents.Grid], + items: [ + Deluge.SideBar.Config, + Deluge.Details.Panel, + Deluge.Torrents.Grid + ], bbar: Deluge.StatusBar.Bar }); @@ -45,8 +49,6 @@ Deluge.Ui = { Deluge.Events.on("connect", this.onConnect.bindWithEvent(this)); Deluge.Events.on("disconnect", this.onDisconnect.bindWithEvent(this)); Deluge.Client = new JSON.RPC('/json'); - - Deluge.SideBar = this.MainPanel.items.get('sidebar'); }, update: function() { @@ -101,6 +103,7 @@ Deluge.Ui = { }); Deluge.Torrents.Store.loadData(torrents); Deluge.StatusBar.update(data['stats']); + Deluge.SideBar.update(data['filters']); this.errorCount = 0; },