(trunk web) Add Select / Deselect All buttons to the file listing. Patch from Grug. Fixes #2294

This commit is contained in:
Kevin Glowacz
2009-12-06 03:21:08 +00:00
parent d370222113
commit a53de0d430
5 changed files with 90 additions and 13 deletions

View File

@@ -154,10 +154,12 @@ TransmissionRemote.prototype =
} );
},
sendTorrentActionRequests: function( method, torrent_ids, callback ) {
sendTorrentSetRequests: function( method, torrent_ids, args, callback ) {
if (!args) args = { };
args['ids'] = torrent_ids;
var o = {
method: method,
arguments: { ids: torrent_ids }
arguments: args
};
this.sendRequest( o, function( data ) {
@@ -165,6 +167,10 @@ TransmissionRemote.prototype =
});
},
sendTorrentActionRequests: function( method, torrent_ids, callback ) {
this.sendTorrentSetRequests( method, torrent_ids, null, callback );
},
startTorrents: function( torrent_ids, callback ) {
this.sendTorrentActionRequests( 'torrent-start', torrent_ids, callback );
},
@@ -217,5 +223,11 @@ TransmissionRemote.prototype =
this.sendRequest( o, function() {
remote._controller.loadDaemonPrefs();
} );
},
filesSelectAll: function( torrent_ids, files, callback ) {
this.sendTorrentSetRequests( 'torrent-set', torrent_ids, { 'files-wanted': files }, callback );
},
filesDeselectAll: function( torrent_ids, files, callback ) {
this.sendTorrentSetRequests( 'torrent-set', torrent_ids, { 'files-unwanted': files }, callback );
}
};