(trunk web) A lot of web cleanup, refactoring, bugfixes, and probably new breakage. Filterbar/statusbar has been reworked. Added filter-by-tracker. Compact mode now works in "iPhone" mode.

This commit is contained in:
Jordan Lee
2011-08-24 02:04:35 +00:00
parent 25ca73dca5
commit 2dc746a7b6
14 changed files with 2140 additions and 2149 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -9,13 +9,17 @@
<link href="./images/favicon.png" rel="shortcut icon" />
<link rel="apple-touch-icon" href="./images/webclip-icon.png"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.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 media="screen" href="./stylesheets/iphone.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="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" />
<![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]-->
<script type="text/javascript" src="./javascript/jquery/jquery.transmenu.min.js"></script>
<script type="text/javascript" src="./javascript/jquery/jquery.contextmenu.min.js"></script>
@@ -34,7 +38,7 @@
</head>
<body id="transmission_body">
<div class="torrent_global_menu">
<div id="toolbar">
<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>
@@ -45,26 +49,23 @@
<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>
<li><a href="#finished" id="filter_finished_link" class="finished">Finished</a></li>
</ul>
<div id="statusbar">
<input type="search" id="torrent_search" placeholder="Filter" results="0" />
<div id='filter-button'></div>
<div id='speed-info'>
<span id="speed-up-label">0 B/s</span>
<span id="speed-dn-label">0 B/s</span>
</div>
</div>
<div id="filter-popup" style="display:none;">
<div id='filter-popup-workarea'>
<div id='filter-by-state'></div>
<div id='filter-by-tracker'></div>
</div>
</div>
<div id="torrent_inspector" style="display:none;">
@@ -539,6 +540,7 @@
</ul>
</li>
</ul>
<div id="compact-button">&nbsp;</div>
<div id="turtle_button">&nbsp;</div>
<div style="clear: both; visibility: hidden;"></div>
</div>

View File

@@ -8,7 +8,6 @@
var transmission;
var dialog;
var resizeTimer = null;
// Test for a Webkit build that supports box-shadow: 521+ (release Safari 3 is
// actually 523.10.3). We need 3.1 for CSS animation (dialog sheets) but as it
// degrades gracefully let's not worry too much.
@@ -90,13 +89,6 @@ $(document).ready( function() {
$('body div#torrent_container').css('min-height', '338px');
$("label[for=torrent_upload_url]").text("URL: ");
}
// Add resize event handler with a timeout to handle browsers that fire a
// resize event for every pixel changed
$(window).bind('resize', function() {
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout('transmission.refreshDisplay()', 50)
});
});
/*
@@ -213,8 +205,6 @@ Prefs.prototype = { };
Prefs._RefreshRate = 'refresh_rate';
Prefs._SessionRefreshRate = 'session_refresh_rate';
Prefs._ShowFilter = 'show_filter';
Prefs._ShowInspector = 'show_inspector';
Prefs._FilterMode = 'filter';
@@ -334,3 +324,40 @@ jQuery.fn.forceNumeric = function () {
});
});
}
/**
* http://blog.stevenlevithan.com/archives/parseuri
*
* parseUri 1.2.2
* (c) Steven Levithan <stevenlevithan.com>
* MIT License
*/
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
while (i--) uri[o.key[i]] = m[i] || "";
uri[o.q.name] = {};
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
if ($1) uri[o.q.name][$1] = $2;
});
return uri;
};
parseUri.options = {
strictMode: false,
key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
q: {
name: "queryKey",
parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
}
};

View File

