(trunk) all this commit does is remove trailing whitespace from some c, c++, and javascript source

This commit is contained in:
Charles Kerr
2009-08-12 14:40:32 +00:00
parent 6f547956a4
commit bf1a544939
27 changed files with 96 additions and 98 deletions

View File

@@ -25,7 +25,7 @@ function testSafari3()
var toInt = parseInt(version[i]);
var versionField = isNaN(toInt) ? 0 : toInt;
var minimumField = minimum[i];
if (versionField > minimumField) return true;
if (versionField < minimumField) return false;
}
@@ -108,7 +108,7 @@ function setInnerHTML( e, html )
};
/*
* Converts file & folder byte size values to more
* Converts file & folder byte size values to more
* readable values (bytes, KB, MB, GB or TB).
*
* @param integer bytes
@@ -117,24 +117,24 @@ function setInnerHTML( e, html )
Math.formatBytes = function(bytes) {
var size;
var unit;
// Terabytes (TB).
if ( bytes >= 1099511627776 ) {
if ( bytes >= 1099511627776 ) {
size = bytes / 1099511627776;
unit = ' TB';
unit = ' TB';
// Gigabytes (GB).
} else if ( bytes >= 1073741824 ) {
} else if ( bytes >= 1073741824 ) {
size = bytes / 1073741824;
unit = ' GB';
// Megabytes (MB).
} else if ( bytes >= 1048576 ) {
} else if ( bytes >= 1048576 ) {
size = bytes / 1048576;
unit = ' MB';
// Kilobytes (KB).
} else if ( bytes >= 1024 ) {
} else if ( bytes >= 1024 ) {
size = bytes / 1024;
unit = ' KB';
@@ -145,12 +145,12 @@ Math.formatBytes = function(bytes) {
}
// Single-digit numbers have greater precision
var precision = 1;
var precision = 1;
if (size < 10) {
precision = 2;
}
size = Math.roundWithPrecision(size, precision);
// Add the decimal if this is an integer
if ((size % 1) == 0 && unit != ' bytes') {
size = size + '.0';
@@ -172,14 +172,14 @@ Math.formatSeconds = function(seconds)
var days = Math.floor(seconds / 86400);
var hours = Math.floor((seconds % 86400) / 3600);
var minutes = Math.floor((seconds % 3600) / 60);
var seconds = Math.floor((seconds % 3600) % 60);
var seconds = Math.floor((seconds % 3600) % 60);
if (days > 0 && hours == 0)
result = days + ' days';
else if (days > 0 && hours > 0)
result = days + ' days ' + hours + ' hr';
else if (hours > 0 && minutes == 0)
result = hours + ' hr';
result = hours + ' hr';
else if (hours > 0 && minutes > 0)
result = hours + ' hr ' + minutes + ' min';
else if (minutes > 0 && seconds == 0)
@@ -187,7 +187,7 @@ Math.formatSeconds = function(seconds)
else if (minutes > 0 && seconds > 0)
result = minutes + ' min ' + seconds + ' seconds';
else
result = seconds + ' seconds';
result = seconds + ' seconds';
return result;
};
@@ -205,7 +205,7 @@ Math.formatTimestamp = function(seconds) {
};
/*
* Round a float to a specified number of decimal
* Round a float to a specified number of decimal
* places, stripping trailing zeroes
*
* @param float floatnum

View File

@@ -9,7 +9,7 @@
function Dialog(){
this.initialize();
}
Dialog.prototype = {
/*
@@ -36,11 +36,11 @@ Dialog.prototype = {
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
hideDialog: function( )
@@ -69,11 +69,11 @@ Dialog.prototype = {
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
/*
* Display a confirm dialog
*/
@@ -102,7 +102,7 @@ Dialog.prototype = {
setTimeout("$('div#dialog_container div.dialog_window').css('top', '0px');",10);
}
},
/*
* Display an alert dialog
*/

View File

