(trunk web) enable the torrent inspector for iPhone / iPod.

Double tap the torrent to show the inspector for it.
patch from r0ssar00
This commit is contained in:
Kevin Glowacz
2009-06-23 01:52:20 +00:00
parent 4249a6768a
commit 01604035e2
5 changed files with 193 additions and 106 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

View File

@@ -64,6 +64,8 @@
</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">
<div class="inspector_tab selected" id="inspector_tab_info"><a href="#info"><img src="images/buttons/info_general.png" alt="Information"/></a></div>
<div class="inspector_tab" id="inspector_tab_activity"><a href="#activity"><img src="images/buttons/info_activity.png" alt="Activity"/></a></div>

View File

@@ -85,7 +85,7 @@ Torrent.prototype =
e.appendChild( image );
top_e.appendChild( e );
element._pause_resume_button_image = image;
if (!iPhone) $(e).bind('click', {element: element}, this.clickPauseResumeButton);
if (!iPhone) $(e).bind('click', function(e) { element._torrent.clickPauseResumeButton(e); });
// Create the 'peer details' <div>
e = document.createElement( 'div' );
@@ -94,7 +94,7 @@ Torrent.prototype =
element._peer_details_container = e;
// Set the torrent click observer
element.bind('click', {element: element}, this.clickTorrent);
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.
@@ -216,7 +216,7 @@ Torrent.prototype =
// Prevents click carrying to parent element
// which deselects all on click
event.stopPropagation();
var torrent = event.data.element._torrent;
var torrent = this;
// 'Apple' button emulation on PC :
// Need settable meta-key and ctrl-key variables for mac emulation
@@ -229,6 +229,8 @@ Torrent.prototype =
// 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) {
@@ -265,7 +267,7 @@ Torrent.prototype =
event.stopPropagation();
// either stop or start the torrent
var torrent = event.data.element._torrent;
var torrent = this;
if( torrent.isActive( ) )
torrent._controller.stopTorrent( torrent );
else

View File

