allow custom templates to be specified for filters

This commit is contained in:
Damien Churchill 2010-04-25 16:04:02 +01:00
parent 5b0ce6b3d8
commit 3a12a50f3e
1 changed files with 6 additions and 2 deletions

View File

@ -52,8 +52,8 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
});
this.setTitle(_(title));
if (this.filterType == 'tracker_host') {
var tpl = '<div class="x-deluge-filter" style="background-image: url(' + deluge.config.base + 'tracker/{filter});">{filter} ({count})</div>';
if (Deluge.FilterPanel.templates[this.filterType]) {
var tpl = Deluge.FilterPanel.templates[this.filterType];
} else {
var tpl = '<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>';
}
@ -103,3 +103,7 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
return this.list.getStore();
}
});
Deluge.FilterPanel.templates = {
'tracker_host': '<div class="x-deluge-filter" style="background-image: url(' + deluge.config.base + 'tracker/{filter});">{filter} ({count})</div>'
}