Skip to content

Commit

Permalink
add compact version for mobile; fixes #103
Browse files Browse the repository at this point in the history
  • Loading branch information
endor committed Sep 8, 2014
1 parent 22e4ac8 commit 8af5e1e
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 46 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -13,8 +13,11 @@ kettu osaa monta asiaa.
* kastigar for adding predefined locations.
* viveksjain and Shadow6363 for keyboard shortcuts and how numbers are displayed.

## Screenshot
![Screenshot](screenshot-1.png)
## Screenshots
### Desktop
![Screenshot Desktop](screenshot-1.png)
### Mobile
![Screenshot Mobile](screenshot-2.png)

## Installation
You can use kettu instead of the original web client to remotely administrate your transmission application.
Expand Down
Binary file added css/images/compact_mobile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 52 additions & 22 deletions css/mobile.css
Expand Up @@ -67,7 +67,7 @@ footer {
}

#torrents li.torrent {
height: 67px;
height: 76px;
-webkit-transition-property: background;
-webkit-transition-duration: 0.4s, 0.1s;
-webkit-transition-timing-function: linear, ease-in;
Expand All @@ -84,8 +84,12 @@ footer {
cursor: pointer;
}

#torrents li.torrent.compact {
height: 42px;
}

.torrent h3 {
font-size: 16px;
font-size: 14px;
}

.torrent.active {
Expand Down Expand Up @@ -133,7 +137,11 @@ footer {

.torrent .statusString {
color: #999;
font-size: 14px;
font-size: 10px;
}

.torrent.compact .statusString {
display: none;
}

.torrent .statusString.error {
Expand All @@ -145,10 +153,13 @@ footer {
}

.torrent .progressDetails {
display: none;
height: 16px;
font-size: 10px;
margin: 0px;
padding: 0px;
color: #555;
overflow: hidden;
width: 90%;
}

.torrent .progress {
Expand All @@ -159,10 +170,15 @@ footer {
.torrent .name {
overflow: hidden;
margin-bottom: 4px;
font-size: 14px;
}

.torrent.compact .name {
width: 88%;
}

#mobile-footer {
height: 45px;
height: 35px;
width: auto;
position: fixed;
bottom: 0;
Expand All @@ -177,30 +193,33 @@ footer {
padding-right: 2px;
}

#mobile-footer .globalUpAndDownload {
display: inline-block;
width: 28%;
text-align: right;
vertical-align: middle;
padding: 4px 0 0 0;
#mobile-header .globalUpAndDownload {
display: block;
position: absolute;
top: 1.4em;
right: 1em;
font-size: 11px;
font-weight: normal;
width: 78px;
height: 32px;
overflow: hidden;
}

#mobile-footer .links {
display: inline-block;
width: 67%;
vertical-align: middle;
display: block;
width: 100%;
margin: 0;
padding: 4px 0 0 0;
padding: 2px 0 0 0;
}

#mobile-footer .links li {
display: inline-block;
margin-right: 0.4em;
margin-right: 0.8em;
}

#mobile-footer .links li a {
width: 27px;
height: 27px;
width: 30px;
height: 30px;
display: block;
text-indent: -9999px;
}
Expand Down Expand Up @@ -235,14 +254,19 @@ footer {
background-size: 100%;
}

#mobile-footer .links li .compact_view {
background: transparent url(images/compact_mobile.png) no-repeat 0 0;
background-size: 100%;
}

#mobile-header {
height: 45px;
width: auto;
}

#mobile-header h1 {
font-size: 16px;
margin: 0.9em 0 0 19%;
margin: 0.9em 0 0 14%;
}

#mobile-header h1:before {
Expand Down Expand Up @@ -277,7 +301,11 @@ footer {
border: 0;
width: 24px;
height: 24px;
margin: 22px 5px 0 0;
margin: 26px 8px 0 0;
}

.torrent.compact .buttons .pauseAndActivateButton {
margin-top: 0;
}

