mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 18:38:42 +00:00
(trunk web) rename "iphone" variables and css files as "mobile", since they also work on iPods and Android phones.
This commit is contained in:
@@ -12,9 +12,9 @@
|
|||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
|
||||||
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
|
||||||
<!--
|
<!--
|
||||||
<link media="screen" href="./stylesheets/iphone.css" type= "text/css" rel="stylesheet" />
|
<link media="screen" href="./stylesheets/mobile.css" type= "text/css" rel="stylesheet" />
|
||||||
-->
|
-->
|
||||||
<link media="only screen and (max-device-width: 480px)" href="./stylesheets/iphone.css" type= "text/css" rel="stylesheet" />
|
<link media="only screen and (max-device-width: 480px)" href="./stylesheets/mobile.css" type= "text/css" rel="stylesheet" />
|
||||||
<link media="screen and (min-device-width: 481px)" href="./stylesheets/common.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]>
|
<!--[if IE]>
|
||||||
<link media="screen" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
|
<link media="screen" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
|
||||||
|
|||||||
@@ -6,14 +6,10 @@
|
|||||||
* Common javascript
|
* Common javascript
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var transmission;
|
var transmission,
|
||||||
var dialog;
|
dialog,
|
||||||
// Test for a Webkit build that supports box-shadow: 521+ (release Safari 3 is
|
isMobileDevice = RegExp("(isMobileDevice|iPod|Android)").test(navigator.userAgent),
|
||||||
// actually 523.10.3). We need 3.1 for CSS animation (dialog sheets) but as it
|
scroll_timeout;
|
||||||
// degrades gracefully let's not worry too much.
|
|
||||||
var Safari3 = testSafari3();
|
|
||||||
var iPhone = RegExp("(iPhone|iPod|Android)").test(navigator.userAgent);
|
|
||||||
if (iPhone) var scroll_timeout;
|
|
||||||
|
|
||||||
if (!Array.indexOf){
|
if (!Array.indexOf){
|
||||||
Array.prototype.indexOf = function(obj){
|
Array.prototype.indexOf = function(obj){
|
||||||
@@ -25,23 +21,6 @@ if (!Array.indexOf){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
|
||||||
|
|
||||||
if (versionField > minimumField) return true;
|
|
||||||
if (versionField < minimumField) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Initialise the dialog controller
|
// Initialise the dialog controller
|
||||||
dialog = new Dialog();
|
dialog = new Dialog();
|
||||||
@@ -61,33 +40,21 @@ $(document).ready(function() {
|
|||||||
// Move search field's margin down for the styled input
|
// 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) {
|
if (isMobileDevice){
|
||||||
|
window.onload = function(){ setTimeout(function() { window.scrollTo(0,1); },500); };
|
||||||
|
window.onorientationchange = function(){ setTimeout(function() { window.scrollTo(0,1); },100); };
|
||||||
|
if (window.navigator.standalone)
|
||||||
|
// Fix min height for isMobileDevice when run in full screen mode from home screen
|
||||||
|
// so the footer appears in the right place
|
||||||
|
$('body div#torrent_container').css('min-height', '338px');
|
||||||
|
$("label[for=torrent_upload_url]").text("URL: ");
|
||||||
|
} else {
|
||||||
// Fix for non-Safari-3 browsers: dark borders to replace shadows.
|
// Fix for non-Safari-3 browsers: dark borders to replace shadows.
|
||||||
// Opera messes up the menu if we use a border on .trans_menu
|
// Opera messes up the menu if we use a border on .trans_menu
|
||||||
// div.outerbox so use ul instead
|
// div.outerbox so use ul instead
|
||||||
$('.trans_menu ul, div#jqContextMenu, div.dialog_container div.dialog_window').css('border', '1px solid #777');
|
$('.trans_menu ul, div#jqContextMenu, div.dialog_container div.dialog_window').css('border', '1px solid #777');
|
||||||
// and this kills the border we used to have
|
// and this kills the border we used to have
|
||||||
$('.trans_menu div.outerbox').css('border', 'none');
|
$('.trans_menu div.outerbox').css('border', 'none');
|
||||||
} else if (!iPhone) {
|
|
||||||
// Used for Safari 3.1 CSS animation. Degrades gracefully (so Safari 3
|
|
||||||
// test is good enough) but we delay our hide/unhide to wait for the
|
|
||||||
// scrolling - no point making other browsers wait.
|
|
||||||
$('div#upload_container div.dialog_window').css('top', '-205px');
|
|
||||||
$('div#prefs_container div.dialog_window').css('top', '-425px');
|
|
||||||
$('div#dialog_container div.dialog_window').css('top', '-425px');
|
|
||||||
$('div.dialog_container div.dialog_window').css('-webkit-transition', 'top 0.3s');
|
|
||||||
// -webkit-appearance makes some links into buttons, but needs
|
|
||||||
// different padding.
|
|
||||||
$('div.dialog_container div.dialog_window a').css('padding', '2px 10px 3px');
|
|
||||||
}
|
|
||||||
if (iPhone){
|
|
||||||
window.onload = function(){ setTimeout(function() { window.scrollTo(0,1); },500); };
|
|
||||||
window.onorientationchange = function(){ setTimeout(function() { window.scrollTo(0,1); },100); };
|
|
||||||
if (window.navigator.standalone)
|
|
||||||
// Fix min height for iPhone when run in full screen mode from home screen
|
|
||||||
// so the footer appears in the right place
|
|
||||||
$('body div#torrent_container').css('min-height', '338px');
|
|
||||||
$("label[for=torrent_upload_url]").text("URL: ");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,8 @@ Dialog.prototype = {
|
|||||||
hideDialog: function()
|
hideDialog: function()
|
||||||
{
|
{
|
||||||
$('body.dialog_showing').removeClass('dialog_showing');
|
$('body.dialog_showing').removeClass('dialog_showing');
|
||||||
if (Safari3) {
|
|
||||||
$('div#dialog_container div.dialog_window').css('top', '-150px');
|
|
||||||
setTimeout("dialog._container.hide();",500);
|
|
||||||
} else {
|
|
||||||
this._container.hide();
|
this._container.hide();
|
||||||
transmission.hideiPhoneAddressbar();
|
transmission.hideMobileAddressbar();
|
||||||
}
|
|
||||||
transmission.updateButtonStates();
|
transmission.updateButtonStates();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -80,14 +75,8 @@ Dialog.prototype = {
|
|||||||
confirm: function(dialog_heading, dialog_message, confirm_button_label,
|
confirm: function(dialog_heading, dialog_message, confirm_button_label,
|
||||||
callback_function, callback_data, cancel_button_label)
|
callback_function, callback_data, cancel_button_label)
|
||||||
{
|
{
|
||||||
if (!iPhone && Safari3) {
|
if (!isMobileDevice)
|
||||||
$('div#upload_container div.dialog_window').css('top', '-205px');
|
|
||||||
$('div#prefs_container div.dialog_window').css('top', '-425px');
|
|
||||||
setTimeout("$('#upload_container').hide();",500);
|
|
||||||
setTimeout("$('#prefs_container').hide();",500);
|
|
||||||
} else if (!iPhone) {
|
|
||||||
$('.dialog_container').hide();
|
$('.dialog_container').hide();
|
||||||
}
|
|
||||||
setInnerHTML(this._heading[0], dialog_heading);
|
setInnerHTML(this._heading[0], dialog_heading);
|
||||||
setInnerHTML(this._message[0], dialog_message);
|
setInnerHTML(this._message[0], dialog_message);
|
||||||
setInnerHTML(this._cancel_button[0], (cancel_button_label == null) ? 'Cancel' : cancel_button_label);
|
setInnerHTML(this._cancel_button[0], (cancel_button_label == null) ? 'Cancel' : cancel_button_label);
|
||||||
@@ -98,51 +87,28 @@ Dialog.prototype = {
|
|||||||
$('body').addClass('dialog_showing');
|
$('body').addClass('dialog_showing');
|
||||||
this._container.show();
|
this._container.show();
|
||||||
transmission.updateButtonStates();
|
transmission.updateButtonStates();
|
||||||
if (iPhone) {
|
if (isMobileDevice)
|
||||||
transmission.hideiPhoneAddressbar();
|
transmission.hideMobileAddressbar();
|
||||||
} else if (Safari3) {
|
|
||||||
setTimeout("$('div#dialog_container div.dialog_window').css('top', '0px');",10);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Display an alert dialog
|
* Display an alert dialog
|
||||||
*/
|
*/
|
||||||
alert: function(dialog_heading, dialog_message, cancel_button_label) {
|
alert: function(dialog_heading, dialog_message, cancel_button_label) {
|
||||||
if (!iPhone && Safari3) {
|
if (!isMobileDevice)
|
||||||
$('div#upload_container div.dialog_window').css('top', '-205px');
|
|
||||||
$('div#prefs_container div.dialog_window').css('top', '-425px');
|
|
||||||
setTimeout("$('#upload_container').hide();",500);
|
|
||||||
setTimeout("$('#prefs_container').hide();",500);
|
|
||||||
} else if (!iPhone) {
|
|
||||||
$('.dialog_container').hide();
|
$('.dialog_container').hide();
|
||||||
}
|
|
||||||
setInnerHTML(this._heading[0], dialog_heading);
|
setInnerHTML(this._heading[0], dialog_heading);
|
||||||
setInnerHTML(this._message[0], dialog_message);
|
setInnerHTML(this._message[0], dialog_message);
|
||||||
// jquery::hide() doesn't work here in Safari for some odd reason
|
// jquery::hide() doesn't work here in Safari for some odd reason
|
||||||
this._confirm_button.css('display', 'none');
|
this._confirm_button.css('display', 'none');
|
||||||
setInnerHTML(this._cancel_button[0], cancel_button_label);
|
setInnerHTML(this._cancel_button[0], cancel_button_label);
|
||||||
// Just in case
|
// Just in case
|
||||||
if (!iPhone && Safari3) {
|
|
||||||
$('div#upload_container div.dialog_window').css('top', '-205px');
|
|
||||||
setTimeout("$('#upload_container').hide();",500);
|
|
||||||
} else {
|
|
||||||
$('#upload_container').hide();
|
$('#upload_container').hide();
|
||||||
}
|
|
||||||
$('body').addClass('dialog_showing');
|
$('body').addClass('dialog_showing');
|
||||||
transmission.updateButtonStates();
|
transmission.updateButtonStates();
|
||||||
if (iPhone) {
|
if (isMobileDevice)
|
||||||
transmission.hideiPhoneAddressbar();
|
transmission.hideMobileAddressbar();
|
||||||
this._container.show();
|
this._container.show();
|
||||||
} else if (Safari3) {
|
|
||||||
// long pause as we just hid all the dialogs on a timeout - we'll get the error
|
|
||||||
// scrolling in and immediately disappearing if we're not careful!
|
|
||||||
//dialogTimeout = null;
|
|
||||||
this._container.show();
|
|
||||||
setTimeout("$('div#dialog_container div.dialog_window').css('top', '0px');",500);
|
|
||||||
} else {
|
|
||||||
this._container.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ FileRow.prototype =
|
|||||||
x -= e.offsetLeft;
|
x -= e.offsetLeft;
|
||||||
e = e.offsetParent;
|
e = e.offsetParent;
|
||||||
}
|
}
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
if (x < 8) prio = -1;
|
if (x < 8) prio = -1;
|
||||||
else if (x < 27) prio = 0;
|
else if (x < 27) prio = 0;
|
||||||
else prio = 1;
|
else prio = 1;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ Transmission.prototype =
|
|||||||
|
|
||||||
$('#torrent_upload_form').submit(function() { $('#upload_confirm_button').click(); return false; });
|
$('#torrent_upload_form').submit(function() { $('#upload_confirm_button').click(); return false; });
|
||||||
|
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
$('#inspector_close').bind('click', function() { tr.setInspectorVisible(false); });
|
$('#inspector_close').bind('click', function() { tr.setInspectorVisible(false); });
|
||||||
$('#preferences_link').bind('click', function(e) { tr.releaseClutchPreferencesButton(e); });
|
$('#preferences_link').bind('click', function(e) { tr.releaseClutchPreferencesButton(e); });
|
||||||
} else {
|
} else {
|
||||||
@@ -169,7 +169,7 @@ Transmission.prototype =
|
|||||||
},
|
},
|
||||||
|
|
||||||
preloadImages: function() {
|
preloadImages: function() {
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
this.loadImages(
|
this.loadImages(
|
||||||
'images/buttons/info_general.png',
|
'images/buttons/info_general.png',
|
||||||
'images/buttons/info_activity.png',
|
'images/buttons/info_activity.png',
|
||||||
@@ -211,9 +211,9 @@ Transmission.prototype =
|
|||||||
|
|
||||||
// iPhone conditions in the section allow us to not
|
// iPhone conditions in the section allow us to not
|
||||||
// include transmenu js to save some bandwidth; if we
|
// include transmenu js to save some bandwidth; if we
|
||||||
// start using prefs on iPhone we need to weed
|
// start using prefs on mobile devices we need to weed
|
||||||
// transmenu refs out of that too.
|
// transmenu refs out of that too.
|
||||||
if (!iPhone)
|
if (!isMobileDevice)
|
||||||
{
|
{
|
||||||
$('#sort_by_' + this[Prefs._SortMethod]).selectMenuItem();
|
$('#sort_by_' + this[Prefs._SortMethod]).selectMenuItem();
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ Transmission.prototype =
|
|||||||
|
|
||||||
scrollToRow: function(row)
|
scrollToRow: function(row)
|
||||||
{
|
{
|
||||||
if (iPhone) // FIXME: why?
|
if (isMobileDevice) // FIXME: why?
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var list = $('#torrent_container'),
|
var list = $('#torrent_container'),
|
||||||
@@ -547,28 +547,28 @@ Transmission.prototype =
|
|||||||
stopAllClicked: function(ev) {
|
stopAllClicked: function(ev) {
|
||||||
if (this.isButtonEnabled(ev)) {
|
if (this.isButtonEnabled(ev)) {
|
||||||
this.stopAllTorrents();
|
this.stopAllTorrents();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
stopSelectedClicked: function(ev) {
|
stopSelectedClicked: function(ev) {
|
||||||
if (this.isButtonEnabled(ev)) {
|
if (this.isButtonEnabled(ev)) {
|
||||||
this.stopSelectedTorrents();
|
this.stopSelectedTorrents();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startAllClicked: function(ev) {
|
startAllClicked: function(ev) {
|
||||||
if (this.isButtonEnabled(ev)) {
|
if (this.isButtonEnabled(ev)) {
|
||||||
this.startAllTorrents();
|
this.startAllTorrents();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startSelectedClicked: function(ev) {
|
startSelectedClicked: function(ev) {
|
||||||
if (this.isButtonEnabled(ev)) {
|
if (this.isButtonEnabled(ev)) {
|
||||||
this.startSelectedTorrents(false);
|
this.startSelectedTorrents(false);
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -630,12 +630,7 @@ Transmission.prototype =
|
|||||||
|
|
||||||
hideUploadDialog: function() {
|
hideUploadDialog: function() {
|
||||||
$('body.open_showing').removeClass('open_showing');
|
$('body.open_showing').removeClass('open_showing');
|
||||||
if (!iPhone && Safari3) {
|
|
||||||
$('div#upload_container div.dialog_window').css('top', '-205px');
|
|
||||||
setTimeout("$('#upload_container').hide();",500);
|
|
||||||
} else {
|
|
||||||
$('#upload_container').hide();
|
$('#upload_container').hide();
|
||||||
}
|
|
||||||
this.updateButtonStates();
|
this.updateButtonStates();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -696,12 +691,12 @@ Transmission.prototype =
|
|||||||
removeClicked: function(ev) {
|
removeClicked: function(ev) {
|
||||||
if (this.isButtonEnabled(ev)) {
|
if (this.isButtonEnabled(ev)) {
|
||||||
this.removeSelectedTorrents();
|
this.removeSelectedTorrents();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 'Clutch Preferences' was clicked (iPhone only)
|
* 'Clutch Preferences' was clicked (isMobileDevice only)
|
||||||
*/
|
*/
|
||||||
releaseClutchPreferencesButton: function() {
|
releaseClutchPreferencesButton: function() {
|
||||||
$('div#prefs_container div#pref_error').hide();
|
$('div#prefs_container div#pref_error').hide();
|
||||||
@@ -778,9 +773,7 @@ Transmission.prototype =
|
|||||||
this.checkPort(true);
|
this.checkPort(true);
|
||||||
$('body').addClass('prefs_showing');
|
$('body').addClass('prefs_showing');
|
||||||
$('#prefs_container').show();
|
$('#prefs_container').show();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
if (Safari3)
|
|
||||||
setTimeout("$('div#prefs_container div.dialog_window').css('top', '0px');",10);
|
|
||||||
this.updateButtonStates();
|
this.updateButtonStates();
|
||||||
this.togglePeriodicSessionRefresh(false);
|
this.togglePeriodicSessionRefresh(false);
|
||||||
},
|
},
|
||||||
@@ -788,15 +781,9 @@ Transmission.prototype =
|
|||||||
hidePrefsDialog: function()
|
hidePrefsDialog: function()
|
||||||
{
|
{
|
||||||
$('body.prefs_showing').removeClass('prefs_showing');
|
$('body.prefs_showing').removeClass('prefs_showing');
|
||||||
if (iPhone) {
|
if (isMobileDevice)
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
$('#prefs_container').hide();
|
$('#prefs_container').hide();
|
||||||
} else if (Safari3) {
|
|
||||||
$('div#prefs_container div.dialog_window').css('top', '-425px');
|
|
||||||
setTimeout("$('#prefs_container').hide();",500);
|
|
||||||
} else {
|
|
||||||
$('#prefs_container').hide();
|
|
||||||
}
|
|
||||||
this.updateButtonStates();
|
this.updateButtonStates();
|
||||||
this.togglePeriodicSessionRefresh(true);
|
this.togglePeriodicSessionRefresh(true);
|
||||||
},
|
},
|
||||||
@@ -847,7 +834,7 @@ Transmission.prototype =
|
|||||||
$('#port_rand').prop('checked', p[RPC._PeerPortRandom]);
|
$('#port_rand').prop('checked', p[RPC._PeerPortRandom]);
|
||||||
$('#port_forward').prop('checked', p[RPC._PortForwardingEnabled]);
|
$('#port_forward').prop('checked', p[RPC._PortForwardingEnabled]);
|
||||||
|
|
||||||
if (!iPhone)
|
if (!isMobileDevice)
|
||||||
{
|
{
|
||||||
setInnerHTML($('#limited_download_rate')[0], [ 'Limit (', Transmission.fmt.speed(dn_limit_k), ')' ].join(''));
|
setInnerHTML($('#limited_download_rate')[0], [ 'Limit (', Transmission.fmt.speed(dn_limit_k), ')' ].join(''));
|
||||||
var key = dn_limited ? '#limited_download_rate'
|
var key = dn_limited ? '#limited_download_rate'
|
||||||
@@ -876,24 +863,16 @@ Transmission.prototype =
|
|||||||
this.loadDaemonStats();
|
this.loadDaemonStats();
|
||||||
$('body').addClass('stats_showing');
|
$('body').addClass('stats_showing');
|
||||||
$('#stats_container').show();
|
$('#stats_container').show();
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
if (Safari3)
|
|
||||||
setTimeout("$('div#stats_container div.dialog_window').css('top', '0px');",10);
|
|
||||||
this.updateButtonStates();
|
this.updateButtonStates();
|
||||||
this.togglePeriodicStatsRefresh(true);
|
this.togglePeriodicStatsRefresh(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
hideStatsDialog: function() {
|
hideStatsDialog: function() {
|
||||||
$('body.stats_showing').removeClass('stats_showing');
|
$('body.stats_showing').removeClass('stats_showing');
|
||||||
if (iPhone) {
|
if (isMobileDevice)
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
$('#stats_container').hide();
|
$('#stats_container').hide();
|
||||||
} else if (Safari3) {
|
|
||||||
$('div#stats_container div.dialog_window').css('top', '-425px');
|
|
||||||
setTimeout("$('#stats_container').hide();",500);
|
|
||||||
} else {
|
|
||||||
$('#stats_container').hide();
|
|
||||||
}
|
|
||||||
this.updateButtonStates();
|
this.updateButtonStates();
|
||||||
this.togglePeriodicStatsRefresh(false);
|
this.togglePeriodicStatsRefresh(false);
|
||||||
},
|
},
|
||||||
@@ -1138,7 +1117,7 @@ Transmission.prototype =
|
|||||||
meta_key = true;
|
meta_key = true;
|
||||||
|
|
||||||
// Shift-Click - selects a range from the last-clicked row to this one
|
// Shift-Click - selects a range from the last-clicked row to this one
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
if (row.isSelected())
|
if (row.isSelected())
|
||||||
this.setInspectorVisible(true);
|
this.setInspectorVisible(true);
|
||||||
this.setSelectedRow(row);
|
this.setSelectedRow(row);
|
||||||
@@ -1208,9 +1187,6 @@ Transmission.prototype =
|
|||||||
$('input#torrent_auto_start').attr('checked', $('#prefs_form #auto_start')[0].checked);
|
$('input#torrent_auto_start').attr('checked', $('#prefs_form #auto_start')[0].checked);
|
||||||
$('#upload_container').show();
|
$('#upload_container').show();
|
||||||
$('#torrent_upload_url').focus();
|
$('#torrent_upload_url').focus();
|
||||||
if (!iPhone && Safari3) {
|
|
||||||
setTimeout("$('div#upload_container div.dialog_window').css('top', '0px');",10);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Submit the upload form
|
// Submit the upload form
|
||||||
} else {
|
} else {
|
||||||
@@ -1339,10 +1315,10 @@ Transmission.prototype =
|
|||||||
this.remote.changeFileCommand(command, rows);
|
this.remote.changeFileCommand(command, rows);
|
||||||
},
|
},
|
||||||
|
|
||||||
hideiPhoneAddressbar: function(timeInSeconds) {
|
hideMobileAddressbar: function(timeInSeconds) {
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
var delayLength = timeInSeconds ? timeInSeconds*1000 : 150;
|
var delayLength = timeInSeconds ? timeInSeconds*1000 : 150;
|
||||||
// not currently supported on iPhone
|
// not currently supported on isMobileDevice
|
||||||
if (/*document.body.scrollTop!=1 && */scroll_timeout==null) {
|
if (/*document.body.scrollTop!=1 && */scroll_timeout==null) {
|
||||||
var tr = this;
|
var tr = this;
|
||||||
scroll_timeout = setTimeout(function() {tr.doToolbarHide();}, delayLength);
|
scroll_timeout = setTimeout(function() {tr.doToolbarHide();}, delayLength);
|
||||||
@@ -1470,7 +1446,7 @@ Transmission.prototype =
|
|||||||
|
|
||||||
inspectorTabClicked: function(ev, tab)
|
inspectorTabClicked: function(ev, tab)
|
||||||
{
|
{
|
||||||
if (iPhone) ev.stopPropagation();
|
if (isMobileDevice) ev.stopPropagation();
|
||||||
|
|
||||||
// select this tab and deselect the others
|
// select this tab and deselect the others
|
||||||
$(tab).addClass('selected').siblings().removeClass('selected');
|
$(tab).addClass('selected').siblings().removeClass('selected');
|
||||||
@@ -1478,7 +1454,7 @@ Transmission.prototype =
|
|||||||
// show this tab and hide the others
|
// show this tab and hide the others
|
||||||
$('#'+tab.id+'_container').show().siblings('.inspector_container').hide();
|
$('#'+tab.id+'_container').show().siblings('.inspector_container').hide();
|
||||||
|
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
this.updatePeersLists();
|
this.updatePeersLists();
|
||||||
this.updateTrackersLists();
|
this.updateTrackersLists();
|
||||||
this.updateFileList();
|
this.updateFileList();
|
||||||
@@ -1492,7 +1468,7 @@ Transmission.prototype =
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var torrents = this.getSelectedTorrents();
|
var torrents = this.getSelectedTorrents();
|
||||||
if (!torrents.length && iPhone) {
|
if (!torrents.length && isMobileDevice) {
|
||||||
this.setInspectorVisible(false);
|
this.setInspectorVisible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1870,10 +1846,10 @@ Transmission.prototype =
|
|||||||
|
|
||||||
// update the ui widgetry
|
// update the ui widgetry
|
||||||
$('#torrent_inspector').toggle(visible);
|
$('#torrent_inspector').toggle(visible);
|
||||||
if (iPhone) {
|
if (isMobileDevice) {
|
||||||
$('body').toggleClass('inspector_showing',visible);
|
$('body').toggleClass('inspector_showing',visible);
|
||||||
$('#inspector_close').toggle(visible);
|
$('#inspector_close').toggle(visible);
|
||||||
this.hideiPhoneAddressbar();
|
this.hideMobileAddressbar();
|
||||||
} else {
|
} else {
|
||||||
var w = visible ? $('#torrent_inspector').width() + 1 + 'px' : '0px';
|
var w = visible ? $('#torrent_inspector').width() + 1 + 'px' : '0px';
|
||||||
$('#torrent_container')[0].style.right = w;
|
$('#torrent_container')[0].style.right = w;
|
||||||
@@ -1896,7 +1872,7 @@ Transmission.prototype =
|
|||||||
var popup = $('#filter-popup');
|
var popup = $('#filter-popup');
|
||||||
popup.dialog({
|
popup.dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
position: iPhone ? [0,0] : [40,80],
|
position: isMobileDevice ? [0,0] : [40,80],
|
||||||
show: 'blind',
|
show: 'blind',
|
||||||
hide: 'blind',
|
hide: 'blind',
|
||||||
title: 'Show',
|
title: 'Show',
|
||||||
@@ -2277,7 +2253,7 @@ Transmission.prototype =
|
|||||||
|
|
||||||
// update the ui: context menu
|
// update the ui: context menu
|
||||||
// (disabled in iphone mode...)
|
// (disabled in iphone mode...)
|
||||||
if (!iPhone) {
|
if (!isMobileDevice) {
|
||||||
var e = $('#settings_menu #compact_view');
|
var e = $('#settings_menu #compact_view');
|
||||||
if (compact)
|
if (compact)
|
||||||
e.selectMenuItem();
|
e.selectMenuItem();
|
||||||
|
|||||||
Reference in New Issue
Block a user