Skip to content

Commit 1a741e3

Browse files
committed
merge #225, adds torrent upload (via upload button and drag and drop), add SPACE pause/play, auto format a few files
1 parent bada577 commit 1a741e3

File tree

10 files changed

+427
-293
lines changed

10 files changed

+427
-293
lines changed

static/files.go

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/files/css/app.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,46 @@ table.tcld .name {
140140
.uploads .upload .size {
141141
width: 100px;
142142
}
143+
144+
[onfileclick] {
145+
cursor: pointer;
146+
}
147+
148+
[ondropfile] {
149+
position: relative;
150+
}
151+
152+
[ondropfile] .file-drop-cover {
153+
position: absolute;
154+
top: 0;
155+
left: 0;
156+
height: 100%;
157+
width: 102%;
158+
margin-top: 1%;
159+
margin-left: -1%;
160+
pointer-events: none;
161+
background: rgba(173, 216, 230, 0.5);
162+
opacity: 0;
163+
transition: opacity ease 0.3s;
164+
z-index: 5;
165+
overflow: hidden;
166+
}
167+
168+
[ondropfile] .file-drop-cover.shown {
169+
opacity: 1;
170+
}
171+
172+
[ondropfile] .file-drop-cover .dots {
173+
height: 100%;
174+
border: 1px dotted #333;
175+
border-radius: 3px;
176+
}
177+
178+
[ondropfile] .file-drop-cover .dots .msg {
179+
position: absolute;
180+
text-align: center;
181+
font-size: 2em;
182+
left: 0;
183+
top: 30px;
184+
width: 100%;
185+
}

static/files/css/sections/omni.css

Lines changed: 35 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,64 @@
1-
2-
31
.omni {
4-
margin-top: 5px;
2+
margin-top: 5px;
53
}
64

75
.omni .buttons {
8-
margin-top: 5px;
9-
text-align: center;
6+
margin-top: 5px;
7+
text-align: center;
108
}
119

1210
.omni .results {
13-
max-height: 200px;
14-
overflow-y: auto;
15-
border: 1px solid rgba(0,0,0,.15);
16-
margin-top: 5px;
17-
border-radius: 4px;
11+
max-height: 200px;
12+
overflow-y: auto;
13+
border: 1px solid rgba(0, 0, 0, 0.15);
14+
margin-top: 5px;
15+
border-radius: 4px;
1816
}
1917

2018
.omni .results .name {
21-
/*font-size: .75em;*/
22-
text-align: right;
19+
/*font-size: .75em;*/
20+
text-align: right;
2321
}
2422

2523
.omni .results .users {
26-
width: 75px;
27-
text-align: center;
24+
width: 75px;
25+
text-align: center;
2826
}
2927
.omni .results .seeds {
30-
color: #5bbd72;
28+
color: #5bbd72;
3129
}
3230

3331
.omni .results .peers {
34-
color: rgb(176, 127, 20);
32+
color: rgb(176, 127, 20);
3533
}
3634

3735
.omni .results .loadmore {
38-
text-align: right;
36+
text-align: right;
3937
}
4038

4139
.omni .search select {
42-
padding: 0 10px;
43-
margin-top: 0px;
44-
border-radius: 4px;
45-
background: #D58686;
46-
color: #888;
47-
border: none;
48-
outline: none;
49-
height: 31px;
50-
display: inline-block;
51-
-webkit-appearance: none;
52-
-moz-appearance: none;
53-
appearance: none;
54-
cursor: pointer;
40+
padding: 0 10px;
41+
margin-top: 0px;
42+
border-radius: 4px;
43+
background: #d58686;
44+
color: #888;
45+
border: none;
46+
outline: none;
47+
height: 31px;
48+
display: inline-block;
49+
-webkit-appearance: none;
50+
-moz-appearance: none;
51+
appearance: none;
52+
cursor: pointer;
5553
}
5654
.omni .form {
57-
margin-top: 5px;
58-
}
59-
60-
/*omni upload input icon*/
61-
62-
.upload-label {
63-
padding: 10px;
64-
cursor: pointer;
65-
}
66-
.upload-label .icon {
67-
margin-top: 8px;
68-
}
69-
.upload-icon{
70-
z-index: 99;
71-
position: absolute;
72-
right: 0;
73-
}
74-
.upload-icon input {
75-
display: none;
55+
margin-top: 5px;
7656
}
7757

78-
.omni input.dragging {
79-
opacity: 0.5;
80-
background: lightblue;
81-
z-index: 100;
58+
.icon-wrapper {
59+
z-index: 6;
60+
position: absolute;
61+
right: 0;
62+
padding: 10px;
63+
cursor: pointer;
8264
}

static/files/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
</head>
1616

1717
<body class="app">
18-
<div ng-cloak class="cage">
18+
<div ng-cloak class="cage" ondropfile="uploadTorrent($event)" placeholder="Drop torrent files here">
1919
<div ng-if="!connected" class="connect-warning ui inverted vertical masthead center aligned segment">
2020
<div class="ui text container">
2121
<h1 class="ui inverted header">
22-
Disconnected
22+
{{ hasConnected ? 'Disconnected' : 'Connecting' }}
2323
</h1>
2424
<h1 class="ui inverted header">
2525
<i class="red lightning icon"></i>

static/files/js/config-controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ app.controller("ConfigController", function($scope, $rootScope, storage, api) {
77
$scope.edit = b === undefined ? !$scope.edit : b;
88
};
99
$scope.submitConfig = function() {
10-
api.configure($rootScope.state.Config);
10+
var data = JSON.stringify($rootScope.state.Config);
11+
api.configure(data);
1112
};
1213
});

0 commit comments

Comments
 (0)