remove the function wrap and deluge.sidebar construction

This commit is contained in:
Damien Churchill 2010-04-25 15:27:35 +01:00
parent 9cde1f3e45
commit 5b0ce6b3d8
2 changed files with 140 additions and 163 deletions

View File

@ -34,28 +34,6 @@
// _('State') // _('State')
// _('Tracker Host') // _('Tracker Host')
(function() {
// Renderer for the items in the filter grids.
function filterRenderer(value, p, r) {
var lname = value.toLowerCase().replace('.', '_');
var image = '';
if (r.store.id == 'tracker_host') {
if (value != 'Error') {
image = String.format('url(' + deluge.config.base + 'tracker/{0})', value);
} else {
lname = null;
}
}
if (image) {
return String.format('<div class="x-deluge-filter" style="background-image: {2};">{0} ({1})</div>', value, r.data['count'], image);
} else if (lname) {
return String.format('<div class="x-deluge-filter x-deluge-{2}">{0} ({1})</div>', value, r.data['count'], lname);
} else {
return String.format('<div class="x-deluge-filter">{0} ({1})</div>', value, r.data['count']);
}
}
/** /**
* @class Deluge.Sidebar * @class Deluge.Sidebar
* @author Damien Churchill <damoxc@gmail.com> * @author Damien Churchill <damoxc@gmail.com>
@ -205,5 +183,3 @@
store.commitChanges(); store.commitChanges();
} }
}); });
deluge.sidebar = new Deluge.Sidebar();
})();

View File

@ -53,6 +53,7 @@ deluge.ui = {
deluge.editTrackers = new Deluge.EditTrackersWindow(); deluge.editTrackers = new Deluge.EditTrackersWindow();
deluge.login = new Deluge.LoginWindow(); deluge.login = new Deluge.LoginWindow();
deluge.preferences = new Deluge.preferences.PreferencesWindow(); deluge.preferences = new Deluge.preferences.PreferencesWindow();
deluge.sidebar = new Deluge.Sidebar();
this.MainPanel = new Ext.Panel({ this.MainPanel = new Ext.Panel({
id: 'mainPanel', id: 'mainPanel',