@@ -4,14 +4,14 @@
* <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
*/
function FileRow( controller, torrent, i )
function FileRow(torrent, i)
{
this.initialize( controller, torrent, i );
this.initialize(torrent, i);
}
FileRow.prototype =
{
initialize: function( controller, torrent, i )
initialize: function(torrent, i)
{
this._torrent = torrent;
this._index = i;
@@ -62,8 +62,8 @@ FileRow.prototype =
var e = this._priority_control;
var c = [ e.classNameConst ];
switch(this._prio) {
case 1 : c.push( 'high' ); break;
case -1 : c.push('low'); break;
case 1 : c.push('high'); break;
default : c.push('normal'); break;
}
e.className = c.join(' ');
@@ -114,7 +114,7 @@ FileRow.prototype =
var wanted_div = document.createElement('div');
wanted_div.className = "file_wanted_control";
$(wanted_div).bind('click',function(e){ me.fireWantedChanged( !me._wanted ); });
$(wanted_div).bind('click',function(){ me.fireWantedChanged(!me._wanted); });
var pri_div = document.createElement('div');
pri_div.classNameConst = "file_priority_control";
@@ -122,7 +122,7 @@ FileRow.prototype =
$(pri_div).bind('click',function(ev){
var x = ev.pageX;
var e = ev.target;
while (e !== null) {
while (e) {
x -= e.offsetLeft;
e = e.offsetParent;
}

View File

@@ -32,6 +32,7 @@ Transmission.fmt = (function()
updateUnits: function(u)
{
/*
speed_K = u['speed-bytes'];
speed_K_str = u['speed-units'][0];
speed_M_str = u['speed-units'][1];
@@ -49,6 +50,7 @@ Transmission.fmt = (function()
mem_M_str = u['memory-units'][1];
mem_G_str = u['memory-units'][2];
mem_T_str = u['memory-units'][3];
*/
},
/*
@@ -167,8 +169,8 @@ Transmission.fmt = (function()
{
var speed = KBps;
if (speed <= 999.95) // 0 KBps to 999.9 K
return [ speed.toTruncFixed(1), speed_K_str ].join(' ');
if (speed <= 999.95) // 0 KBps to 999 K
return [ speed.toTruncFixed(0), speed_K_str ].join(' ');
speed /= speed_K;

View File

@@ -42,7 +42,7 @@ TorrentRendererHelper.getProgressInfo = function( controller, t )
complete: [ 'torrent_progress_bar', 'complete', extra ].join(' '),
incomplete: [ 'torrent_progress_bar', 'incomplete', extra ].join(' ')
};
}
};
TorrentRendererHelper.createProgressbar = function(classes)
{
@@ -54,8 +54,8 @@ TorrentRendererHelper.createProgressbar = function( classes )
progressbar.className = 'torrent_progress_bar_container ' + classes;
progressbar.appendChild(complete);
progressbar.appendChild(incomplete);
return { 'element': progressbar, 'complete': complete, 'incomplete': incomplete }
}
return { 'element': progressbar, 'complete': complete, 'incomplete': incomplete };
};
TorrentRendererHelper.renderProgressbar = function(controller, t, progressbar)
{
@@ -68,17 +68,17 @@ TorrentRendererHelper.renderProgressbar = function( controller, t, progressbar )
e = progressbar.incomplete;
e.className = info.incomplete;
e.style.display = info.percent>=100 ? 'none' : 'block';
}
};
TorrentRendererHelper.formatUL = function(t)
{
return 'UL: ' + Transmission.fmt.speedBps( t.getUploadSpeed( ) );
}
return '&uarr; ' + Transmission.fmt.speedBps(t.getUploadSpeed());
};
TorrentRendererHelper.formatDL = function(t)
{
return 'DL: ' + Transmission.fmt.speedBps( t.getDownloadSpeed( ) );
}
return '&darr; ' + Transmission.fmt.speedBps(t.getDownloadSpeed());
};
/****
*****
@@ -169,9 +169,9 @@ TorrentRendererFull.prototype =
}
var c;
var sizeWhenDone = t.getSizeWhenDone()
var totalSize = t.getTotalSize()
var is_done = ( t.isDone( ) ) || ( t.isSeeding() )
var sizeWhenDone = t.getSizeWhenDone();
var totalSize = t.getTotalSize();
var is_done = t.isDone() || t.isSeeding();
if (is_done) {
if (totalSize == sizeWhenDone) // seed: '698.05 MiB'
@@ -196,7 +196,7 @@ TorrentRendererFull.prototype =
// maybe append eta
if (!t.isStopped() && (!is_done || t.seedRatioLimit(controller)>0)) {
c.push(' - ');
var eta = t.getETA()
var eta = t.getETA();
if (eta < 0 || eta >= (999*60*60) /* arbitrary */)
c.push('remaining time unknown');
else
@@ -226,10 +226,10 @@ TorrentRendererFull.prototype =
setInnerHTML(e, this.getProgressDetails(controller, t));
// pause/resume button
var is_stopped = t.isStopped()
e = root._pause_resume_button_image
e.alt = is_stopped ? 'Resume' : 'Pause'
e.className = is_stopped ? 'torrent_resume' : 'torrent_pause'
var is_stopped = t.isStopped();
e = root._pause_resume_button_image;
e.alt = is_stopped ? 'Resume' : 'Pause';
e.className = is_stopped ? 'torrent_resume' : 'torrent_pause';
}
};
@@ -280,7 +280,7 @@ TorrentRendererCompact.prototype =
render: function(controller, t, root)
{
// name
var is_stopped = t.isStopped()
var is_stopped = t.isStopped();
var e = root._name_container;
$(e).toggleClass('paused', is_stopped);
setInnerHTML(e, t.getName());
@@ -301,15 +301,19 @@ TorrentRendererCompact.prototype =
*****
****/
function TorrentRow( view )
function TorrentRow(view, controller, torrent, selected)
{
this.initialize( view );
this.initialize(view, controller, torrent, selected);
}
TorrentRow.prototype =
{
initialize: function( view ) {
initialize: function(view, controller, torrent, selected) {
this._view = view;
this._element = view.createRow();
this.setTorrent(controller, torrent);
if (selected)
this.setSelected(selected);
this.render(controller);
},
getElement: function() {
@@ -317,11 +321,11 @@ TorrentRow.prototype =
},
render: function(controller) {
var tor = this.getTorrent();
if( tor !== null )
if (tor)
this._view.render(controller, tor, this.getElement());
},
isSelected: function() {
return this.getElement().className.indexOf('selected') != -1;
return this.getElement().className.indexOf('selected') !== -1;
},
setSelected: function(flag) {
$(this.getElement()).toggleClass('selected', flag);
@@ -331,24 +335,14 @@ TorrentRow.prototype =
return this.getElement()._toggle_running_button;
},
setVisible: function( visible ) {
this.getElement().style.display = visible ? 'block' : 'none';
if( !visible )
this.setSelected( false );
},
isVisible: function( visible ) {
return this.getElement().style.display === 'block';
},
setTorrent: function(controller, t) {
if (this._torrent !== t) {
var row = this
var row = this;
var key = 'dataChanged.torrentRowListener';
if (this._torrent)
$(this._torrent).unbind(key);
if ((this._torrent = t))
$(this._torrent).bind(key,function(){row.render(controller)})
$(this._torrent).bind(key,function(){row.render(controller);});
}
},
getTorrent: function() {

View File

@@ -7,9 +7,9 @@
*/
function Torrent(controller, data)
function Torrent(data)
{
this.initialize(controller, data)
this.initialize(data);
}
/***
@@ -19,41 +19,41 @@ function Torrent(controller, data)
***/
// Torrent.fields.status
Torrent._StatusStopped = 0
Torrent._StatusCheckWait = 1
Torrent._StatusCheck = 2
Torrent._StatusDownloadWait = 3
Torrent._StatusDownload = 4
Torrent._StatusSeedWait = 5
Torrent._StatusSeed = 6
Torrent._StatusStopped = 0;
Torrent._StatusCheckWait = 1;
Torrent._StatusCheck = 2;
Torrent._StatusDownloadWait = 3;
Torrent._StatusDownload = 4;
Torrent._StatusSeedWait = 5;
Torrent._StatusSeed = 6;
// Torrent.fields.seedRatioMode
Torrent._RatioUseGlobal = 0
Torrent._RatioUseLocal = 1
Torrent._RatioUnlimited = 2
Torrent._RatioUseGlobal = 0;
Torrent._RatioUseLocal = 1;
Torrent._RatioUnlimited = 2;
// Torrent.fields.error
Torrent._ErrNone = 0
Torrent._ErrTrackerWarning = 1
Torrent._ErrTrackerError = 2
Torrent._ErrLocalError = 3
Torrent._ErrNone = 0;
Torrent._ErrTrackerWarning = 1;
Torrent._ErrTrackerError = 2;
Torrent._ErrLocalError = 3;
// TrackerStats' announceState
Torrent._TrackerInactive = 0
Torrent._TrackerWaiting = 1
Torrent._TrackerQueued = 2
Torrent._TrackerActive = 3
Torrent._TrackerInactive = 0;
Torrent._TrackerWaiting = 1;
Torrent._TrackerQueued = 2;
Torrent._TrackerActive = 3;
// fields whose values never change and are always known
Torrent._StaticFields = [
'hashString', 'id' ]
'hashString', 'id' ];
// fields whose values never change and are known upon constructon OR
// when a magnet torrent finishes downloading its metadata
Torrent._MetaDataFields = [
'addedDate', 'comment', 'creator', 'dateCreated',
'isPrivate', 'name', 'totalSize', 'pieceCount', 'pieceSize' ]
'isPrivate', 'name', 'totalSize', 'pieceCount', 'pieceSize' ];
// torrent fields whose values change all the time
Torrent._DynamicFields = [
@@ -63,7 +63,7 @@ Torrent._DynamicFields = [
'peersGettingFromUs', 'peersSendingToUs', 'queuePosition',
'rateDownload', 'rateUpload', 'recheckProgress', 'seedRatioLimit',
'seedRatioMode', 'sizeWhenDone', 'status', 'trackerStats',
'uploadedEver', 'uploadRatio', 'webseedsSendingToUs' ]
'uploadedEver', 'uploadRatio', 'webseedsSendingToUs' ];
/***
****
@@ -73,41 +73,50 @@ Torrent._DynamicFields = [
Torrent.prototype =
{
initialize: function(controller, data)
initialize: function(data)
{
this.fields = {}
this._files = []
this.fields = {};
this._files = [];
// these fields are set in the ctor and never change
for(var i=0, key; key=Torrent._StaticFields[i]; ++i)
if(key in data)
this.fields[key] = data[key]
for (var i=0, key; key=Torrent._StaticFields[i]; ++i) {
if (key in data) {
this.fields[key] = data[key];
}
}
this.initMetaData(data)
this._trackerStats = this.buildTrackerStats(data.trackerStats)
this.refresh(data)
this.initMetaData(data);
this._trackerStats = this.buildTrackerStats(data.trackerStats);
this.refresh(data);
},
buildTrackerStats: function(trackerStats) {
result = []
var announce = [];
var result = [];
for (var i=0, tracker; tracker=trackerStats[i]; ++i) {
tier = result[tracker.tier] || []
tier.push(tracker)
result[tracker.tier] = tier
var tier = result[tracker.tier] || [];
tier.push(tracker);
result[tracker.tier] = tier;
announce.push(tracker.announce);
}
return result
this.fields.collatedTrackers = announce.join('\t');
return result;
},
initMetaData: function(data) {
var f = this.fields
var f = this.fields;
var changed = false;
// populate the metadata fields
for (var i=0, key; key=Torrent._MetaDataFields[i]; ++i) {
if (key in data) {
f[key] = data[key]
if (f[key] !== data[key]) {
f[key] = data[key];
if (key === 'name')
f.collatedName = data.name.toLowerCase()
f.collatedName = data.name.toLowerCase();
changed = true;
}
}
}
@@ -119,53 +128,78 @@ Torrent.prototype =
'torrent': this,
'length': row.length,
'name': row.name
};
}
}
}
return changed;
},
refreshMetaData: function(data)
{
this.initMetaData(data)
this.fireDataChanged()
var changed = this.initMetaData(data);
if (changed)
this.fireDataChanged();
return changed;
},
refresh: function(data)
{
var changed = false;
// FIXME: unnecessary coupling... this should be handled by transmission.js
if (this.needsMetaData() && (data.metadataPercentComplete >= 1))
transmission.refreshMetaData([ this.getId() ])
changed |= transmission.refreshMetaData([ this.getId() ]);
var f = this.fields
var f = this.fields;
// refresh the dynamic fields
for(var i=0, key; key=Torrent._DynamicFields[i]; ++i)
if(key in data)
f[key] = data[key]
for (var i=0, key; key=Torrent._DynamicFields[i]; ++i) {
if (key in data) {
if (f[key] !== data[key]) {
f[key] = data[key];
changed = true;
}
}
}
this._trackerStats = this.buildTrackerStats(data.trackerStats)
this._trackerStats = this.buildTrackerStats(data.trackerStats);
if (data.fileStats)
this.refreshFiles(data)
changed |= this.refreshFiles(data);
this.fireDataChanged()
if (changed)
this.fireDataChanged();
},
refreshFiles: function(data) {
var changed = false;
for (var i=0; i<data.fileStats.length; ++i) {
var src = data.fileStats[i]
var tgt = this._files[i]
if(!tgt)
tgt = this._files[i] = { }
tgt.wanted = src.wanted
tgt.priority = src.priority
tgt.bytesCompleted = src.bytesCompleted
var src = data.fileStats[i];
var tgt = this._files[i];
if (!tgt) {
changed = true;
tgt = this._files[i] = { };
}
if (tgt.wanted !== src.wanted) {
tgt.wanted = src.wanted;
changed = true;
}
if (tgt.priority !== src.priority) {
tgt.priority = src.priority;
changed = true;
}
if (tgt.bytesCompleted !== src.bytesCompleted) {
tgt.bytesCompleted = src.bytesCompleted;
changed = true;
}
}
return changed;
},
fireDataChanged: function()
{
$(this).trigger('dataChanged',[])
$(this).trigger('dataChanged');
},
/****
@@ -173,93 +207,94 @@ Torrent.prototype =
****/
// simple accessors
getCollatedName: function() { return this.fields.collatedName },
getComment: function() { return this.fields.comment },
getCreator: function() { return this.fields.creator },
getDateAdded: function() { return this.fields.addedDate },
getDateCreated: function() { return this.fields.dateCreated },
getDesiredAvailable: function() { return this.fields.desiredAvailable },
getDownloadDir: function() { return this.fields.downloadDir },
getDownloadSpeed: function() { return this.fields.rateDownload },
getDownloadedEver: function() { return this.fields.downloadedEver },
getError: function() { return this.fields.error },
getErrorString: function() { return this.fields.errorString },
getETA: function() { return this.fields.eta },
getHashString: function() { return this.fields.hashString },
getHaveValid: function() { return this.fields.haveValid },
getHave: function() { return this.getHaveValid() + this.fields.haveUnchecked },
getId: function() { return this.fields.id },
getLeftUntilDone: function() { return this.fields.leftUntilDone },
getMetadataPercentComplete: function() { return this.fields.metadataPercentComplete },
getName: function() { return this.fields.name },
getPeers: function() { return this.fields.peers },
getPeersConnected: function() { return this.fields.peersConnected },
getPeersGettingFromUs: function() { return this.fields.peersGettingFromUs },
getPeersSendingToUs: function() { return this.fields.peersSendingToUs },
getPieceCount: function() { return this.fields.pieceCount },
getPieceCount: function() { return this.fields.pieceCount },
getPieceSize: function() { return this.fields.pieceSize },
getPrivateFlag: function() { return this.fields.isPrivate },
getQueuePosition: function() { return this.fields.queuePosition },
getRecheckProgress: function() { return this.fields.recheckProgress },
getSeedRatioLimit: function() { return this.fields.seedRatioLimit },
getSeedRatioMode: function() { return this.fields.seedRatioMode },
getSizeWhenDone: function() { return this.fields.sizeWhenDone },
getStatus: function() { return this.fields.status },
getTotalSize: function() { return this.fields.totalSize },
getUploadSpeed: function() { return this.fields.rateUpload },
getUploadRatio: function() { return this.fields.uploadRatio },
getUploadedEver: function() { return this.fields.uploadedEver },
getWebseedsSendingToUs: function() { return this.fields.webseedsSendingToUs },
isFinished: function() { return this.fields.isFinished },
getCollatedName: function() { return this.fields.collatedName; },
getCollatedTrackers: function() { return this.fields.collatedTrackers; },
getComment: function() { return this.fields.comment; },
getCreator: function() { return this.fields.creator; },
getDateAdded: function() { return this.fields.addedDate; },
getDateCreated: function() { return this.fields.dateCreated; },
getDesiredAvailable: function() { return this.fields.desiredAvailable; },
getDownloadDir: function() { return this.fields.downloadDir; },
getDownloadSpeed: function() { return this.fields.rateDownload; },
getDownloadedEver: function() { return this.fields.downloadedEver; },
getError: function() { return this.fields.error; },
getErrorString: function() { return this.fields.errorString; },
getETA: function() { return this.fields.eta; },
getHashString: function() { return this.fields.hashString; },
getHaveValid: function() { return this.fields.haveValid; },
getHave: function() { return this.getHaveValid() + this.fields.haveUnchecked; },
getId: function() { return this.fields.id; },
getLeftUntilDone: function() { return this.fields.leftUntilDone; },
getMetadataPercentComplete: function() { return this.fields.metadataPercentComplete; },
getName: function() { return this.fields.name; },
getPeers: function() { return this.fields.peers; },
getPeersConnected: function() { return this.fields.peersConnected; },
getPeersGettingFromUs: function() { return this.fields.peersGettingFromUs; },
getPeersSendingToUs: function() { return this.fields.peersSendingToUs; },
getPieceCount: function() { return this.fields.pieceCount; },
getPieceCount: function() { return this.fields.pieceCount; },
getPieceSize: function() { return this.fields.pieceSize; },
getPrivateFlag: function() { return this.fields.isPrivate; },
getQueuePosition: function() { return this.fields.queuePosition; },
getRecheckProgress: function() { return this.fields.recheckProgress; },
getSeedRatioLimit: function() { return this.fields.seedRatioLimit; },
getSeedRatioMode: function() { return this.fields.seedRatioMode; },
getSizeWhenDone: function() { return this.fields.sizeWhenDone; },
getStatus: function() { return this.fields.status; },
getTotalSize: function() { return this.fields.totalSize; },
getUploadSpeed: function() { return this.fields.rateUpload; },
getUploadRatio: function() { return this.fields.uploadRatio; },
getUploadedEver: function() { return this.fields.uploadedEver; },
getWebseedsSendingToUs: function() { return this.fields.webseedsSendingToUs; },
isFinished: function() { return this.fields.isFinished; },
// derived accessors
isSeeding: function() { return this.getStatus() === Torrent._StatusSeed },
isStopped: function() { return this.getStatus() === Torrent._StatusStopped },
isChecking: function() { return this.getStatus() === Torrent._StatusCheck },
isDownloading: function() { return this.getStatus() === Torrent._StatusDownload },
isDone: function() { return this.getLeftUntilDone() < 1 },
needsMetaData: function(){ return this.getMetadataPercentComplete() < 1 },
getActivity: function() { return this.getDownloadSpeed() + this.getUploadSpeed() },
getPercentDoneStr: function() { return Transmission.fmt.percentString(100*this.getPercentDone()) },
isSeeding: function() { return this.getStatus() === Torrent._StatusSeed; },
isStopped: function() { return this.getStatus() === Torrent._StatusStopped; },
isChecking: function() { return this.getStatus() === Torrent._StatusCheck; },
isDownloading: function() { return this.getStatus() === Torrent._StatusDownload; },
isDone: function() { return this.getLeftUntilDone() < 1; },
needsMetaData: function(){ return this.getMetadataPercentComplete() < 1; },
getActivity: function() { return this.getDownloadSpeed() + this.getUploadSpeed(); },
getPercentDoneStr: function() { return Transmission.fmt.percentString(100*this.getPercentDone()); },
getPercentDone: function() {
var finalSize = this.getSizeWhenDone()
if(!finalSize) return 1.0
var left = this.getLeftUntilDone()
if(!left) return 1.0
return (finalSize - left) / finalSize
var finalSize = this.getSizeWhenDone();
if (!finalSize) return 1.0;
var left = this.getLeftUntilDone();
if (!left) return 1.0;
return (finalSize - left) / finalSize;
},
getStateString: function() {
switch(this.getStatus()) {
case Torrent._StatusStopped: return this.isFinished() ? 'Seeding complete' : 'Paused'
case Torrent._StatusCheckWait: return 'Queued for verification'
case Torrent._StatusCheck: return 'Verifying local data'
case Torrent._StatusDownloadWait: return 'Queued for download'
case Torrent._StatusDownload: return 'Downloading'
case Torrent._StatusSeedWait: return 'Queued for seeding'
case Torrent._StatusSeed: return 'Seeding'
default: return 'error'
case Torrent._StatusStopped: return this.isFinished() ? 'Seeding complete' : 'Paused';
case Torrent._StatusCheckWait: return 'Queued for verification';
case Torrent._StatusCheck: return 'Verifying local data';
case Torrent._StatusDownloadWait: return 'Queued for download';
case Torrent._StatusDownload: return 'Downloading';
case Torrent._StatusSeedWait: return 'Queued for seeding';
case Torrent._StatusSeed: return 'Seeding';
default: return 'error';
}
},
trackerStats: function() { return this._trackerStats },
trackerStats: function() { return this._trackerStats; },
seedRatioLimit: function(controller){
switch(this.getSeedRatioMode()) {
case Torrent._RatioUseGlobal: return controller.seedRatioLimit()
case Torrent._RatioUseLocal: return this.getSeedRatioLimit()
default: return -1
case Torrent._RatioUseGlobal: return controller.seedRatioLimit();
case Torrent._RatioUseLocal: return this.getSeedRatioLimit();
default: return -1;
}
},
getErrorMessage: function() {
var str = this.getErrorString()
var str = this.getErrorString();
switch(this.getError()) {
case Torrent._ErrTrackerWarning:
return 'Tracker returned a warning: ' + str
return 'Tracker returned a warning: ' + str;
case Torrent._ErrTrackerError:
return 'Tracker returned an error: ' + str
return 'Tracker returned an error: ' + str;
case Torrent._ErrLocalError:
return 'Error: ' + str
return 'Error: ' + str;
default:
return null
return null;
}
},
@@ -267,50 +302,53 @@ Torrent.prototype =
*****
****/
testState: function(state)
{
var s = this.getStatus();
switch(state)
{
case Prefs._FilterActive:
return this.getPeersGettingFromUs() > 0
|| this.getPeersSendingToUs() > 0
|| this.getWebseedsSendingToUs() > 0
|| this.isChecking();
case Prefs._FilterSeeding:
return (s === Torrent._StatusSeed)
|| (s === Torrent._StatusSeedWait);
case Prefs._FilterDownloading:
return (s === Torrent._StatusDownload)
|| (s === Torrent._StatusDownloadWait);
case Prefs._FilterPaused:
return this.isStopped();
case Prefs._FilterFinished:
return this.isFinished();
default:
return true;
}
},
/**
* @param filter one of Prefs._Filter*
* @param search substring to look for, or null
* @return true if it passes the test, false if it fails
*/
test: function(filter, search)
test: function(state, search, tracker)
{
var pass = false
var s = this.getStatus()
// flter by state...
var pass = this.testState(state);
switch(filter)
{
case Prefs._FilterActive:
pass = this.getPeersGettingFromUs() > 0
|| this.getPeersSendingToUs() > 0
|| this.getWebseedsSendingToUs() > 0
|| this.isChecking()
break
case Prefs._FilterSeeding:
pass = (s === Torrent._StatusSeed) || (s === Torrent._StatusSeedWait)
break
case Prefs._FilterDownloading:
pass = (s === Torrent._StatusDownload) || (s === Torrent._StatusDownloadWait)
break
case Prefs._FilterPaused:
pass = this.isStopped()
break
case Prefs._FilterFinished:
pass = this.isFinished()
break
default:
pass = true
break
}
if(!pass)
return false
if(!search || !search.length)
return pass
return this.getCollatedName().indexOf(search.toLowerCase()) !== -1
}
// maybe filter by text...
if (pass && search && search.length)
pass = this.getCollatedName().indexOf(search.toLowerCase()) !== -1;
// maybe filter by tracker...
if (pass && tracker && tracker.length)
pass = this.getCollatedTrackers().indexOf(tracker) !== -1;
return pass;
}
};
/***
@@ -321,47 +359,47 @@ Torrent.prototype =
Torrent.compareById = function(ta, tb)
{
return ta.getId() - tb.getId()
}
return ta.getId() - tb.getId();
};
Torrent.compareByName = function(ta, tb)
{
return ta.getCollatedName().compareTo(tb.getCollatedName())
|| Torrent.compareById(ta, tb)
}
|| Torrent.compareById(ta, tb);
};
Torrent.compareByQueue = function(ta, tb)
{
return ta.getQueuePosition() - tb.getQueuePosition()
}
return ta.getQueuePosition() - tb.getQueuePosition();
};
Torrent.compareByAge = function(ta, tb)
{
var a = ta.getDateAdded()
var b = tb.getDateAdded()
return (b - a) || Torrent.compareByQueue(ta, tb)
}
var a = ta.getDateAdded();
var b = tb.getDateAdded();
return (b - a) || Torrent.compareByQueue(ta, tb);
};
Torrent.compareByState = function(ta, tb)
{
var a = ta.getStatus()
var b = tb.getStatus()
return (b - a) || Torrent.compareByQueue(ta, tb)
}
var a = ta.getStatus();
var b = tb.getStatus();
return (b - a) || Torrent.compareByQueue(ta, tb);
};
Torrent.compareByActivity = function(ta, tb)
{
var a = ta.getActivity()
var b = tb.getActivity()
return (a - b) || Torrent.compareByState(ta, tb)
}
Torrent.compareByRatio = function(a, b)
var a = ta.getActivity();
var b = tb.getActivity();
return (b - a) || Torrent.compareByState(ta, tb);
};
Torrent.compareByRatio = function(ta, tb)
{
var a = Math.ratio(ta.getUploadedEver(), ta.getDownloadedEver())
var b = Math.ratio(tb.getUploadedEver(), tb.getDownloadedEver())
return (a - b) || Torrent.compareByState(ta, tb)
}
var a = Math.ratio(ta.getUploadedEver(), ta.getDownloadedEver());
var b = Math.ratio(tb.getUploadedEver(), tb.getDownloadedEver());
return (a - b) || Torrent.compareByState(ta, tb);
};
Torrent.compareByProgress = function(ta, tb)
{
var a = ta.getPercentDone()
var b = tb.getPercentDone()
return (a - b) || Torrent.compareByRatio(ta, tb)
}
var a = ta.getPercentDone();
var b = tb.getPercentDone();
return (a - b) || Torrent.compareByRatio(ta, tb);
};
/**
* @param torrents an array of Torrent objects
@@ -373,33 +411,30 @@ Torrent.sortTorrents = function(torrents, sortMethod, sortDirection)
switch(sortMethod)
{
case Prefs._SortByActivity:
torrents.sort(this.compareByActivity)
break
torrents.sort(this.compareByActivity);
break;
case Prefs._SortByAge:
torrents.sort(this.compareByAge)
break
torrents.sort(this.compareByAge);
break;
case Prefs._SortByQueue:
torrents.sort(this.compareByQueue)
break
torrents.sort(this.compareByQueue);
break;
case Prefs._SortByProgress:
torrents.sort(this.compareByProgress)
break
torrents.sort(this.compareByProgress);
break;
case Prefs._SortByState:
torrents.sort(this.compareByState)
break
case Prefs._SortByName:
torrents.sort(this.compareByName)
break
torrents.sort(this.compareByState);
break;
case Prefs._SortByRatio:
torrents.sort(this.compareByRatio)
break
torrents.sort(this.compareByRatio);
break;
default:
console.warn("unknown sort method: " + sortMethod)
break
torrents.sort(this.compareByName);
break;
}
if (sortDirection === Prefs._SortDescending)
torrents.reverse()
torrents.reverse();
return torrents
}
return torrents;
};

File diff suppressed because it is too large Load Diff

View File

@@ -109,8 +109,8 @@ TransmissionRemote.prototype =
dataType: 'json',
cache: false,
data: $.toJSON(data),
beforeSend: function(XHR){ remote.appendSessionId(XHR) },
error: function(request, error_string, exception){ remote.ajaxError(request, error_string, exception, ajaxSettings) },
beforeSend: function(XHR){ remote.appendSessionId(XHR); },
error: function(request, error_string, exception){ remote.ajaxError(request, error_string, exception, ajaxSettings); },
success: success,
async: async
};
@@ -119,19 +119,16 @@ TransmissionRemote.prototype =
},
loadDaemonPrefs: function(callback, async) {
var tr = this._controller;
var o = { method: 'session-get' };
this.sendRequest(o, callback, async);
},
checkPort: function(callback, async) {
var tr = this._controller;
var o = { method: 'port-test' };
this.sendRequest(o, callback, async);
},
loadDaemonStats: function(callback, async) {
var tr = this._controller;
var o = { method: 'session-stats' };
this.sendRequest(o, callback, async);
},
@@ -149,7 +146,7 @@ TransmissionRemote.prototype =
if (torrent_ids)
o.arguments.ids = torrent_ids;
this.sendRequest( o, function(data){ callback(data.arguments.torrents)} );
this.sendRequest(o, function(data){ callback(data.arguments.torrents);});
},
getMetaDataFor: function(torrent_ids, callback) {
@@ -176,7 +173,7 @@ TransmissionRemote.prototype =
}
};
this.sendRequest( o, function(data){ callback(data.arguments.torrents, data.arguments.removed)} );
this.sendRequest(o, function(data) {callback(data.arguments.torrents, data.arguments.removed);});
},
loadTorrentFiles: function(torrent_ids) {
@@ -242,9 +239,11 @@ TransmissionRemote.prototype =
}
};
if( torrents != null )
for( var i=0, len=torrents.length; i<len; ++i )
if (torrents) {
for (var i=0, len=torrents.length; i<len; ++i) {
o.arguments.ids.push(torrents[i].getId());
}
}
this.sendRequest(o, function() {
remote._controller.refreshTorrents();
});
@@ -284,20 +283,12 @@ TransmissionRemote.prototype =
updateBlocklist: function() {
var remote = this;
var o = {
method: 'blocklist-update',
method: 'blocklist-update'
};
this.sendRequest(o, function() {
remote._controller.loadDaemonPrefs();
});
},
/*
filesSelectAll: function( torrent_ids, files, callback ) {
this.sendTorrentSetRequests( 'torrent-set', torrent_ids, { 'files-wanted': files }, callback );
},
filesDeselectAll: function( torrent_ids, files, callback ) {
this.sendTorrentSetRequests( 'torrent-set', torrent_ids, { 'files-unwanted': files }, callback );
},
*/
// Added queue calls
moveTorrentsToTop: function(torrent_ids, callback) {

View File

@@ -2,6 +2,5 @@ datadir = ${datarootdir}/${PACKAGE_NAME}/${subdir}
dist_data_DATA = \
common.css \
ie6.css \
ie7.css \
iphone.css

View File

@@ -18,7 +18,6 @@ body {
text-align: center;
margin: 0 0 30px;
overflow: hidden;
z-index: 1;
}
img {
@@ -27,32 +26,27 @@ img {
a {
outline: 0;
-moz-outline: none;
}
/*--------------------------------------
*
* T O P M E N U
*
*--------------------------------------*/
div.torrent_global_menu {
/***
****
**** TOOLBAR
****
***/
#toolbar {
width: 100%;
height: 75px;
margin: 0;
background: transparent url('../images/graphics/chrome.png') left top repeat-x;
position: fixed;
left: 0;
right: 0;
top: 0;
border-bottom: 1px solid #888;
z-index: 3;
border: 1px outset #AEBBCB;
overflow: hidden;
-moz-user-select: none;
-webkit-user-select: none;
}
div.torrent_global_menu h1 {
#toolbar h1 {
height: inherit;
width: 205px;
text-indent: -9000px !important;
@@ -60,14 +54,14 @@ div.torrent_global_menu h1 {
margin: 0 0 0 5px;
}
div.torrent_global_menu ul {
#toolbar ul {
height: 50px;
margin: 0;
padding: 0 7px;
text-align: center;
}
div.torrent_global_menu ul li {
#toolbar ul li {
list-style-type: none;
list-style-image: none;
float: left;
@@ -77,12 +71,11 @@ div.torrent_global_menu ul li {
height: 50px;
}
div.torrent_global_menu ul li#filter,
div.torrent_global_menu ul li#inspector {
#toolbar #inspector {
float: right;
}
div.torrent_global_menu ul li > div {
#toolbar ul li > div {
color: #000;
font-size: 1.1em;
text-decoration: none;
@@ -94,84 +87,38 @@ div.torrent_global_menu ul li > div {
cursor: pointer;
}
div.torrent_global_menu ul li div.toolbar_image {
#toolbar ul li div.toolbar_image {
width: 32px;
height: 32px;
margin: 0 auto 5px;
background-image: url('../images/buttons/toolbar_buttons.png');
}
li#open div div.toolbar_image, li#open.disabled div:active div.toolbar_image {
background-position: left 0;
}
/* toolbar images */
li#open div div.toolbar_image { background-position: left 0px; }
li#open div:active div.toolbar_image { background-position: right 0px; }
li#remove div div.toolbar_image { background-position: left -32px; }
li#remove div:active div.toolbar_image { background-position: right -32px; }
li#resume_selected div div.toolbar_image { background-position: left -96px; }
li#resume_selected div:active div.toolbar_image { background-position: right -96px; }
li#pause_selected div div.toolbar_image { background-position: left -64px; }
li#pause_selected div:active div.toolbar_image { background-position: right -64px; }
li#pause_all div div.toolbar_image { background-position: left -128px; }
li#pause_all div:active div.toolbar_image { background-position: right -128px; }
li#resume_all div div.toolbar_image { background-position: left -160px; }
li#resume_all div:active div.toolbar_image { background-position: right -160px; }
li#filter div div.toolbar_image { background-position: left -192px; }
li#filter div:active div.toolbar_image { background-position: right -192px; }
li#inspector div div.toolbar_image { background-position: left -224px; }
li#inspector div:active div.toolbar_image { background-position: right -224px; }
li#open div:active div.toolbar_image {
background-position: right 0;
}
li#remove div div.toolbar_image, li#remove.disabled div:active div.toolbar_image {
background-position: left -32px;
}
li#remove div:active div.toolbar_image {
background-position: right -32px;
}
li#resume_selected div div.toolbar_image, li#resume_selected.disabled div:active div.toolbar_image {
background-position: left -96px;
}
li#resume_selected div:active div.toolbar_image {
background-position: right -96px;
}
li#pause_selected div div.toolbar_image, li#pause_selected.disabled div:active div.toolbar_image {
background-position: left -64px;
}
li#pause_selected div:active div.toolbar_image {
background-position: right -64px;
}
li#pause_all div div.toolbar_image, li#pause_all.disabled div:active div.toolbar_image {
background-position: left -128px;
}
li#pause_all div:active div.toolbar_image {
background-position: right -128px;
}
li#resume_all div div.toolbar_image, li#resume_all.disabled div:active div.toolbar_image {
background-position: left -160px;
}
li#resume_all div:active div.toolbar_image {
background-position: right -160px;
}
li#filter div div.toolbar_image, li#filter.disabled div:active div.toolbar_image {
background-position: left -192px;
}
li#filter div:active div.toolbar_image {
background-position: right -192px;
}
li#inspector div div.toolbar_image, li#inspector.disabled div:active div.toolbar_image {
background-position: left -224px;
}
li#inspector div:active div.toolbar_image {
background-position: right -224px;
}
div.torrent_global_menu ul li.disabled > div {
#toolbar ul li.disabled > div {
text-shadow: 0 1px 0 #fff;
opacity: 0.25;
cursor: default;
}
div.torrent_global_menu ul li.divider {
#toolbar ul li.divider {
width: 0;
border-right: 1px dotted black;
opacity: 0.2;
@@ -179,149 +126,58 @@ div.torrent_global_menu ul li.divider {
height: 49px;
}
/*--------------------------------------
*
* G L O B A L D E T A I L S
*
*--------------------------------------*/
/***
****
**** STATUSBAR
****
***/
div.torrent_global_details {
width: 100%;
height: 20px;
margin: 0;
background: #ddd url('../images/graphics/filter_bar.png') repeat-x left -51px;
font-size: 1.1em;
font-weight: normal;
border-bottom: 1px solid #888;
position: fixed;
left: 0;
right: 0;
top: 76px;
z-index: 2;
color: #000;
text-shadow: 0 1px 0 #f4f4f4;
}
div.torrent_global_details div {
padding: 0 10px 1px 10px;
margin: 3px 0 0 0;
}
div.torrent_global_details div#torrent_global_transfer {
clear: left;
float: left;
}
div.torrent_global_details div#torrent_global_upload,
div.torrent_global_details div#torrent_global_download {
float: right;
padding-left: 13px;
}
div.torrent_global_details div#torrent_global_upload {
background: url('../images/graphics/transfer_arrows.png') left -12px no-repeat;
}
div.torrent_global_details div#torrent_global_download {
background: url('../images/graphics/transfer_arrows.png') left 2px no-repeat;
}
/*--------------------------------------
*
* T O R R E N T F I L T E R B A R
*
*--------------------------------------*/
div#torrent_filter_bar {
margin: 0;
#statusbar {
background: #ACACAC;
border: 1px outset #AEBBCB;
height: 24px;
background: #ddd url('../images/graphics/filter_bar.png') repeat-x bottom left;
border-bottom: 1px solid #888;
position: fixed;
left: 0;
right: 0px;
top: 97px;
z-index: 2;
display: none;
width: 100%;
overflow: hidden;
position: relative;
}
div#torrent_filter_bar ul {
height: 17px;
margin: 0;
padding: 0;
#statusbar #speed-info {
margin-top: 5px;
margin-left: 45%;
text-align: left;
display: inline;
}
div#torrent_filter_bar ul li {
list-style-type: none;
list-style-image: none;
#statusbar #filter-button {
float: left;
padding: 0;
margin: 4px 0 0 5px;
vertical-align: middle;
height: 17px;
}
div#torrent_filter_bar ul li a {
border: none;
padding: 1px 5px;
text-shadow: 0 1px 0 #ccc;
border-radius: 2px;*/
font-size: 1.2em;
color: #222;
text-shadow: 0 1px 0 #fff;
text-decoration: none;
font-weight: bold;
padding: 0 7px 0 0;
margin: 0 0 0 7px;
height: 17px;
display: block;
cursor: default;
margin: 5px 4px 0px 4px;
-moz-user-select: none;
-webkit-user-select: none;
}
#statusbar #filter-button:hover {
cursor: pointer;
}
#statusbar #filter-button .filter-selection {
text-decoration: underline;
}
div#torrent_filter_bar ul li.selected, div#torrent_filter_bar ul li.selected a, div#torrent_filter_bar ul li:hover, div#torrent_filter_bar ul li:hover a, div#torrent_filter_bar ul li:active, div#torrent_filter_bar ul li:active a {
background-image: url('../images/graphics/filter_bar.png');
background-repeat: no-repeat;
text-shadow: 0 1px 0 #444;
color: #fff !important;
}
div#torrent_filter_bar ul li:hover {
background-position: left -17px;
}
div#torrent_filter_bar ul li:hover a {
background-position: right -17px;
}
div#torrent_filter_bar ul li:active {
background-position: left -34px;
}
div#torrent_filter_bar ul li:active a {
background-position: right -34px;
}
div#torrent_filter_bar ul li.selected {
background-position: left top;
}
div#torrent_filter_bar ul li.selected a {
background-position: right top;
}
div#torrent_filter_bar input#torrent_search {
#statusbar input#torrent_search {
float: right;
height: 15px;
width: 100px;
border: solid 0 #fff;
padding: 0 2px;
padding: 2px;
margin: 4px 5px 0 0;
position:absolute;
right: 0px;
top: 0px;
border-radius: 10px;
}
/* Safari-look filter input for Firefox */
@-moz-document url-prefix() {
div#torrent_filter_bar input#torrent_search {
div#statusbar input#torrent_search {
background: #FFF url('../images/graphics/filter_icon.png') top left no-repeat;
border: 1px solid #5D80A1;
margin-top: 3px;
@@ -334,19 +190,85 @@ div#torrent_filter_bar input#torrent_search {
}
}
div#torrent_filter_bar input#torrent_search.blur {
#statusbar input#torrent_search.blur {
color: #999;
}
/*--------------------------------------
*
* T O R R E N T C O N T A I N E R
*
*--------------------------------------*/
/***
****
**** FILTER POPUP
****
***/
#filter-popup .count {
padding-left: 3px;
}
#filter-popup {
color: #222;/* !important; */
background: #FFF;
z-index: 100;
}
#filter-popup #filter-by-state .row .filter-img {
display: none;
}
div#filter-popup #filter-by-state .row .filter-name {
left: 0px;
}
#filter-popup .row {
font-size: 1.2em;
text-align: left;
cursor: pointer;
margin: 8px 2px;
position: relative;
height: 18px;
-moz-user-select: none;
-webkit-user-select: none;
}
div#filter-popup .row .filter-img {
border: none;
width: 16px;
height: 16px;
position: absolute;
left: 0px;
}
#filter-popup .row .filter-name {
position: absolute;
left: 20px;
}
#filter-popup .row .count {
float: right;
color: #aaa;
}
#filter-popup li {
text-align: left
}
#filter-popup .row:hover,
#filter-popup .row.selected {
font-weight: bold;
}
#filter-popup #filter-by-state {
float: left;
width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
#filter-popup #filter-by-tracker {
float: right;
width: 130px;
overflow: hidden;
text-overflow: ellipsis;
}
/***
****
**** TORRENT CONTAINER
****
***/
div#torrent_container {
position: fixed;
top: 97px;
top: 102px;
bottom: 22px;
right: 0px;
left: 0px;
@@ -405,9 +327,14 @@ ul.torrent_list li.torrent div.torrent_name {
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
margin-top: 2px;
margin-bottom: 2px;
}
ul.torrent_list li.torrent div.torrent_name.compact {
font-weight: normal;
}
ul.torrent_list li.torrent div.torrent_name.paused {
font-size: 1.3em;
font-weight: normal;
@@ -461,9 +388,6 @@ ul.torrent_list div.torrent_progress_bar_container {
position: relative;
margin-top: 2px;
}
ul.torrent_list div.torrent_status_and_progress_bar {
/* float: right;*/
}
ul.torrent_list div.torrent_progress_bar_container.compact {
width: 50px;
position: absolute;
@@ -571,13 +495,13 @@ li.torrent a:active div.torrent_resume {
div#torrent_inspector {
position: fixed;
top: 97px;
top: 102px;
bottom: 22px;
right: 0px;
width: 570px;
background-color: #ddd;
border-left: 1px solid #888;
z-index: 2;
z-index: 5;
text-align: left;
overflow: auto;
}
@@ -587,7 +511,7 @@ div#torrent_inspector #torrent_inspector_name {
}
div#torrent_inspector #torrent_inspector_size {
font-size: 1.2em;
margin: 3;
margin: 3px;
display: block;
padding-top: 2px;
}
@@ -957,7 +881,7 @@ div.torrent_footer {
margin: 0;
padding: 0;
border-top: 1px solid #555;
background: #aaa url('../images/graphics/chrome.png') left bottom repeat-x;
background: #aaa url('../images/graphics/chrome.png') left -142px repeat-x;
position: fixed;
left: 0px;
right: 0px;
@@ -980,11 +904,11 @@ div.torrent_footer ul#settings_menu li#button {
}
div.torrent_footer ul#settings_menu li#button:active {
/background: transparent url('../images/graphics/chrome.png') -32px -75px no-repeat;
background: transparent url('../images/graphics/chrome.png') -32px -75px no-repeat;
}
div.torrent_footer ul#settings_menu li#button:hover {
/background: transparent url('../images/graphics/chrome.png') -32px -75px no-repeat;
background: transparent url('../images/graphics/chrome.png') -32px -75px no-repeat;
}
div.torrent_footer div#disk_space_container {
@@ -1018,6 +942,31 @@ div.torrent_footer div#turtle_button {
background: transparent url('../images/graphics/chrome.png') -32px -97px no-repeat;
}
div.torrent_footer #compact-button {
height: 22px;
width: 32px !important;
visibility: visible;
padding: 0;
float: left;
margin-left: 38px;
position: relative;
-moz-user-select: none;
-webkit-user-select: none;
}
div.torrent_footer #compact-button {
background: transparent url('../images/graphics/chrome.png') left -185px no-repeat;
}
div.torrent_footer #compact-button:active {
background: transparent url('../images/graphics/chrome.png') -32px -185px no-repeat;
}
div.torrent_footer #compact-button.enabled {
background: transparent url('../images/graphics/chrome.png') left -163px no-repeat;
}
div.torrent_footer #compact-button.enabled:active {
background: transparent url('../images/graphics/chrome.png') -32px -163px no-repeat;
}
/*--------------------------------------
*
@@ -1040,8 +989,6 @@ div.dialog_container {
div.dialog_container div.dialog_window {
background-color: #eee;
margin: 0 auto;
filter: alpha(opacity=95);
-moz-opacity: .95;
opacity: .95;
border-top: none;
text-align: left;
@@ -1371,8 +1318,6 @@ div#prefs_container div#pref_error {
.trans_menu ul {
min-width: 210px;
background-color: #fff;
filter: alpha(opacity=98);
-moz-opacity: .98;
opacity: .98;
padding: 5px 0;
text-align: left;

View File

@@ -1,89 +0,0 @@
div.torrent_global_menu ul li {
width: 60px;
}
div#torrent_filter_bar ul li {
width: 100px;
}
div.torrent_footer {
position: static;
}
div#torrent_container {
position: static;
top: 97px;
}
div#torrent_inspector {
position: absolute;
}
ul.torrent_list {
width: 98%;
}
ul.torrent_list li.even {
background-color: #EDF3FE !important;
zoom: 1.0;
}
ul.torrent_list li.selected {
background-color: #3879D7 !important;
color: #FFF;
zoom: 1.0;
}
div.torrent_footer ul#settings_menu li#button:active,
div.torrent_footer ul#settings_menu li#button:hover {
background-position: -32px -75px;
}
.trans_menu li.main li {
width: 100%;
}
.trans_menu li.active {
background-image: none !important;
}
.trans_menu li.hover {
z-index: 1 !important; /* the hover z-index has to be below the normal one the hovering items may be drawn over a submenu */
background-color: #24e;
color: #fff;
text-shadow: none;
margin-bottom: 0px;
margin-top: 0px;
}
div.torrent_footer ul#settings_menu li#button:active,
div.torrent_footer ul#settings_menu li#button:hover {
background-position: -32px -75px;
}
.trans_menu li.main li {
width: auto;
}
.trans_menu li.active {
background-image: none !important;
}
.trans_menu .innerBox li.hover {
z-index: 1 !important; /* the hover z-index has to be below the normal one the hovering items may be drawn over a submenu */
background-color: #24e !important;
color: #fff !important;
text-shadow: none;
}
.trans_menu ul {
width: 210px;
}
.trans_menu li.separator {
line-height: 0px;
height: 1px !important;
font-size: 0px;
width: auto;
}
.trans_menu li, .trans_menu li.active {
position: relative;
width: auto;
zoom: 1.0;
}
.trans_menu li span.arrow {
position: absolute;
right: 3px; top: 0px;
}
.trans_menu ul ul {
margin-left: 0px !important;
}
.trans_menu li .innerBox .outerbox {
top: auto !important;
bottom: 0px !important;
}

