Changeset 7881
- Timestamp:
- Feb 12, 2009, 5:20:43 PM (13 years ago)
- Location:
- trunk/web
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/index.html
r7762 r7881 31 31 <li id="open"><div id="open_link"><div class="toolbar_image"></div>Open</div></li> 32 32 <li id="remove" class="disabled"><div id="remove_link"><div class="toolbar_image"></div>Remove</div></li> 33 <li id="removedata" class="disabled"><div id="removedata_link"><div class="toolbar_image"></div>Remove Data</div></li> 33 34 <li class="divider"> </li> 34 35 <li id="pause_selected" class="disabled"><div id="pause_selected_link"><div class="toolbar_image"></div>Pause</div></li> … … 348 349 <li id="context_resume_selected" class="disabled context_resume_selected">Resume Selected</li> 349 350 <li id="context_remove">Remove From List...</li> 351 <li id="context_removedata">Delete Data And Remove From List...</li> 350 352 <li id="context_toggle_inspector">Show Inspector</li> 351 353 <li class="separator"></li> -
trunk/web/javascript/menu.js
r6318 r7881 12 12 13 13 menu_style: { 14 width: ' 210px',14 width: '310px', 15 15 backgroundColor: '#fff', 16 16 border: 'none', -
trunk/web/javascript/transmission.js
r7762 r7881 47 47 $('#resume_selected_link').bind('click', this.startSelectedClicked); 48 48 $('#remove_link').bind('click', this.removeClicked); 49 $('#removedata_link').bind('click', this.removeDataClicked); 49 50 $('#filter_all_link').parent().bind('click', this.showAllClicked); 50 51 $('#filter_downloading_link').parent().bind('click', this.showDownloadingClicked); … … 198 199 transmission.removeSelectedTorrents( ); 199 200 }, 201 contextRemoveDataSelected: function( ) { 202 transmission.removeSelectedTorrentsAndData( ); 203 }, 200 204 contextToggleInspector: function( ) { 201 205 transmission.toggleInspector( ); … … 217 221 context_resume_selected: this.contextStartSelected, 218 222 context_remove: this.contextRemoveSelected, 223 context_removedata: this.contextRemoveDataSelected, 219 224 context_toggle_inspector: this.contextToggleInspector, 220 225 context_select_all: this.contextSelectAll, … … 544 549 if( tr.isButtonEnabled( event ) ) { 545 550 tr.removeSelectedTorrents( ); 551 tr.hideiPhoneAddressbar( ); 552 } 553 }, 554 555 removeDataClicked: function( event ) { 556 var tr = transmission; 557 if( tr.isButtonEnabled( event ) ) { 558 tr.removeSelectedTorrentsAndData( ); 546 559 tr.hideiPhoneAddressbar( ); 547 560 } … … 1188 1201 }, 1189 1202 1203 removeSelectedTorrentsAndData: function() { 1204 var torrents = this.getSelectedTorrents( ); 1205 if( torrents.length ) 1206 this.promptToRemoveTorrentsAndData( torrents ); 1207 }, 1208 1190 1209 promptToRemoveTorrents:function( torrents ) 1191 1210 { … … 1205 1224 }, 1206 1225 1226 promptToRemoveTorrentsAndData:function( torrents ) 1227 { 1228 if( torrents.length == 1 ) 1229 { 1230 var torrent = torrents[0], 1231 header = 'Remove ' + torrent.name() + ' and delete data?', 1232 message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?'; 1233 dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents ); 1234 } 1235 else 1236 { 1237 var header = 'Remove ' + torrents.length + ' transfers and delete data?', 1238 message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?'; 1239 dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents ); 1240 } 1241 }, 1242 1207 1243 removeTorrents: function( torrents ) { 1208 1244 this.remote.removeTorrents( torrents ); 1245 }, 1246 1247 removeTorrentsAndData: function( torrents ) { 1248 this.remote.removeTorrentsAndData( torrents ); 1209 1249 }, 1210 1250 … … 1337 1377 this.setEnabled( 'li.context_resume_selected', havePausedSelection ); 1338 1378 this.setEnabled( 'li#remove', haveSelection ); 1379 this.setEnabled( 'li#removedata', haveSelection ); 1339 1380 this.setEnabled( 'li#pause_all', haveActive ); 1340 1381 this.setEnabled( 'li#resume_all', havePaused ); -
trunk/web/javascript/transmission.remote.js
r7762 r7881 122 122 this.sendTorrentCommand( 'torrent-remove', torrents ); 123 123 }, 124 removeTorrentsAndData: function( torrents ) { 125 var remote = this, 126 o = { }; 127 o.method = 'torrent-remove'; 128 o.arguments = { }; 129 o.arguments['delete-local-data'] = true; 130 o.arguments.ids = [ ]; 131 if( torrents != null ) 132 for( var i=0, len=torrents.length; i<len; ++i ) 133 o.arguments.ids.push( torrents[i].id() ); 134 this.sendRequest( RPC._Root, $.toJSON(o), function( ) { 135 remote.loadTorrents(); 136 }, "json" ); 137 }, 124 138 addTorrentByUrl: function( url, options ) { 125 139 this.sendRequest( RPC._Root, $.toJSON({ -
trunk/web/stylesheets/common.css
r7762 r7881 114 114 } 115 115 116 li#removedata div div.toolbar_image, li#removedata.disabled div:active div.toolbar_image { 117 background-position: left -32px; 118 } 119 116 120 li#remove div:active div.toolbar_image { 121 background-position: right -32px; 122 } 123 124 li#removedata div:active div.toolbar_image { 117 125 background-position: right -32px; 118 126 }
Note: See TracChangeset
for help on using the changeset viewer.