diff --git a/web/index.html b/web/index.html index 0eccef808..117ca8682 100755 --- a/web/index.html +++ b/web/index.html @@ -47,6 +47,21 @@
+
+ Show + + + — +   +
+
diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 43b3930a9..a5d0345e7 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -65,6 +65,9 @@ Transmission.prototype = $('#toolbar-inspector').click($.proxy(this.toggleInspector,this)); + $('#filter-mode').change($.proxy(this.onFilterModeClicked,this)); + $('#filter-tracker').change($.proxy(this.onFilterTrackerClicked,this)); + if (!isMobileDevice) { $(document).bind('keydown', $.proxy(this.keyDown,this) ); $(document).bind('keyup', $.proxy(this.keyUp, this) ); @@ -97,8 +100,6 @@ Transmission.prototype = this.refreshTorrents(); this.togglePeriodicSessionRefresh(true); - this.filterSetup(); - this.updateButtonsSoon(); }, @@ -1059,8 +1060,6 @@ Transmission.prototype = fmt = Transmission.fmt, torrents = this.getAllTorrents(); - this.refreshFilterButton(); - // up/down speed for (i=0; row=torrents[i]; ++i) { u += row.getUploadSpeed(); @@ -1072,6 +1071,9 @@ Transmission.prototype = $('#speed-dn-container').toggleClass('active', d>0 ); $('#speed-dn-label').text( fmt.speedBps( d ) ); + + // visible torrents + $('#filter-count').text( fmt.plural(this._rows.length, 'Transfer') ); }, setEnabled: function(key, flag) @@ -1079,6 +1081,36 @@ Transmission.prototype = $(key).toggleClass('disabled', !flag); }, + updateFilterSelect: function() + { + var i, names, name, str, o, + e = $('#filter-tracker'), + trackers = this.getTrackers(); + + // build a sorted list of names + names = []; + for (name in trackers) + names.push (name); + names.sort(); + + // build the new html + if (!this.filterTracker) + str = ''; + else + str = ''; + for (i=0; name=names[i]; ++i) { + o = trackers[name]; + str += '