View File

@@ -23,15 +23,15 @@ body {
}
body div#torrent_container {
min-height: 295px;
min-height: 328px;
}
body div.dialog_container {
min-height: 291px;
min-height: 326px;
}
body div#torrent_inspector {
min-height: 323px;
min-height: 329px;
}
body.landscape div#torrent_container {
@@ -53,30 +53,29 @@ body.open_showing #torrent_filter_bar, body.open_showing #torrent_container {
display: none;
}
/*--------------------------------------
*
* T O P M E N U
*
*--------------------------------------*/
/***
****
**** TOOLBAR
****
***/
div.torrent_global_menu {
#toolbar {
width: 100%;
height: 55px;
margin: 0;
background: #6685a1 url('../images/graphics/iphone_chrome.png') top left repeat-x;
border-top: 1px solid #2d3642;
border-bottom: 1px solid #2d3642;
border: 1px outset #AEBBCB;
position: relative;
text-shadow: 0 -1px 0 #446;
}
div.torrent_global_menu ul {
#toolbar ul {
margin: 0;
padding: 0 3px;
text-align: left;
}
div.torrent_global_menu ul li {
#toolbar ul li {
list-style-type: none;
list-style-image: none;
padding: 0;
@@ -84,15 +83,14 @@ div.torrent_global_menu ul li {
display: inline-block;
}
li#remove, li#open {
#toolbar li#remove, li#open {
float: left;
}
li#resume_all, li#pause_all {
#toolbar li#resume_all, li#pause_all {
float: right;
}
div.torrent_global_menu ul li > div {
#toolbar ul li > div {
color: #fff;
font-size: 9px;
text-decoration: none;
@@ -105,172 +103,157 @@ div.torrent_global_menu ul li > div {
font-weight: bold;
}
div.torrent_global_menu ul li.disabled {
#toolbar ul li.disabled {
opacity: 0.25;
}
div.torrent_global_menu ul li div div.toolbar_image {
#toolbar ul li div div.toolbar_image {
width: 32px;
height: 32px;
margin: 0 auto 2px;
background-image: url('../images/buttons/toolbar_buttons.png');
}
div.torrent_global_menu ul li#remove div div.toolbar_image {
background-position: left -32px;
}
/* toolbar images */
li#open div div.toolbar_image { background-position: left 0px; }
li#open div:active div.toolbar_image { background-position: right 0px; }
li#remove div div.toolbar_image { background-position: left -32px; }
li#remove div:active div.toolbar_image { background-position: right -32px; }
li#resume_selected div div.toolbar_image { background-position: left -96px; }
li#resume_selected div:active div.toolbar_image { background-position: right -96px; }
li#pause_selected div div.toolbar_image { background-position: left -64px; }
li#pause_selected div:active div.toolbar_image { background-position: right -64px; }
li#pause_all div div.toolbar_image { background-position: left -128px; }
li#pause_all div:active div.toolbar_image { background-position: right -128px; }
li#resume_all div div.toolbar_image { background-position: left -160px; }
li#resume_all div:active div.toolbar_image { background-position: right -160px; }
li#filter div div.toolbar_image { background-position: left -192px; }
li#filter div:active div.toolbar_image { background-position: right -192px; }
li#inspector div div.toolbar_image { background-position: left -224px; }
li#inspector div:active div.toolbar_image { background-position: right -224px; }
div.torrent_global_menu ul li#resume_selected div div.toolbar_image {
background-position: left -96px;
}
div.torrent_global_menu ul li#pause_selected div div.toolbar_image {
background-position: left -64px;
}
div.torrent_global_menu ul li#pause_all div div.toolbar_image {
background-position: left -128px;
}
div.torrent_global_menu ul li#resume_all div div.toolbar_image {
background-position: left -160px;
}
div.torrent_global_menu ul li#filter, div.torrent_global_menu ul li#inspector {
#toolbar ul li#filter,
#toolbar ul li#inspector,
#toolbar ul li.divider {
display: none;
}
div.torrent_global_menu ul li.divider {
display: none;
}
/***
****
**** STATUSBAR
****
***/
/*--------------------------------------
*
* G L O B A L D E T A I L S
*
*--------------------------------------*/
div.torrent_global_details {
width: 100%;
height: 18px;
#statusbar {
margin: 0;
background: #6685a1 url('../images/graphics/iphone_chrome.png') bottom left repeat-x;
font-size: 12px;
border-bottom: 1px solid #2d3642;
position: relative;
left: 0;
right: 0;
top: 0;
z-index: 2;
color: #fff;
text-shadow: 0 -1px 0 #446;
background: #6B83A1;
border: 1px outset #AEBBCB;
width: 100%;
overflow: hidden;
position: relative;
text-align: left;
}
div.torrent_global_details div {
padding: 2px 5px;
margin: 1px 0 0 0;
}
div.torrent_global_details div#torrent_global_transfer {
clear: left;
float: left;
}
div.torrent_global_details div#torrent_global_upload,
div.torrent_global_details div#torrent_global_download {
#statusbar #speed-info {
margin-top: 3px;
float: right;
margin-right: 6px;
}
/*--------------------------------------
*
* T O R R E N T F I L T E R B A R
*
*--------------------------------------*/
div#torrent_filter_bar {
margin: 0;
height: 25px;
background: #ddd url('../images/graphics/filter_bar.png') repeat-x bottom left;
border-bottom: 1px solid #777;
position: relative;
width: 100%;
z-index: 2;
text-align: center;
#statusbar #filter-button {
float: left;
border: none;
font-size: 1.2em;
padding: 1px 6px;
margin-top: 1px;
overflow: hidden;
text-overflow: ellipsis;
-moz-user-select: none;
-webkit-user-select: none;
}
#statusbar #filter-button:hover {
cursor: pointer;
}
#statusbar #filter-button .filter-selection {
text-decoration: underline;
}
div#torrent_filter_bar ul {
margin: 0 !important;
padding: 5px 0 0;
text-align: center !important;
display: block;
width: 100%;
height: 15px;
list-style-type: none;
}
div#torrent_filter_bar ul li {
list-style-type: none;
list-style-image: none;
padding: 2px 0;
vertical-align: middle;
height: 17px;
display: inline;
}
div#torrent_filter_bar ul li a {
font-size: 12px !important;
color: #222;
text-shadow: 0 1px 1px #fff;
text-decoration: none;
font-weight: bold;
padding: 1px 7px 2px 0;
margin: 0 0 0 7px;
}
div#torrent_filter_bar ul li.selected, div#torrent_filter_bar ul li.selected a {
background-image: url('../images/graphics/filter_bar.png');
background-repeat: no-repeat;
text-shadow: 0 1px 1px #444;
color: #fff !important;
}
div#torrent_filter_bar ul li.selected {
background-position: left top;
}
div#torrent_filter_bar ul li.selected a {
background-position: right top;
}
div#torrent_filter_bar ul li a.finished {
#statusbar #torrent_search {
display: none;
}
div#torrent_filter_bar input#torrent_search {
position: absolute;
height: 20px;
left: 5px;
right: 5px;
bottom: 6px;
display: none;
/***
****
**** FILTER POPUP
****
***/
#filter-popup .count {
padding-left: 3px;
}
#filter-popup {
color: #222;/* !important; */
background: #FFF;
z-index: 100;
}
/*--------------------------------------
*
* T O R R E N T C O N T A I N E R
*
*--------------------------------------*/
div#torrent_container {
position: relative;
top: 0 !important;
right: 0px;
#filter-popup #filter-by-state .row .filter-img {
display: none;
}
div#filter-popup #filter-by-state .row .filter-name {
left: 0px;
padding: 0px;
margin: 0px;
}
#filter-popup .row {
font-size: 1.2em;
text-align: left;
cursor: pointer;
margin: 15px 2px;
position: relative;
height: 18px;
}
div#filter-popup .row .filter-img {
border: none;
width: 16px;
height: 16px;
position: absolute;
left: 0px;
}
#filter-popup .row .filter-name {
position: absolute;
left: 20px;
}
#filter-popup .row .count {
float: right;
color: #aaa;
}
#filter-popup li {
text-align: left
}
#filter-popup .row:hover,
#filter-popup .row.selected {
font-weight: bold;
}
#filter-popup #filter-by-state {
float: left;
width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
#filter-popup #filter-by-tracker {
float: right;
width: 130px;
overflow: hidden;
text-overflow: ellipsis;
}
/***
****
**** TORRENT CONTAINER
****
***/
ul.torrent_list {
width: 100%;
@@ -298,6 +281,10 @@ ul.torrent_list li.torrent {
background: white;
}
ul.torrent_list li.torrent.compact {
padding: 4px;
}
.torrent div.torrent_progress_details, .torrent div.torrent_peer_details {
clear: both;
white-space: nowrap;
@@ -316,11 +303,22 @@ ul.torrent_list li.torrent.selected {
ul.torrent_list li.torrent div.torrent_name {
font-size: 13px;
margin-bottom: 2px;
font-weight: bold;
word-wrap: break-word;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #222;
margin-bottom: 2px;
}
ul.torrent_list li.torrent div.torrent_name.compact {
font-weight: normal;
}
ul.torrent_list li.torrent div.torrent_name.paused {
font-size: 1.3em;
font-weight: normal;
color: #777;
}
ul.torrent_list li.torrent.selected div.torrent_name {
@@ -331,15 +329,40 @@ div.torrent_peer_details {
font-size: 10px;
}
/***
**** Progressbar
***/
/**
* Progressbar
*
* Each progressbar has three elemens: a parent container and two children,
* complete and incomplete.
*
* The only thing needed to set the progressbar percentage is to set
* the complete child's width as a percentage. This is because incomplete
* is pinned to the full width and height of the parent, and complete
* is pinned to the left side of the parent and has a higher z-index.
*
* The progressbar has different colors depending on its state, so there
* are four 'decorator' classNames: magnet, seeding, leeching, and paused.
*/
ul.torrent_list div.torrent_progress_bar_container {
height: 10px;
position: relative;
margin-top: 2px;
}
ul.torrent_list div.torrent_progress_bar_container.compact {
width: 50px;
position: absolute;
right: 10px;
margin-top: 2px;
/*float: right;*/
}
ul.torrent_list div.torrent_peer_details.compact {
font-size: 12px; /* matching the progressbar height (10px) + progressbar border (1px top, 1px bottom) */
margin-top: 2px;
margin-left: 10px;
margin-right: 65px; /* leave room on the right for the progressbar */
float: right; /* pins it next to progressbar & forces torrent_name to ellipsize when it bumps up against this div */
}
ul.torrent_list div.torrent_progress_bar_container.full {
margin-bottom: 5px;
}
@@ -870,11 +893,34 @@ iframe#torrent_upload_frame {
margin: 0;
}
div.torrent_footer div#turtle_button {
div.torrent_footer #compact-button {
position: absolute;
top: 0px;
right: 0px;
margin: 2px;
height: 18px;
width: 32px !important;
}
div.torrent_footer #compact-button {
background: transparent url('../images/graphics/chrome.png') left -31px no-repeat;
}
div.torrent_footer #compact-button.active {
background: transparent url('../images/graphics/chrome.png') -32px -31px no-repeat;
}
div.torrent_footer #compact-button.enabled {
background: transparent url('../images/graphics/chrome.png') left -53px no-repeat;
}
div.torrent_footer #compact-button.enabled.active {
background: transparent url('../images/graphics/chrome.png') -32px -53px no-repeat;
}
div.torrent_footer div#turtle_button {
position: absolute;
top: 0px;
left: 0px;
margin: 2px;
height: 18px;
width: 32px !important;
margin: 1px 0 0 3px;
padding: 0;
}
.turtleEnabled {
@@ -890,6 +936,28 @@ div.torrent_footer div#turtle_button {
background: transparent url('../images/graphics/chrome.png') -32px -99px no-repeat;
}
div.torrent_footer #compact-button {
position: absolute;
top: 0px;
right: 0px;
margin: 2px;
height: 18px;
width: 32px !important;
visibility: visible;
}
div.torrent_footer #compact-button {
background: transparent url('../images/graphics/chrome.png') left -187px no-repeat;
}
div.torrent_footer #compact-button:active {
background: transparent url('../images/graphics/chrome.png') -32px -187px no-repeat;
}
div.torrent_footer #compact-button.enabled {
background: transparent url('../images/graphics/chrome.png') left -165px no-repeat;
}
div.torrent_footer #compact-button.enabled:active {
background: transparent url('../images/graphics/chrome.png') -32px -165px no-repeat;
}
/*--------------------------------------
*
* Hide remnants of stuff we don't need, like