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,34 +34,12 @@
// _('State')
// _('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
* @author Damien Churchill <damoxc@gmail.com>
* @version 1.3
*/
Deluge.Sidebar = Ext.extend(Ext.Panel, {
Deluge.Sidebar = Ext.extend(Ext.Panel, {
// private
panels: {},
@ -204,6 +182,4 @@
store.commitChanges();
}
});
deluge.sidebar = new Deluge.Sidebar();
})();
});

View File

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