@@ -8,7 +8,7 @@
function Torrent( transferListParent, fileListParent, controller, data) {
this.initialize( transferListParent, fileListParent, controller, data);
}
}
// Constants
Torrent._StatusWaitingToCheck = 1;
@@ -151,9 +151,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* S E T T E R S / G E T T E R S
*
*
*--------------------------------------------*/
/* Return the DOM element for this torrent (a <LI> element) */
@@ -226,9 +226,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
/*
@@ -298,9 +298,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
refresh: function(data) {

View File

@@ -5,17 +5,17 @@
*
* Class Transmission
*/
function Transmission(){
this.initialize();
}
}
Transmission.prototype =
{
/*--------------------------------------------
*
*
* C O N S T R U C T O R
*
*
*--------------------------------------------*/
initialize: function()
@@ -162,7 +162,7 @@ Transmission.prototype =
for( var i=0, row; row=arguments[i]; ++i )
jQuery("<img>").attr("src", row);
},
/*
* Set up the preference validation
*/
@@ -179,7 +179,7 @@ Transmission.prototype =
}
});
},
/*
* Load the clutch prefs and init the GUI according to those prefs
*/
@@ -260,7 +260,7 @@ Transmission.prototype =
contextDeselectAll: function( ) {
this.deselectAll( true );
},
/*
* Create the torrent right-click menu
*/
@@ -288,13 +288,13 @@ Transmission.prototype =
boundingElement: $('div#torrent_container'),
boundingRightPad: 20,
boundingBottomPad: 5,
onContextMenu: function(e) {
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
return true;
onContextMenu: function(e) {
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
return true;
}
});
},
/*
* Create the footer settings menu
*/
@@ -309,12 +309,12 @@ Transmission.prototype =
$('#unlimited_download_rate').selectMenuItem();
$('#unlimited_upload_rate').selectMenuItem();
},
/*--------------------------------------------
*
*
* U T I L I T I E S
*
*
*--------------------------------------------*/
getAllTorrents: function()
@@ -404,9 +404,9 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* S E L E C T I O N
*
*
*--------------------------------------------*/
setSelectedTorrent: function( torrent, doUpdate ) {
@@ -486,11 +486,11 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
/*
* Process key event
*/
@@ -521,7 +521,7 @@ Transmission.prototype =
tr.selectRow( i, true );
}
},
isButtonEnabled: function(e) {
var p = e.target ? e.target.parentNode : e.srcElement.parentNode;
return p.className!='disabled' && p.parentNode.className!='disabled';
@@ -640,7 +640,7 @@ Transmission.prototype =
// Select the clicked tab, unselect the others,
// and display the appropriate info
var tab_ids = $(tab).parent('#inspector_tabs').find('.inspector_tab').map(
function() { return $(this).attr('id'); }
function() { return $(this).attr('id'); }
);
for( var i=0, row; row=tab_ids[i]; ++i ) {
if (tab.id == row) {
@@ -733,11 +733,11 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
showPrefsDialog: function( ) {
$('body').addClass('prefs_showing');
$('#prefs_container').show();
@@ -761,7 +761,7 @@ Transmission.prototype =
}
this.updateButtonStates( );
},
/*
* Process got some new session data from the server
*/
@@ -798,7 +798,7 @@ Transmission.prototype =
$(key).deselectMenuSiblings().selectMenuItem();
}
},
setSearch: function( search ) {
this._current_search = search ? search.trim() : null;
this.refilter( );
@@ -869,7 +869,7 @@ Transmission.prototype =
tr.remote.savePrefs( args );
break;
// Sort the torrent list
// Sort the torrent list
case 'footer_sort_menu':
// The 'reverse sort' option state can be toggled independently of the other options
@@ -905,7 +905,7 @@ Transmission.prototype =
{
this._last_torrent_clicked = torrent;
},
/*
* Update the inspector with the latest data for the selected torrents
*/
@@ -1023,7 +1023,7 @@ Transmission.prototype =
var tracker = t._tracker;
if( total_tracker == null )
total_tracker = tracker;
else if ( total_tracker.search ( tracker ) == -1 )
else if ( total_tracker.search ( tracker ) == -1 )
total_tracker += ', ' + tracker;
if( t._is_private )
have_private = true;
@@ -1074,7 +1074,7 @@ Transmission.prototype =
jQuery.each( this.getDeselectedTorrents(), function() { this.hideFileList(); } );
}
},
/*
* Toggle the visibility of the inspector (used by the context menu)
*/
@@ -1102,7 +1102,7 @@ Transmission.prototype =
this.setPref( Prefs._ShowInspector, true );
this.updateInspector( );
},
/*
* Hide the inspector
*/
@@ -1263,7 +1263,7 @@ Transmission.prototype =
row.toggleClass('even', isEven);
}
},
updateStatusbar: function()
{
var torrents = this.getAllTorrents();
@@ -1296,7 +1296,7 @@ Transmission.prototype =
if( iPhone ) s = 'DL: ' + s;
setInnerHTML( $('#torrent_global_download')[0], s );
},
/*
* Select a torrent file to upload
* FIXME
@@ -1306,7 +1306,7 @@ Transmission.prototype =
// Display the upload dialog
if (! confirmed) {
$('input#torrent_upload_file').attr('value', '');
$('input#torrent_upload_url').attr('value', '');
$('input#torrent_upload_url').attr('value', '');
$('#upload_container').show();
if (!iPhone && Safari3) {
setTimeout("$('div#upload_container div.dialog_window').css('top', '0px');",10);
@@ -1333,7 +1333,7 @@ Transmission.prototype =
}
}
},
removeSelectedTorrents: function() {
var torrents = this.getSelectedTorrents( );
if( torrents.length )
@@ -1355,7 +1355,7 @@ Transmission.prototype =
var message = 'Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?';
dialog.confirm( header, message, 'Remove', 'transmission.removeTorrents', torrents );
}
else
else
{
var header = 'Remove ' + torrents.length + ' transfers?';
var message = 'Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?';
@@ -1372,7 +1372,7 @@ Transmission.prototype =
message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?';
dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents );
}
else
else
{
var header = 'Remove ' + torrents.length + ' transfers and delete data?',
message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?';
@@ -1416,7 +1416,7 @@ Transmission.prototype =
var tr = this;
this.remote.verifyTorrents( torrent_ids, function(){ tr.refreshTorrents(torrent_ids) } );
},
stopSelectedTorrents: function( ) {
this.stopTorrents( this.getSelectedTorrents( ) );
},

View File

@@ -59,8 +59,8 @@ TransmissionRemote.prototype =
if( !remote._error.length )
remote._error = 'Server not responding';
dialog.confirm('Connection Failed',
'Could not connect to the server. You may need to reload the page to reconnect.',
dialog.confirm('Connection Failed',
'Could not connect to the server. You may need to reload the page to reconnect.',
'Details',
'alert(remote._error);',
null,