Author: damoxc
Revision: 4887
Log:
add a proper renderer for the filters
Diff:
Modified: trunk/deluge/ui/web/css/deluge.css
===================================================================
--- trunk/deluge/ui/web/css/deluge.css 2009-03-19 23:00:07 UTC (rev 4886)
+++ trunk/deluge/ui/web/css/deluge.css 2009-03-20 00:11:14 UTC (rev 4887)
@@ -33,14 +33,14 @@
background-repeat: no-repeat;
}
-#labels .all { background-image: url('/icons/16/all.png'); }
-#labels .active { background-image: url('/icons/16/active.png'); }
+.x-deluge-all { background-image: url('/icons/16/all.png'); }
+.x-deluge-active { background-image: url('/icons/16/active.png'); }
.x-deluge-downloading, .x-deluge-peer { background-image:
url('/icons/16/downloading.png'); }
.x-deluge-seeding, .deluge-torrents .seeding, .x-deluge-seed {
background-image: url('/icons/16/seeding.png'); }
-#labels .queued, .deluge-torrents .queued { background-image:
url('/icons/16/queued.png'); }
-#labels .paused, .deluge-torrents .paused { background-image:
url('/icons/16/inactive.png'); }
-#labels .error, .deluge-torrents .error { background-image:
url('/icons/16/alert.png'); }
-#labels .checking, .deluge-torrents .checking { background-image:
url('/icons/16/checking.png'); }
+.x-deluge-queued, .deluge-torrents .queued { background-image:
url('/icons/16/queued.png'); }
+.x-deluge-paused, .deluge-torrents .paused { background-image:
url('/icons/16/inactive.png'); }
+.x-deluge-error, .deluge-torrents .error { background-image:
url('/icons/16/alert.png'); }
+.x-deluge-checking, .deluge-torrents .checking { background-image:
url('/icons/16/checking.png'); }
/* Torrent Details */
@@ -147,4 +147,11 @@
.x-progress-text-back {
background: transparent;
color: White;
+}
+
+
+.x-deluge-filter {
+ background-repeat: no-repeat;
+ padding-left: 20px;
+ height: 25px;
}
\ No newline at end of file
Modified: trunk/deluge/ui/web/js/deluge-bars.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-bars.js 2009-03-19 23:00:07 UTC (rev
4886)
+++ trunk/deluge/ui/web/js/deluge-bars.js 2009-03-20 00:11:14 UTC (rev
4887)
@@ -341,6 +341,17 @@
},
+ renderer: function(value, p, r) {
+ var lname = value.toLowerCase();
+ lname = lname.replace('.', '_');
+
+ var image = '';
+ if (r.store.id == 'tracker_host') {
+ image = String.format('url(/tracker/{0})', value);
+ }
+ return String.format('<span class="x-deluge-filter
x-deluge-{2}" style="background-image: {3};">{0} ({1})</span>', value,
r.data['count'], lname, image);
+ },
+
update: function(filters) {
$each(filters, function(states, filter) {
if (this.panels.has(filter)) {
@@ -353,8 +364,10 @@
createFilter: function(filter, states) {
var store = new Ext.data.SimpleStore({
+ id: filter,
fields: [
- {name: 'filter'}
+ {name: 'filter'},
+ {name: 'count'}
]
});
@@ -372,7 +385,7 @@
store: store,
title: title,
columns: [
- {id: 'filter', sortable: false, renderer:
Deluge.Formatters.plain, dataIndex: 'filter'}
+ {id: 'filter', sortable: false, renderer:
this.renderer, dataIndex: 'filter'}
],
stripeRows: false,
hideHeaders: true,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---