@@ -51,7 +51,7 @@ Transmission.prototype =
$('.file_wanted_control').live('click', function(e){ tr.fileWantedClicked(e, this); });
$('.file_priority_control').live('click', function(e){ tr.filePriorityClicked(e, this); });
if (iPhone) {
$('#torrent_inspector').bind('click', function(e){ tr.hideInspector(); });
$('#inspector_close').bind('click', function(e){ tr.hideInspector(); });
$('#preferences_link').bind('click', function(e){ tr.releaseClutchPreferencesButton(e); });
} else {
$(document).bind('keydown', function(e){ tr.keyDown(e); });
@@ -192,8 +192,8 @@ Transmission.prototype =
if( this[Prefs._ShowFilter] )
this.showFilter( );
if( this[Prefs._ShowInspector] )
if( !iPhone && this[Prefs._ShowInspector] )
this.showInspector( );
},
@@ -942,7 +942,7 @@ Transmission.prototype =
var total_upload_speed = 0;
var total_verified = 0;
var na = 'N/A';
var tab = this._inspector._info_tab;
var tab = this._inspector._info_tab;
$("#torrent_inspector_size, .inspector_row div").css('color', '#222');
@@ -1085,6 +1085,7 @@ Transmission.prototype =
$('#torrent_inspector').show();
if (iPhone) {
$('body').addClass('inspector_showing');
$('#inspector_close').show();
this.hideiPhoneAddressbar();
} else {
var w = $('#torrent_inspector').width() + 1 + 'px';
@@ -1108,6 +1109,7 @@ Transmission.prototype =
if (iPhone) {
this.deselectAll( );
$('body.inspector_showing').removeClass('inspector_showing');
$('#inspector_close').hide();
this.hideiPhoneAddressbar();
} else {
$('#torrent_filter_bar')[0].style.right = '0px';

View File

@@ -26,10 +26,14 @@ body div#torrent_container {
min-height: 295px;
}
body div.dialog_container, body div#torrent_inspector {
body div.dialog_container {
min-height: 291px;
}
body div#torrent_inspector {
min-height: 323px;
}
body.landscape div#torrent_container {
min-height: 147px;
}
@@ -552,117 +556,194 @@ div#prefs_container a {
*
*--------------------------------------*/
div#torrent_inspector {
height: auto !important;
background: #272727;
text-align: left;
padding: 15px 10px !important;
color: white;
text-shadow: 1px 1px 2px #000;
font-size: 12px;
#inspector_close {
align: right;
text-align: centre;
float: right;
padding-right: 10px;
padding-top: 12px;
}
div#torrent_inspector h1#torrent_inspector_name {
font-size: 14px;
div#torrent_inspector {
position: relative;
top: 0 !important;
right: 0px;
width: 100%;
background-color: #ddd;
z-index: 2;
text-align: left;
overflow: auto;
}
div#torrent_inspector #torrent_inspector_name {
margin: 0;
padding: 0;
overflow: hidden;
word-wrap: break-word;
}
div#torrent_inspector #torrent_inspector_size {
font-size: 1.2em;
margin: 3;
display: block;
padding-top: 2px;
}
div#inspector_header {
clear: both;
text-overflow: ellipsis; /*Not currently respected by browsers, but in case of future support*/
max-height: 48px;
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
}
.landscape div#torrent_inspector h1#torrent_inspector_name {
width: 450px;
div#inspector_tabs {
width: 189px;
margin: 0 auto;
padding-top: 10px;
}
div#torrent_inspector div.torrent_inspector_header {
text-align: center;
margin: 0 15px;
}
div#torrent_inspector span#torrent_inspector_size {
font-size: 12px;
margin: 3px auto 0;
display: block;
}
div.torrent_inspector_section {
margin: 0;
padding: 0;
}
div#torrent_inspector ul.torrent_inspector_tabs {
margin: 0 auto 9px; /* Center tabs */
padding: 0;
text-align: center;
-webkit-border-radius: 9px;
list-style: none;
}
div#torrent_inspector ul.torrent_inspector_tabs li {
list-style: none;
display: inline;
}
div#torrent_inspector ul.torrent_inspector_tabs li a {
text-align: center;
text-decoration: none;
cursor: pointer;
margin: 0 !important;
padding: 0 !important;
}
div#torrent_inspector ul.torrent_inspector_tabs li a img {
background: transparent;
padding: 10px 9px 8px;
border: 4px solid #777;
-webkit-border-radius: 11px;
margin: 0 3px;
opacity: 0.15;
}
div#torrent_inspector ul.torrent_inspector_tabs li a#inspector_tab_activity img {
padding: 9px 9px;
}
div#torrent_inspector ul.torrent_inspector_tabs li a.selected img {
border-color: #fff;
background-color: #ccd;
opacity: 1;
}
div#torrent_inspector div.torrent_inspector_section h2 {
font-size: 13px;
margin: 0 5px 0 5px;
padding: 7px 0;
clear: both;
width: 200px;
}
div#torrent_inspector div.torrent_inspector_section h2:after {
content: ":";
}
div#torrent_inspector div.torrent_inspector_section label {
margin: 0 0 0 20px;
width: 92px;
display: block;
.inspector_tab {
float: left;
height: 17px;
background: transparent url('../images/buttons/tab_backgrounds.png') left -1px repeat-x;
border: 1px solid #888;
margin: 0px 1px;
padding: 3px 15px; /* 3px == ((bg image height - fg image height) / 2) */
cursor: pointer;
}
#inspector_tabs .selected {
background-position: left -26px; /* the highlighted part of the image */
}
.inspector_container {
margin: 3%;
width: 96%;
}
.inspector_group {
display: table;
width: 100%;
border-top: 1px solid #888;
margin: 10px 0px;
padding: 10px 0px;
}
.inspector_group_label {
display: table-header-group;
font-weight: bold;
}
.inspector_row {
display: table-row;
}
.inspector_row > .inspector_label {
display: table-cell;
width: 100px; /* this + the next 230 == inspector_container_with */
}
.inspector_row > div {
display: table-cell;
padding-top: 10px;
width: 230px; /* inspector_container_width==330 - inspector_label_width==100 */
}
div#torrent_inspector div#inspector_tab_info_container.torrent_inspector_section label {
width: 72px;
}
div#torrent_inspector div.torrent_inspector_section div {
height: 16px;
/* Files Inspector Tab */
#inspector_file_list {
padding: 0 0 0 0;
margin: 0 0 0 0;
text-align: left;
cursor: default;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
ul.inspector_torrent_file_list {
width: 100%;
margin: 0 0 0 0;
padding-bottom: 10px;
text-align: left;
display: block;
cursor: default;
list-style-type: none;
list-style: none;
list-style-image: none;
}
li.inspector_torrent_file_list_entry {
padding: 3px 0 3px 2px;
display: block;
}
li.inspector_torrent_file_list_entry.skip {
color: #666;
}
li.inspector_torrent_file_list_entry.even {
background-color: #EEEEEE;
}
div.inspector_torrent_file_list_entry_name {
font-size: 1.2em;
font-weight: bold;
color: #222;
margin-left: 20px;
}
li.inspector_torrent_file_list_entry.skip>.inspector_torrent_file_list_entry_name {
color: #666;
}
li.inspector_torrent_file_list_entry.even {
background-color: #EEEEEE;
}
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;
position: absolute;
cursor: pointer;
margin: 3px 0 0 0;
width: 19px;
height: 19px;
background-image: url('../images/buttons/file_wanted_buttons.png');
background-repeat: no-repeat;
background-color: transparent;
}
li.inspector_torrent_file_list_entry.skip>.file_wanted_control {
background-position: left top;
}
li.inspector_torrent_file_list_entry.complete>.file_wanted_control {
background-position: left -19px;
}
ul.single_file li.inspector_torrent_file_list_entry>.file_wanted_control,
li.inspector_torrent_file_list_entry.complete>.file_wanted_control {
background-position: left -38px;
cursor: default;
}
div.file_priority_control {
float: right;
margin: 4px 0 0 0;
width: 35px;
height: 19px;
background-image: url('../images/buttons/file_priority_buttons.png');
background-repeat: no-repeat;
background-color: transparent;
cursor: pointer;
}
div.file_priority_control.normal {
background-position: left top;
}
div.file_priority_control.normal:hover {
background-position: right top;
}
div.file_priority_control.high {
background-position: left -19px;
}
div.file_priority_control.high:hover {
background-position: right -19px;
}
div.file_priority_control.low {
background-position: left -38px;
}
div.file_priority_control.low:hover {
background-position: right -38px;
}
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;
}
/*--------------------------------------
*