(web) fix whitepsaces

This commit is contained in:
Daniel Lee 2010-06-21 13:14:33 +00:00
parent 99318552eb
commit ad9814612d
11 changed files with 254 additions and 262 deletions

View File

@ -12,8 +12,8 @@
<link media="only screen and (max-device-width: 480px)" href="./stylesheets/iphone.css" type= "text/css" rel="stylesheet" />
<link media="screen and (min-device-width: 481px)" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
<!--[if IE]>
<link media="screen" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
<link media="screen" href="./stylesheets/ieAll.css" type="text/css" rel="stylesheet" />
<link media="screen" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
<link media="screen" href="./stylesheets/ieAll.css" type="text/css" rel="stylesheet" />
<![endif]-->
<!--[if IE 6]><link media="screen" href="./stylesheets/ie6.css" type="text/css" rel="stylesheet" /><![endif]-->
<!--[if IE 7]><link media="screen" href="./stylesheets/ie7.css" type="text/css" rel="stylesheet" /><![endif]-->
@ -33,38 +33,39 @@
<body id="transmission_body">
<div class="torrent_global_menu">
<ul>
<li id="open"><div id="open_link"><div class="toolbar_image"></div>Open</div></li>
<li id="remove" class="disabled"><div id="remove_link"><div class="toolbar_image"></div>Remove</div></li>
<li class="divider">&nbsp;</li>
<li id="pause_selected" class="disabled"><div id="pause_selected_link"><div class="toolbar_image"></div>Pause</div></li>
<li id="resume_selected" class="disabled"><div id="resume_selected_link"><div class="toolbar_image"></div>Resume</div></li>
<li class="divider">&nbsp;</li>
<li id="pause_all" class="disabled"><div id="pause_all_link"><div class="toolbar_image"></div>Pause All</div></li>
<li id="resume_all" class="disabled"><div id="resume_all_link"><div class="toolbar_image"></div>Resume All</div></li>
<li id="inspector"><div id="inspector_link"><div class="toolbar_image"></div>Inspector</div></li>
<li id="filter"><div id="filter_toggle_link"><div class="toolbar_image"></div>Filter</div></li>
</ul>
<ul>
<li id="open"><div id="open_link"><div class="toolbar_image"></div>Open</div></li>
<li id="remove" class="disabled"><div id="remove_link"><div class="toolbar_image"></div>Remove</div></li>
<li class="divider">&nbsp;</li>
<li id="pause_selected" class="disabled"><div id="pause_selected_link"><div class="toolbar_image"></div>Pause</div></li>
<li id="resume_selected" class="disabled"><div id="resume_selected_link"><div class="toolbar_image"></div>Resume</div></li>
<li class="divider">&nbsp;</li>
<li id="pause_all" class="disabled"><div id="pause_all_link"><div class="toolbar_image"></div>Pause All</div></li>
<li id="resume_all" class="disabled"><div id="resume_all_link"><div class="toolbar_image"></div>Resume All</div></li>
<li id="inspector"><div id="inspector_link"><div class="toolbar_image"></div>Inspector</div></li>
<li id="filter"><div id="filter_toggle_link"><div class="toolbar_image"></div>Filter</div></li>
</ul>
</div>
<div class="torrent_global_details">
<div id="torrent_global_transfer">0 Transfers</div>
<div id="torrent_global_upload">0 B/s</div>
<div id="torrent_global_download">0 B/s</div>
</div>
<div id="torrent_filter_bar">
<ul>
<li><a href="#all" id="filter_all_link" class="active">All</a></li>
<li><a href="#active" id="filter_active_link">Active</a></li>
<li><a href="#downloading" id="filter_downloading_link">Downloading</a></li>
<li><a href="#seeding" id="filter_seeding_link">Seeding</a></li>
<li><a href="#paused" id="filter_paused_link">Paused</a></li>
<ul>
<li><a href="#all" id="filter_all_link" class="active">All</a></li>
<li><a href="#active" id="filter_active_link">Active</a></li>
<li><a href="#downloading" id="filter_downloading_link">Downloading</a></li>
<li><a href="#seeding" id="filter_seeding_link">Seeding</a></li>
<li><a href="#paused" id="filter_paused_link">Paused</a></li>
</ul>
<input type="search" id="torrent_search" placeholder="Filter" results="0" />
<input type="search" id="torrent_search" placeholder="Filter" results="0" />
</div>
<div id="torrent_inspector" style="display:none;">
<div style="display:none;" class="inspector_close" id="inspector_close"><img id="inspector_close_image" src="./images/buttons/cancel.png"/></div>
<div id="inspector_tabs">
@ -74,12 +75,12 @@
<div class="inspector_tab" id="inspector_tab_trackers"><a href="#trackers"><img src="images/buttons/info_trackers.png" alt="Trackers"/></a></div>
<div class="inspector_tab" id="inspector_tab_files"><a href="#files"><img src="images/buttons/info_files.png" alt="Files"/></a></div>
</div>
<div id="inspector_header">
<h1 id="torrent_inspector_name"></h1>
<span id="torrent_inspector_size"></span>
</div>
<div class="inspector_container" id="inspector_tab_info_container">
<div class="inspector_group">
<div class="inspector_group_label">Information</div>
@ -100,7 +101,7 @@
<div id="torrent_inspector_comment"></div>
</div>
</div><!-- class="inspector_group"-->
<div class="inspector_group">
<div class="inspector_group_label">Created By</div>
<div class="inspector_row">
@ -121,7 +122,7 @@
</div>
</div><!-- class="inspector_group"-->
</div><!-- id="inspector_tab_info_container" -->
<div style="display:none;" class="inspector_container" id="inspector_tab_activity_container">
<div class="inspector_group">
@ -167,7 +168,7 @@
<div id="torrent_inspector_upload_speed">N/A</div>
</div>
</div><!-- class="inspector_group"-->
<div class="inspector_group">
<div class="inspector_group_label">Peers</div>
<div class="inspector_row">
@ -201,13 +202,11 @@
</div><!-- id="inspector_tab_files_container" -->
</div>
<div id="torrent_container">
<ul class="torrent_list" id="torrent_list"><li style="display: none;"></li></ul>
</div>
<div class="dialog_container" id="dialog_container" style="display:none;">
<div class="dialog_top_bar"></div>
<div class="dialog_window">
@ -215,10 +214,10 @@
<h2 class="dialog_heading" id="dialog_heading"></h2>
<div class="dialog_message" id="dialog_message"></div>
<a href="#confirm" id="dialog_confirm_button">Confirm</a>
<a href="#cancel" id="dialog_cancel_button">Cancel</a>
</div>
<a href="#cancel" id="dialog_cancel_button">Cancel</a>
</div>
</div>
<div class="dialog_container" id="prefs_container" style="display:none;">
<div class="dialog_top_bar"></div>
<div class="dialog_window">
@ -381,14 +380,14 @@
<a href="#close" id="stats_close_button">Close</a>
</div>
</div>
<div class="dialog_container" id="upload_container" style="display:none;">
<div class="dialog_top_bar"></div>
<div class="dialog_window">
<img src="images/graphics/logo.png" alt="Transmission Logo" />
<h2 class="dialog_heading">Upload Torrent Files</h2>
<form action="#" method="post" id="torrent_upload_form"
enctype="multipart/form-data" target="torrent_upload_frame">
<form action="#" method="post" id="torrent_upload_form"
enctype="multipart/form-data" target="torrent_upload_frame">
<div class="dialog_message">
<label for="torrent_upload_file">Please select a torrent file to upload:</label>
<input type="file" name="torrent_files[]" id="torrent_upload_file" multiple="multiple" />
@ -402,8 +401,9 @@
</form>
</div>
</div>
<div class="torrent_footer">
<div id="disk_space_container"></div>
<div class="torrent_footer">
<div id="disk_space_container"></div>
<ul id="settings_menu">
<li id="button">&nbsp;
<ul id="footer_super_menu">
@ -471,8 +471,8 @@
<div id="turtle_button">&nbsp;</div>
<div style="clear: both; visibility: hidden;"></div>
</div>
<div class="contextMenu" id="torrent_context_menu">
<div class="contextMenu" id="torrent_context_menu">
<ul>
<li id="context_pause_selected" class="disabled context_pause_selected">Pause Selected</li>
<li id="context_resume_selected" class="disabled context_resume_selected">Resume Selected</li>
@ -488,7 +488,7 @@
<li id="context_deselect_all" class="context_deselect_all">Deselect All</li>
</ul>
</div>
<iframe name="torrent_upload_frame" id="torrent_upload_frame" src="about:blank" ></iframe>
</body>
</html>