.pauseAndActivateButton.paused, .pauseAndActivateButton.finished {
Expand All @@ -302,7 +330,7 @@ footer {
width: 100% !important;
padding: 0px;
margin-top: 60px;
margin-bottom: 58px;
margin-bottom: 46px;
}

.main {
Expand Down Expand Up @@ -587,7 +615,9 @@ footer {
}

.ui-progressbar {
margin: 4px 4px 4px 0;
margin: 6px 4px 4px 0;
height: 4px;
width: 90%;
}

#data {
Expand Down
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -61,6 +61,7 @@
<div id="mobile-header" class="ui-header ui-header-fixed ui-bar ui-bar-c">
<a href="#" class="back">Back</a>
<h1>Transmission</h1>
<div class="globalUpAndDownload"></div>
</div>

<div class="torrents_container">
Expand Down Expand Up @@ -93,9 +94,8 @@ <h1>Transmission</h1>
<li><a href="#/torrents/new" class="add_a_torrent">Add a Torrent</a></li>
<li><a href="#/statistics" class="statistics">Statistics</a></li>
<li><a href="#" class="speed_limit_mode">Enable Speed Limit Mode</a></li>
<li><a href="#" class="compact_view" title="Compact View">Enable Compact View</a></li>
</ul>

<div class="globalUpAndDownload"></div>
</div>
</div>

Expand All @@ -106,7 +106,7 @@ <h1>Transmission</h1>
<footer>
<nav id="footer">
<ul class="icon_nav">
<li><a href="#" id="compact_view" title="Compact View">Enable Compact View</a></li>
<li><a href="#" id="compact_view" class="compact_view" title="Compact View">Enable Compact View</a></li>
<li><a href="#" id="speed_limit_mode" class="speed_limit_mode" title="Speed Limit Mode">Enable Speed Limit Mode</a></li>
<li><a href="#" id="start_all" class="start_all" title="Start All">Start All</a></li>
<li><a href="#" id="stop_all" class="stop_all" title="Stop All">Stop All</a></li>
Expand Down
6 changes: 3 additions & 3 deletions js/helpers/link_helpers.js
Expand Up @@ -57,11 +57,11 @@ kettu.LinkHelpers = {
var context = this, redirect_path = '';

if(this.store.get('view_mode') === 'compact') {
$('#compact_view').addClass('active');
$('#compact_view').text('Disable Compact View');
$('.compact_view').addClass('active');
$('.compact_view').text('Disable Compact View');
}

$('#compact_view').click(function() {
$('.compact_view').click(function() {
if($(this).hasClass('active')) {
$(this).removeClass('active');
$(this).text('Enable Compact View');
Expand Down
10 changes: 3 additions & 7 deletions js/models/torrent.js
Expand Up @@ -166,14 +166,10 @@
var currentStatus = torrent.statusStringLocalized(torrent.status);
if(torrent.isActive() && !torrent.needsMetaData()) {
currentStatus += ' - ';
if(kettu.app.mobile) {
currentStatus += torrent.etaString();
if(torrent.isDoneDownloading()) {
currentStatus += torrent.uploadRateString(torrent.rateUpload);
} else {
if(torrent.isDoneDownloading()) {
currentStatus += torrent.uploadRateString(torrent.rateUpload);
} else {
currentStatus += torrent.downAndUploadRateString(torrent.rateDownload, torrent.rateUpload);
}
currentStatus += torrent.downAndUploadRateString(torrent.rateDownload, torrent.rateUpload);
}
} else if (torrent.isFinished()) {
currentStatus = 'Finished';
Expand Down
2 changes: 1 addition & 1 deletion js/views/torrents.js
Expand Up @@ -49,7 +49,7 @@ kettu.TorrentsView = function(torrent, context) {
view.cachePartial = context.cachePartial;

if(kettu.app.mobile) {
view.name = context.shorten(view.name, 27);
view.name = context.shorten(view.name, 32);
}

return view;
Expand Down
Binary file added screenshot-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions spec/index.html
Expand Up @@ -91,8 +91,8 @@ <h1>Transmission</h1>
<footer>
<nav id="footer">
<ul class="icon_nav">
<li><a href="#" id="compact_view" title="Compact View">Enable Compact View</a></li>
<li><a href="#" id="speed_limit_mode" title="Speed Limit Mode">Enable Speed Limit Mode</a></li>
<li><a href="#" id="compact_view" class="compact_view" title="Compact View">Enable Compact View</a></li>
<li><a href="#" id="speed_limit_mode" class="speed_limit_mode" title="Speed Limit Mode">Enable Speed Limit Mode</a></li>
<li><a href="#" id="start_all" class="start_all" title="Start All">Start All</a></li>
<li><a href="#" id="stop_all" class="stop_all" title="Stop All">Stop All</a></li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/context_menu_spec.js
Expand Up @@ -10,8 +10,8 @@ describe('context menu', function() {
var data = JSON.parse(window.lastRequest.data);
expect(data.method).to.eql('torrent-reannounce');
done();
}, 50);
}, 50);
}, 100);
}, 100);
});
});
});
4 changes: 2 additions & 2 deletions spec/integration/settings_spec.js
@@ -1,11 +1,11 @@
describe('settings', function() {
it('lets me toggle the speed limit mode', function(done) {
$('#speed_limit_mode').click();
$('.speed_limit_mode').click();
setTimeout(function() {
var data = JSON.parse(window.lastRequest.data);
expect(data["arguments"]["alt-speed-enabled"]).to.be(true);

$('#speed_limit_mode').click();
$('.speed_limit_mode').click();
setTimeout(function() {
var data = JSON.parse(window.lastRequest.data);
expect(data["arguments"]["alt-speed-enabled"]).to.be(false);
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/torrents_spec.js
Expand Up @@ -31,10 +31,10 @@ describe('torrents', function() {

kettu.helpers.waitForReload(function() {
expect($torrents.find('.progressDetails')).to.have.length(1);
$('#compact_view').click();
$('.compact_view').click();
setTimeout(function() {
expect($torrents.find('.progressDetails')).to.have.length(0);
$('#compact_view').click();
$('.compact_view').click();
setTimeout(function() {
expect($torrents.find('.progressDetails')).to.have.length(1);
done();
Expand Down

0 comments on commit 8af5e1e

Please sign in to comment.