View File

@ -17,39 +17,39 @@ if (iPhone) var scroll_timeout;
function testSafari3()
{
var minimum = new Array(521,0);
var webKitFields = RegExp("( AppleWebKit/)([^ ]+)").exec(navigator.userAgent);
if (!webKitFields || webKitFields.length < 3) return false;
var version = webKitFields[2].split(".");
for (var i = 0; i < minimum.length; i++) {
var toInt = parseInt(version[i]);
var versionField = isNaN(toInt) ? 0 : toInt;
var minimumField = minimum[i];
var minimum = new Array(521,0);
var webKitFields = RegExp("( AppleWebKit/)([^ ]+)").exec(navigator.userAgent);
if (!webKitFields || webKitFields.length < 3) return false;
var version = webKitFields[2].split(".");
for (var i = 0; i < minimum.length; i++) {
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;
}
return true;
if (versionField > minimumField) return true;
if (versionField < minimumField) return false;
}
return true;
};
$(document).ready( function() {
// Initialise the dialog controller
dialog = new Dialog();
// Initialise the main Transmission controller
transmission = new Transmission();
// IE specific fixes here
if ($.browser.msie) {
try {
document.execCommand("BackgroundImageCache", false, true);
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
$('.dialog_container').css('height',$(window).height()+'px');
}
if ($.browser.safari) {
// Move search field's margin down for the styled input
$('#torrent_search').css('margin-top', 3);
$('#torrent_search').css('margin-top', 3);
}
if (!Safari3 && !iPhone) {
// Fix for non-Safari-3 browsers: dark borders to replace shadows.
@ -116,7 +116,7 @@ function setInnerHTML( e, html )
* @returns float
*/
Math.roundWithPrecision = function(floatnum, precision) {
return Math.round ( floatnum * Math.pow ( 10, precision ) ) / Math.pow ( 10, precision );
return Math.round ( floatnum * Math.pow ( 10, precision ) ) / Math.pow ( 10, precision );
};
@ -150,9 +150,9 @@ String.prototype.trim = function () {
*/
String.prototype.compareTo = function( that ) {
// FIXME: how to fold these two comparisons together?
if( this < that ) return -1;
if( this > that ) return 1;
return 0;
if( this < that ) return -1;
if( this > that ) return 1;
return 0;
}
/**
@ -187,7 +187,7 @@ function Prefs() { }
Prefs.prototype = { };
Prefs._RefreshRate = 'refresh_rate';
Prefs._SessionRefreshRate = 'session_refresh_rate';
Prefs._SessionRefreshRate = 'session_refresh_rate';
Prefs._ShowFilter = 'show_filter';
@ -255,8 +255,8 @@ Prefs.getValue = function( key, fallback )
if( Prefs._Defaults[key] == undefined )
console.warn( "unrecognized preference key '%s'", key );
var lines = document.cookie.split( ';' );
for( var i=0, len=lines.length; !val && i<len; ++i ) {
var lines = document.cookie.split( ';' );
for( var i=0, len=lines.length; !val && i<len; ++i ) {
var line = lines[i].trim( );
var delim = line.indexOf( '=' );
if( ( delim == key.length ) && line.indexOf( key ) == 0 )

View File

@ -7,16 +7,16 @@
*/
function Dialog(){
this.initialize();
this.initialize();
}
Dialog.prototype = {
/*
* Constructor
*/
initialize: function() {
/*
* Constructor
*/
initialize: function() {
/*
* Private Interface Variables
*/
@ -27,21 +27,17 @@ Dialog.prototype = {
this._confirm_button = $('#dialog_confirm_button');
this._callback_function = '';
this._callback_data = null;
// Observe the buttons
this._cancel_button.bind('click', {dialog: this}, this.onCancelClicked );
this._confirm_button.bind('click', {dialog: this}, this.onConfirmClicked );
},
/*--------------------------------------------
*
* E V E N T F U N C T I O N S
*
*--------------------------------------------*/
/*--------------------------------------------
*
* E V E N T F U N C T I O N S
*
*--------------------------------------------*/
hideDialog: function( )
{
@ -68,16 +64,16 @@ Dialog.prototype = {
dialog.hideDialog( );
},
/*--------------------------------------------
*
* I N T E R F A C E F U N C T I O N S
*
*--------------------------------------------*/
/*--------------------------------------------
*
* I N T E R F A C E F U N C T I O N S
*
*--------------------------------------------*/
/*
* Display a confirm dialog
*/
confirm: function(dialog_heading, dialog_message, confirm_button_label, callback_function, callback_data, cancel_button_label) {
/*
* Display a confirm dialog
*/
confirm: function(dialog_heading, dialog_message, confirm_button_label, callback_function, callback_data, cancel_button_label) {
if (!iPhone && Safari3) {
$('div#upload_container div.dialog_window').css('top', '-205px');
$('div#prefs_container div.dialog_window').css('top', '-425px');
@ -102,11 +98,11 @@ Dialog.prototype = {
setTimeout("$('div#dialog_container div.dialog_window').css('top', '0px');",10);
}
},
/*
* Display an alert dialog
*/
alert: function(dialog_heading, dialog_message, cancel_button_label) {
/*
* Display an alert dialog
*/
alert: function(dialog_heading, dialog_message, cancel_button_label) {
if (!iPhone && Safari3) {
$('div#upload_container div.dialog_window').css('top', '-205px');
$('div#prefs_container div.dialog_window').css('top', '-425px');
@ -142,6 +138,6 @@ Dialog.prototype = {
this._container.show();
}
}
}

View File

@ -137,16 +137,16 @@ Transmission.fmt = (function()
hours = 12;
}
if(hours < 10){
hours = "0" + hours;
}
var minutes = myDate.getMinutes();
if(minutes < 10){
minutes = "0" + minutes;
}
var seconds = myDate.getSeconds();
if(seconds < 10){
seconds = "0" + seconds;
}
hours = "0" + hours;
}
var minutes = myDate.getMinutes();
if(minutes < 10){
minutes = "0" + minutes;
}
var seconds = myDate.getSeconds();
if(seconds < 10){
seconds = "0" + seconds;
}
time = [hours, minutes, seconds].join(':');

View File

@ -7,16 +7,16 @@
*/
Menu = {
context: {
menu_style: {
width: '310px',
backgroundColor: '#fff',
border: 'none',
padding: '5px 0',
textAlign: 'left'},
item_style: {
backgroundColor: 'transparent',
margin: '0',
@ -25,12 +25,12 @@ Menu = {
fontSize: '14px',
cursor: 'default',
border: 'none'},
item_hover_style: {
backgroundColor: '#24e',
color: '#fff',
border: 'none'},
item_disabled_style: {
backgroundColor: 'transparent',
margin: '0',
@ -40,6 +40,6 @@ Menu = {
cursor: 'default',
border: 'none'}
}
}
}

View File

@ -94,13 +94,13 @@ Torrent.prototype =
this._element = element;
this._controller = controller;
controller._rows.push( element );
// Create the 'name' <div>
var e = document.createElement( 'div' );
e.className = 'torrent_name';
top_e.appendChild( e );
element._name_container = e;
// Create the 'peer details' <div>
e = document.createElement( 'div' );
e.className = 'torrent_peer_details';
@ -118,14 +118,14 @@ Torrent.prototype =
e.style.width = '0%';
top_a.appendChild( e );
element._progress_complete_container = e;
// Create the 'incomplete' bar (initially hidden)
e = document.createElement( 'div' );
e.className = 'torrent_progress_bar incomplete';
e.style.display = 'none';
top_a.appendChild( e );
element._progress_incomplete_container = e;
//Add the progress bar container to the torrent
top_e.appendChild(top_a);
@ -145,10 +145,10 @@ Torrent.prototype =
e.className = 'torrent_progress_details';
top_e.appendChild( e );
element._progress_details_container = e;
// Set the torrent click observer
element.bind('click', function(e){ element._torrent.clickTorrent(e) });
// Safari hack - first torrent needs to be moved down for some reason. Seems to be ok when
// using <li>'s in straight html, but adding through the DOM gets a bit odd.
if ($.browser.safari)
@ -158,11 +158,11 @@ Torrent.prototype =
// Update all the labels etc
this.refresh(data);
// insert the element
transferListParent.appendChild(top_e);
},
initializeTorrentFilesInspectorGroup: function( fileListParent ) {
var e = document.createElement( 'ul' );
e.className = 'inspector_torrent_file_list inspector_group';
@ -170,11 +170,11 @@ Torrent.prototype =
fileListParent.appendChild( e );
this._fileList = e;
},
fileList: function() {
return $(this._fileList);
},
buildTrackerStats: function(trackerStats) {
result = [];
for( var i=0, tracker; tracker=trackerStats[i]; ++i ) {
@ -208,7 +208,7 @@ 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) */
element: function() {
return this._element;
@ -255,8 +255,7 @@ Torrent.prototype =
switch( this.state() ) {
case Torrent._StatusSeeding: return 'Seeding';
case Torrent._StatusDownloading: return 'Downloading';
case Torrent._StatusPaused: return this._isFinishedSeeding ? 'Seeding complete'
: 'Paused';
case Torrent._StatusPaused: return this._isFinishedSeeding ? 'Seeding complete' : 'Paused';
case Torrent._StatusChecking: return 'Verifying local data';
case Torrent._StatusWaitingToCheck: return 'Waiting to verify';
default: return 'error';
@ -280,13 +279,13 @@ Torrent.prototype =
default: return -1;
}
},
/*--------------------------------------------
*
* E V E N T F U N C T I O N S
*
*--------------------------------------------*/
/*
* Process a click event on this torrent
*/
@ -299,7 +298,7 @@ Torrent.prototype =
$('#jqContextMenu').hide();
var torrent = this;
// 'Apple' button emulation on PC :
// Need settable meta-key and ctrl-key variables for mac emulation
var meta_key = event.metaKey;
@ -308,35 +307,35 @@ Torrent.prototype =
meta_key = true;
ctrl_key = false;
}
// Shift-Click - Highlight a range between this torrent and the last-clicked torrent
if (iPhone) {
if ( torrent.isSelected() )
torrent._controller.showInspector();
torrent._controller.setSelectedTorrent( torrent, true );
} else if (event.shiftKey) {
torrent._controller.selectRange( torrent, true );
// Need to deselect any selected text
window.focus();
// Apple-Click, not selected
} else if (!torrent.isSelected() && meta_key) {
torrent._controller.selectTorrent( torrent, true );
// Regular Click, not selected
} else if (!torrent.isSelected()) {
torrent._controller.setSelectedTorrent( torrent, true );
// Apple-Click, selected
// Apple-Click, selected
} else if (torrent.isSelected() && meta_key) {
torrent._controller.deselectTorrent( torrent, true );
// Regular Click, selected
} else if (torrent.isSelected()) {
torrent._controller.setSelectedTorrent( torrent, true );
}
torrent._controller.setLastTorrentClicked(torrent);
},
@ -368,7 +367,7 @@ Torrent.prototype =
this.refreshFileView();
this.refreshHTML( );
},
refresh: function(data) {
this.refreshData( data );
this.refreshHTML( );
@ -514,13 +513,13 @@ Torrent.prototype =
} else {
root._peer_details_container.style.display = 'block';
}
root._progress_details_container.className = 'torrent_progress_details'+compact
root._progress_bar_container.className = 'torrent_progress_bar_container'+compact;
root._name_container.className = 'torrent_name'+compact;
setInnerHTML( root._name_container, this._name );
// Add the progress bar
var notDone = this._leftUntilDone > 0;
@ -549,7 +548,7 @@ Torrent.prototype =
else if( notDone )
{
var eta = '';
if( this.isActive( ) )
{
eta = ' - ';
@ -558,7 +557,7 @@ Torrent.prototype =
else
eta += Transmission.fmt.timeInterval(this._eta) + ' remaining';
}
// Create the 'progress details' label
// Eg: '101 MiB of 631 MiB (16.02%) - 2 hr remaining'
c = Transmission.fmt.size( this._sizeWhenDone - this._leftUntilDone );
@ -569,10 +568,10 @@ Torrent.prototype =
c += '%)';
c += eta;
progress_details = c;
// Figure out the percent completed
var css_completed_width = Math.floor( this.getPercentDone() * 100 * MaxBarWidth ) / 100;
// Update the 'in progress' bar
e = root._progress_complete_container;
c = 'torrent_progress_bar'+compact;
@ -580,7 +579,7 @@ Torrent.prototype =
if(css_completed_width === 0) { c += ' empty'; }
e.className = c;
e.style.width = css_completed_width + '%';
// Update the 'incomplete' bar
e = root._progress_incomplete_container;
e.className = 'torrent_progress_bar incomplete'
@ -645,12 +644,12 @@ Torrent.prototype =
e = root._progress_complete_container;
e.className = 'torrent_progress_bar ' + status;
}
// Update the progress details
if(compact_mode)
progress_details = this.getPeerDetails();
setInnerHTML( root._progress_details_container, progress_details );
// Update the peer details and pause/resume button
e = root._pause_resume_button_image;
if ( this.state() === Torrent._StatusPaused ) {
@ -660,10 +659,10 @@ Torrent.prototype =
e.alt = 'Pause';
e.className = "torrent_pause"+compact;
}
setInnerHTML( root._peer_details_container, this.getPeerDetails( ) );
this.refreshFileView( );
this.refreshFileView( );
},
refreshFileView: function() {
@ -707,7 +706,7 @@ Torrent.prototype =
test: function( filter, search )
{
var pass = false;
switch( filter )
{
case Prefs._FilterActive:
@ -726,13 +725,13 @@ Torrent.prototype =
pass = true;
break;
}
if( !pass )
return false;
if( !search || !search.length )
return pass;
return this._name_lc.indexOf( search.toLowerCase() ) !== -1;
}
};
@ -802,10 +801,10 @@ Torrent.sortTorrents = function( torrents, sortMethod, sortDirection )
console.warn( "unknown sort method: " + sortMethod );
break;
}
if( sortDirection === Prefs._SortDescending )
torrents.reverse( );
return torrents;
};
@ -868,7 +867,7 @@ TorrentFile.prototype = {
li.appendChild(pri_div);
li.appendChild(file_div);
li.appendChild(prog_div);
this._element = li;
this._priority_control = pri_div;
this._progress = $(prog_div);
@ -886,7 +885,7 @@ TorrentFile.prototype = {
isEditable: function () {
return (this._torrent._file_model.length>1) && !this.isDone();
},
readAttributes: function(file_data) {
if( file_data.index !== undefined && file_data.index !== this._index ) {
this._index = file_data.index;
@ -909,15 +908,15 @@ TorrentFile.prototype = {
this._dirty = true;
}
},
element: function() {
return $(this._element);
},
domElement: function() {
return this._element;
},
setPriority: function(prio) {
if (this.isEditable()) {
var cmd;
@ -931,23 +930,23 @@ TorrentFile.prototype = {
this._torrent._controller.changeFileCommand( cmd, this._torrent, this );
}
},
setWanted: function(wanted, process) {
this._dirty = true;
this._wanted = wanted;
if(!iPhone)
this.element().toggleClass( 'skip', !wanted );
this.element().toggleClass( 'skip', !wanted );
if (process) {
var command = wanted ? 'files-wanted' : 'files-unwanted';
this._torrent._controller.changeFileCommand(command, this._torrent, this);
}
},
toggleWanted: function() {
if (this.isEditable())
this.setWanted( !this._wanted, true );
},
refreshHTML: function() {
if( this._dirty ) {
this._dirty = false;
@ -956,7 +955,7 @@ TorrentFile.prototype = {
this.refreshPriorityHTML();
}
},
refreshProgressHTML: function() {
var c = Transmission.fmt.size(this._done);
c += ' of ';
@ -966,7 +965,7 @@ TorrentFile.prototype = {
c += '%)';
setInnerHTML(this._progress[0], c);
},
refreshWantedHTML: function() {
var e = this.domElement();
var c = e.classNameConst;
@ -974,7 +973,7 @@ TorrentFile.prototype = {
if(this.isDone()) { c += ' complete'; }
e.className = c;
},
refreshPriorityHTML: function() {
var e = this._priority_control;
var c = e.classNameConst;
@ -985,11 +984,11 @@ TorrentFile.prototype = {
}
e.className = c;
},
fileWantedControlClicked: function(event) {
this.toggleWanted();
},
filePriorityControlClicked: function(event, element) {
var x = event.pageX;
while (element !== null) {

View File

@ -27,12 +27,12 @@ Transmission.prototype =
this._current_search = '';
this._torrents = { };
this._rows = [ ];
// Initialize the clutch preferences
Prefs.getClutchPrefs( this );
this.preloadImages();
// Set up user events
var tr = this;
$('#pause_all_link').bind('click', function(e){ tr.stopAllClicked(e); });
@ -68,7 +68,7 @@ Transmission.prototype =
$('#torrent_container').bind('click', function(e){ tr.deselectAll( true ); });
$('#filter_toggle_link').bind('click', function(e){ tr.toggleFilterClicked(e); });
$('#inspector_link').bind('click', function(e){ tr.toggleInspectorClicked(e); });
this.setupSearchBox();
this.createContextMenu();
this.createSettingsMenu();
@ -113,13 +113,13 @@ Transmission.prototype =
this._inspector._info_tab.uploaded = $(ti+'uploaded')[0];
this._inspector._info_tab.upload_speed = $(ti+'upload_speed')[0];
this._inspector._info_tab.upload_to = $(ti+'upload_to')[0];
// Setup the preference box
this.setupPrefConstraints();
// Setup the prefs gui
this.initializeSettings( );
// Get preferences & torrents from the daemon
var tr = this;
var async = false;
@ -210,14 +210,14 @@ Transmission.prototype =
// include transmenu js to save some bandwidth; if we
// start using prefs on iPhone we need to weed
// transmenu refs out of that too.
$('#filter_' + this[Prefs._FilterMode] + '_link').parent().addClass('selected');
if (!iPhone) $('#sort_by_' + this[Prefs._SortMethod] ).selectMenuItem();
if (!iPhone && ( this[Prefs._SortDirection] == Prefs._SortDescending ) )
$('#reverse_sort_order').selectMenuItem();
if( this[Prefs._ShowFilter] )
this.showFilter( );
@ -295,7 +295,7 @@ Transmission.prototype =
context_select_all: function(e){ tr.contextSelectAll(e); },
context_deselect_all: function(e){ tr.contextDeselectAll(e); }
};
// Setup the context menu
$('ul#torrent_list').contextMenu('torrent_context_menu', {
bindings: bindings,
@ -308,10 +308,10 @@ Transmission.prototype =
boundingRightPad: 20,
boundingBottomPad: 5,
onContextMenu: function(e) {
var closestRow = $(e.target).closest('.torrent')[0]._torrent;
if(!closestRow.isSelected())
tr.setSelectedTorrent( closestRow, true );
return true;
var closestRow = $(e.target).closest('.torrent')[0]._torrent;
if(!closestRow.isSelected())
tr.setSelectedTorrent( closestRow, true );
return true;
}
});
},
@ -326,7 +326,7 @@ Transmission.prototype =
direction: 'up',
onClick: function(e){ return tr.processSettingsMenuEvent(e); }
});
$('#unlimited_download_rate').selectMenuItem();
$('#unlimited_upload_rate').selectMenuItem();
},
@ -381,7 +381,7 @@ Transmission.prototype =
s.push( row );
return s;
},
getDeselectedTorrents: function() {
var visible_torrent_ids = jQuery.map(this.getVisibleTorrents(), function(t) { return t.id(); } );
var s = [ ];
@ -392,7 +392,7 @@ Transmission.prototype =
} );
return s;
},
getVisibleRows: function()
{
var rows = [ ];
@ -537,7 +537,7 @@ Transmission.prototype =
var sel = tr.getSelectedTorrents( );
var rows = tr.getVisibleRows( );
var i = -1;
if( event.keyCode == 40 ) // down arrow
{
var t = sel.length ? sel[sel.length-1] : null;
@ -639,7 +639,7 @@ Transmission.prototype =
tr.togglePeriodicRefresh( false );
tr.togglePeriodicRefresh( true );
}
// pass the new prefs upstream to the RPC server
var o = { };
o[RPC._StartAddedTorrent] = $('#prefs_form #auto_start')[0].checked;
@ -660,7 +660,7 @@ Transmission.prototype =
o[RPC._TurtleTimeDay] = parseInt( $('#prefs_form #turtle_days').val() );
tr.remote.savePrefs( o );
tr.hidePrefsDialog( );
},
@ -668,7 +668,7 @@ Transmission.prototype =
this.hideStatsDialog( );
},
removeClicked: function( event ) {
removeClicked: function( event ) {
var tr = this;
if( tr.isButtonEnabled( event ) ) {
tr.removeSelectedTorrents( );
@ -684,7 +684,7 @@ Transmission.prototype =
inspectorTabClicked: function(event, tab) {
if (iPhone) event.stopPropagation();
// Select the clicked tab, unselect the others,
// and display the appropriate info
var tab_ids = $(tab).parent('#inspector_tabs').find('.inspector_tab').map(
@ -700,7 +700,7 @@ Transmission.prototype =
}
}
this.hideiPhoneAddressbar();
this.updateVisibleFileLists();
this.updatePeersLists();
this.updateTrackersLists();
@ -780,7 +780,7 @@ Transmission.prototype =
this.setPref( Prefs._FilterMode, mode );
this.refilter( );
},
showAllClicked: function( event ) {
showAllClicked: function( event ) {
this.setFilter( Prefs._FilterAll );
},
showActiveClicked: function( event ) {
@ -789,7 +789,7 @@ Transmission.prototype =
showDownloadingClicked: function( event ) {
this.setFilter( Prefs._FilterDownloading );
},
showSeedingClicked: function(event) {
showSeedingClicked: function(event) {
this.setFilter( Prefs._FilterSeeding );
},
showPausedClicked: function(event) {
@ -954,7 +954,7 @@ Transmission.prototype =
var key = down_limited ? '#limited_download_rate'
: '#unlimited_download_rate';
$(key).deselectMenuSiblings().selectMenuItem();
setInnerHTML( $('#limited_download_rate')[0], 'Limit (' + Transmission.fmt.speed(up_limit) + ')' );
key = up_limited ? '#limited_upload_rate'
: '#unlimited_upload_rate';
@ -1034,10 +1034,10 @@ Transmission.prototype =
processSettingsMenuEvent: function(event) {
var tr = this;
var $element = $(event.target);
// Figure out which menu has been clicked
switch ($element.parent()[0].id) {
// Display the preferences dialog
case 'footer_super_menu':
if ($element[0].id == 'preferences') {
@ -1052,7 +1052,7 @@ Transmission.prototype =
}
else if ($element[0].id == 'compact_view') {
this[Prefs._CompactDisplayState] = !this[Prefs._CompactDisplayState];
if(this[Prefs._CompactDisplayState])
if(this[Prefs._CompactDisplayState])
$element.selectMenuItem();
else
$element.deselectMenuItem();
@ -1060,7 +1060,7 @@ Transmission.prototype =
// Redraw html here
}
break;
// Limit the download rate
case 'footer_download_rate_menu':
var args = { };
@ -1078,7 +1078,7 @@ Transmission.prototype =
$('div.preference input#limit_download')[0].checked = args[RPC._DownSpeedLimited];
tr.remote.savePrefs( args );
break;
// Limit the upload rate
case 'footer_upload_rate_menu':
var args = { };
@ -1096,13 +1096,13 @@ Transmission.prototype =
$('div.preference input#limit_upload')[0].checked = args[RPC._UpSpeedLimited];
tr.remote.savePrefs( args );
break;
// Sort the torrent list
case 'footer_sort_menu':
// The 'reverse sort' option state can be toggled independently of the other options
if ($element.is('#reverse_sort_order')) {
if(!$element.is('#reverse_sort_order.active')) break;
if(!$element.is('#reverse_sort_order.active')) break;
var dir;
if ($element.menuItemIsSelected()) {
$element.deselectMenuItem();
@ -1175,9 +1175,9 @@ Transmission.prototype =
var total_verified = 0;
var na = 'N/A';
var tab = this._inspector._info_tab;
$("#torrent_inspector_size, .inspector_row div").css('color', '#222');
if( torrents.length == 0 )
{
setInnerHTML( tab.name, 'No Selection' );
@ -1256,7 +1256,7 @@ Transmission.prototype =
var private_string = '';
if( have_private && have_public ) private_string = 'Mixed';
else if( have_private ) private_string = 'Private Torrent';
else if( have_public ) private_string = 'Public Torrent';
else if( have_public ) private_string = 'Public Torrent';
setInnerHTML( tab.name, name );
setInnerHTML( tab.size, torrents.length ? Transmission.fmt.size( total_size ) : na );
@ -1289,7 +1289,7 @@ Transmission.prototype =
fileListIsVisible: function() {
return this._inspector_tab_files.className.indexOf('selected') != -1;
},
updateVisibleFileLists: function() {
if( this.fileListIsVisible( ) === true ) {
var selected = this.getSelectedTorrents();
@ -1443,7 +1443,7 @@ Transmission.prototype =
else
this.showInspector( );
},
showInspector: function() {
$('#torrent_inspector').show();
if (iPhone) {
@ -1468,7 +1468,7 @@ Transmission.prototype =
hideInspector: function() {
$('#torrent_inspector').hide();
if (iPhone) {
this.deselectAll( );
$('body.inspector_showing').removeClass('inspector_showing');
@ -1479,10 +1479,10 @@ Transmission.prototype =
$('#torrent_container')[0].style.right = '0px';
setInnerHTML( $('ul li#context_toggle_inspector')[0], 'Show Inspector' );
}
this.setPref( Prefs._ShowInspector, false );
},
/*
* Toggle the visibility of the filter bar
*/
@ -1499,7 +1499,7 @@ Transmission.prototype =
$('#torrent_filter_bar').show();
this.setPref( Prefs._ShowFilter, true );
},
hideFilter: function()
{
var container_top = parseInt($('#torrent_container').css('top')) - $('#torrent_filter_bar').height() - 1;
@ -1533,7 +1533,7 @@ Transmission.prototype =
refreshTorrents: function(ids) {
var tr = this;
if (!ids)
ids = 'recently-active';
ids = 'recently-active';
this.remote.getUpdatedDataFor(ids, function(active, removed){ tr.updateTorrentsData(active, removed); });
},
@ -1545,12 +1545,12 @@ Transmission.prototype =
jQuery.each( updated, function() {
var t = tr._torrents[this.id];
if (t){
t.refresh(this);
if(t.isSelected())
refresh_files_for.push(t.id());
}
else
new_torrent_ids.push(this.id);
t.refresh(this);
if(t.isSelected())
refresh_files_for.push(t.id());
}
else
new_torrent_ids.push(this.id);
} );
if(refresh_files_for.length > 0)
@ -1597,8 +1597,8 @@ Transmission.prototype =
this._torrents[new_torrent.id()] = new_torrent;
}
this._inspector_file_list.appendChild( fileFragment );
this._torrent_list.appendChild( transferFragment );
this._inspector_file_list.appendChild( fileFragment );
this._torrent_list.appendChild( transferFragment );
this.refilter( );
},
@ -1637,14 +1637,14 @@ Transmission.prototype =
return removedAny;
},
setDisplayMode: function( iscompact )
{
var torrents = this.getAllTorrents();
for( var i=0; torrents[i]; ++i )
{
torrents[i].setListDisplayElements(this[Prefs._CompactDisplayState]);
torrents[i].setListDisplayElements(this[Prefs._CompactDisplayState]);
}
},
@ -1667,7 +1667,7 @@ Transmission.prototype =
var torrents = this.getAllTorrents();
var torrentCount = torrents.length;
var visibleCount = this.getVisibleTorrents().length;
// calculate the overall speed
var upSpeed = 0;
var downSpeed = 0;
@ -1675,7 +1675,7 @@ Transmission.prototype =
upSpeed += row.uploadSpeed( );
downSpeed += row.downloadSpeed( );
}
// update torrent count label
var s;
if( torrentCount == visibleCount )
@ -1683,12 +1683,12 @@ Transmission.prototype =
else
s = visibleCount + ' of ' + torrentCount + ' Transfers';
setInnerHTML( $('#torrent_global_transfer')[0], s );
// update the speeds
s = Transmission.fmt.speed( upSpeed );
if( iPhone ) s = 'UL: ' + s;
setInnerHTML( $('#torrent_global_upload')[0], s );
// download speeds
s = Transmission.fmt.speed( downSpeed );
if( iPhone ) s = 'DL: ' + s;
@ -1710,7 +1710,7 @@ Transmission.prototype =
if (!iPhone && Safari3) {
setTimeout("$('div#upload_container div.dialog_window').css('top', '0px');",10);
}
// Submit the upload form
} else {
var tr = this;

View File

@ -67,7 +67,7 @@ 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.',
'Details',
@ -85,7 +85,7 @@ TransmissionRemote.prototype =
sendRequest: function( data, success, async ) {
remote = this;
if( typeof async != 'boolean' )
async = true;
async = true;
var ajaxSettings = {
url: RPC._Root,
@ -120,8 +120,8 @@ TransmissionRemote.prototype =
method: 'torrent-get',
arguments: {
fields: Torrent._StaticFields.concat( Torrent._MetaDataFields,
Torrent._DynamicFields,
[ 'files', 'fileStats' ] )
Torrent._DynamicFields,
[ 'files', 'fileStats' ] )
}
};
@ -136,7 +136,7 @@ TransmissionRemote.prototype =
method: 'torrent-get',
arguments: {
fields: Torrent._StaticFields.concat( Torrent._MetaDataFields,
[ 'files', 'fileStats' ] )
[ 'files', 'fileStats' ] )
}
};
@ -167,7 +167,7 @@ TransmissionRemote.prototype =
tr.updateTorrentsFileData( data.arguments.torrents );
} );
},
changeFileCommand: function( command, torrent, file ) {
var remote = this;
var torrent_ids = [ torrent.id() ];
@ -180,7 +180,7 @@ TransmissionRemote.prototype =
remote._controller.refreshTorrents( torrent_ids );
} );
},
sendTorrentSetRequests: function( method, torrent_ids, args, callback ) {
if (!args) args = { };
args['ids'] = torrent_ids;
@ -193,7 +193,7 @@ TransmissionRemote.prototype =
callback();
});
},
sendTorrentActionRequests: function( method, torrent_ids, callback ) {
this.sendTorrentSetRequests( method, torrent_ids, null, callback );
},
@ -236,7 +236,6 @@ TransmissionRemote.prototype =
filename: url
}
};
this.sendRequest(o, function() {
remote._controller.refreshTorrents();
} );

View File

@ -212,7 +212,7 @@ div.torrent_global_details div#torrent_global_transfer {
float: left;
}
div.torrent_global_details div#torrent_global_upload,
div.torrent_global_details div#torrent_global_upload,
div.torrent_global_details div#torrent_global_download {
float: right;
padding-left: 13px;
@ -329,7 +329,7 @@ div#torrent_filter_bar input#torrent_search {
div#torrent_filter_bar input#torrent_search.blur {
border-color: #CCC;
}
}
}
div#torrent_filter_bar input#torrent_search.blur {
color: #999;
@ -370,7 +370,6 @@ ul.torrent_list li {
vertical-align: middle;
-moz-user-select: none;
-webkit-user-select: none;
overflow: hidden;
}
@ -423,7 +422,6 @@ ul.torrent_list li.torrent div.torrent_progress_details.compact,
ul.torrent_list li.torrent div.torrent_peer_details.compact {
padding-top: 3px;
float: left;
}
ul.torrent_list li.torrent div.torrent_progress_details.compact {
float: right;
@ -810,7 +808,7 @@ div.inspector_torrent_file_list_entry_progress {
font-size: 1em;
color: #666;
margin-left: 20px;
}
}
div.file_wanted_control {
background-position: left -19px;
float: left;
@ -868,8 +866,8 @@ div.file_priority_control.low:hover {
}
ul.single_file li.inspector_torrent_file_list_entry>.file_priority_control,
li.inspector_torrent_file_list_entry.complete div.file_priority_control {
background-position: left -57px;
cursor: default;
background-position: left -57px;
cursor: default;
}
/*--------------------------------------
@ -985,7 +983,7 @@ div.dialog_container div.dialog_window {
margin-top: 71px;
z-index: 2
}
}
}
div#prefs_container div.dialog_window {
width: 410px;
@ -1269,10 +1267,10 @@ div#prefs_container div#pref_error {
}
#transmission_version{
position: absolute;
bottom: 10px;
left: 10px;
color: #999;
position: absolute;
bottom: 10px;
left: 10px;
color: #999;
}
/*--------------------------------------

View File

@ -8,7 +8,7 @@ div#torrent_container ul li {
padding-right: 40px;
}
li.torrent .torrent_progress_bar.incomplete{
margin-right: 0 !important;
margin-right: 0 !important;
}
li.torrent a div {
right: -5px;
@ -59,5 +59,5 @@ div.torrent_footer ul#settings_menu li#button:hover {
bottom: 0px !important;
}
.dialog_container{
z-index: 4
z-index: 4
}

View File

@ -394,7 +394,7 @@ div#dialog_message.dialog_message {
}
#torrent_upload_file, label[for="torrent_upload_file"]{
display:none;
display:none;
}
h2.dialog_heading {
@ -559,7 +559,7 @@ div#prefs_container a {
text-align: centre;
float: right;
padding-right: 10px;
padding-top: 12px;
padding-top: 12px;
}
div#torrent_inspector {
@ -596,7 +596,7 @@ div#inspector_tabs {
}
.inspector_tab {
float: left;
height: 17px;
height: 17px;
background: transparent url('../images/buttons/tab_backgrounds.png') left -1px repeat-x;
border: 1px solid #888;
margin: 0px 1px;
@ -613,7 +613,7 @@ div#inspector_tabs {
.inspector_group {
display: table;
width: 100%;
border-top: 1px solid #888;
border-top: 1px solid #888;
margin: 10px 0px;
padding: 10px 0px;
}
@ -742,7 +742,7 @@ div.inspector_torrent_file_list_entry_progress {
font-size: 1em;
color: #666;
margin-left: 20px;
}
}
div.file_wanted_control {
background-position: left -19px;
float: left;
@ -878,4 +878,4 @@ div.torrent_footer div#turtle_button {
.torrent_footer div.main_container, .torrent_footer ul#settings_menu, div.torrent_footer ul#settings_menu li#button, div#torrent_context_menu {
display: none;
}
}