Skip to content

Commit 484d955

Browse files
albertonyroucc
authored andcommitted
lib/http: cleanup indentation and other whitespace in http serve template
1 parent 8fa9f25 commit 484d955

1 file changed

Lines changed: 32 additions & 43 deletions

File tree

lib/http/templates/index.html

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
// Copyright 2015 Matthew Holt and The Caddy Authors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,7 +11,7 @@
1111
// distributed under the License is distributed on an "AS IS" BASIS,
1212
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
// See the License for the specific language governing permissions and
14-
// limitations under the License.
14+
// limitations under the License.
1515
Modifications: Adapted to rclone markup -->
1616

1717
<!DOCTYPE html>
@@ -188,17 +188,17 @@
188188
}
189189
}
190190
td .zip {
191-
opacity: 0;
192-
margin-left: 6px;
193-
transition: opacity 0.15s ease-in-out;
191+
opacity: 0;
192+
margin-left: 6px;
193+
transition: opacity 0.15s ease-in-out;
194194
}
195195
tr.file:hover td .zip {
196-
opacity: 1;
196+
opacity: 1;
197197
}
198198
.zip-root {
199-
margin-left: 8px;
200-
vertical-align: middle;
201-
opacity: 1;
199+
margin-left: 8px;
200+
vertical-align: middle;
201+
opacity: 1;
202202
}
203203
</style>
204204
</head>
@@ -219,9 +219,9 @@
219219
<path d="M126.154134,250.559184 C126.850974,251.883673 127.300549,253.006122 127.772602,254.106122 C128.469442,255.206122 128.919016,256.104082 129.638335,257.002041 C130.559962,258.326531 131.728855,259 133.100057,259 C134.493737,259 135.415364,258.55102 136.112204,257.67551 C136.809044,257.002041 137.258619,255.902041 137.258619,254.577551 C137.258619,253.904082 137.258619,252.804082 137.033832,251.457143 C136.786566,249.908163 136.561779,249.032653 136.561779,248.583673 C136.089726,242.814286 135.864939,237.920408 135.864939,233.273469 C135.864939,225.057143 136.786566,217.514286 138.180246,210.846939 C139.798713,204.202041 141.889234,198.634694 144.429328,193.763265 C147.216689,188.869388 150.678411,184.873469 154.836973,181.326531 C158.995535,177.779592 163.626149,174.883673 168.481552,172.661224 C173.336954,170.438776 179.113983,168.665306 185.587852,167.340816 C192.061722,166.218367 198.760378,165.342857 205.481514,164.669388 C212.18017,164.220408 219.598146,163.995918 228.162535,163.995918 L246.055591,163.995918 L246.055591,195.514286 C246.055591,197.736735 246.752431,199.510204 248.370899,201.059184 C250.214153,202.608163 252.079886,203.506122 254.372715,203.506122 C256.463236,203.506122 258.531277,202.608163 260.172223,201.059184 L326.102289,137.797959 C327.720757,136.24898 328.642384,134.47551 328.642384,132.253061 C328.642384,130.030612 327.720757,128.257143 326.102289,126.708163 L260.172223,63.4469388 C258.553756,61.8979592 256.463236,61 254.395194,61 C252.079886,61 250.236632,61.8979592 248.393377,63.4469388 C246.77491,64.9959184 246.07807,66.7693878 246.07807,68.9918367 L246.07807,100.510204 L228.162535,100.510204 C166.863084,100.510204 129.166282,117.167347 115.274437,150.459184 C110.666301,161.54898 108.350993,175.310204 108.350993,191.742857 C108.350993,205.279592 113.903236,223.912245 124.760454,247.438776 C125.00772,248.112245 125.457294,249.010204 126.154134,250.559184 Z" id="Shape" fill="#FFFFFF" transform="translate(218.496689, 160.000000) scale(-1, 1) translate(-218.496689, -160.000000) "></path>
220220
</g>
221221
</g>
222-
<g id="zip-folder">
223-
<path d="M640-480v-80h80v80h-80Zm0 80h-80v-80h80v80Zm0 80v-80h80v80h-80ZM447-640l-80-80H160v480h400v-80h80v80h160v-400H640v80h-80v-80H447ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80v-480 480Z"/>
224-
</g>
222+
<g id="zip-folder">
223+
<path d="M640-480v-80h80v80h-80Zm0 80h-80v-80h80v80Zm0 80v-80h80v80h-80ZM447-640l-80-80H160v480h400v-80h80v80h160v-400H640v80h-80v-80H447ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80v-480 480Z"/>
224+
</g>
225225
<!-- File -->
226226
<g id="file" stroke="#000" stroke-width="25" fill="#FFF" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
227227
<path d="M13 24.12v274.76c0 6.16 5.87 11.12 13.17 11.12H239c7.3 0 13.17-4.96 13.17-11.12V136.15S132.6 13 128.37 13H26.17C18.87 13 13 17.96 13 24.12z"/>
@@ -249,15 +249,13 @@
249249
<header>
250250
<h1>
251251
{{range $i, $crumb := .Breadcrumb}}<a href="{{html $crumb.Link}}">{{html $crumb.Text}}</a>{{if ne $i 0}}/{{end}}{{end}}
252-
253-
{{- if not .DisableZip}}
254-
<a class="zip-root" href="{{html .ZipURL}}" title="Download root as .zip">
255-
<svg width="1.5em" height="1.5em" viewBox="0 -960 960 960">
256-
<use xlink:href="#zip-folder"></use>
257-
</svg>
258-
</a>
259-
{{- end}}
260-
252+
{{- if not .DisableZip}}
253+
<a class="zip-root" href="{{html .ZipURL}}" title="Download root as .zip">
254+
<svg width="1.5em" height="1.5em" viewBox="0 -960 960 960">
255+
<use xlink:href="#zip-folder"></use>
256+
</svg>
257+
</a>
258+
{{- end}}
261259
</h1>
262260
</header>
263261
<main>
@@ -273,7 +271,6 @@ <h1>
273271
<th></th>
274272
<th>
275273
<a href="?sort=namedirfirst&order=asc" class="icon sort order"><svg class="top" width="1em" height=".5em" version="1.1" viewBox="0 0 12.922194 6.0358899"><use xlink:href="#up-arrow"></use></svg><svg class="bottom" width="1em" height=".5em" version="1.1" viewBox="0 0 12.922194 6.0358899"><use xlink:href="#down-arrow"></use></svg></a>
276-
277274
<a href="?sort=name&order=asc" class="order">Name</a>
278275
</th>
279276
<th>
@@ -308,13 +305,13 @@ <h1>
308305
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 265 323"><use xlink:href="#file"></use></svg>
309306
{{- end}}
310307
<span class="name"><a href="{{html .URL}}">{{html .Leaf}}</a></span>
311-
{{- if and .IsDir (not $.DisableZip)}}
312-
<a class="zip" href="{{html .ZipURL}}" title="Download folder as .zip">
313-
<svg width="1.5em" height="1.5em" viewBox="0 -960 960 960">
314-
<use xlink:href="#zip-folder"></use>
315-
</svg>
316-
</a>
317-
{{- end}}
308+
{{- if and .IsDir (not $.DisableZip)}}
309+
<a class="zip" href="{{html .ZipURL}}" title="Download folder as .zip">
310+
<svg width="1.5em" height="1.5em" viewBox="0 -960 960 960">
311+
<use xlink:href="#zip-folder"></use>
312+
</svg>
313+
</a>
314+
{{- end}}
318315
</td>
319316
{{- if .IsDir}}
320317
<td data-order="-1">&mdash;</td>
@@ -368,31 +365,25 @@ <h1>
368365
}
369366
var timeList = Array.prototype.slice.call(document.getElementsByTagName("time"));
370367
timeList.forEach(localizeDatetime);
371-
372368
var getUrlParameter = function getUrlParameter(sParam) {
373-
var sPageURL = window.location.search.substring(1),
374-
sURLVariables = sPageURL.split('&'),
375-
sParameterName,
376-
i;
377-
378-
for (i = 0; i < sURLVariables.length; i++) {
379-
sParameterName = sURLVariables[i].split('=');
380-
369+
var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&')
370+
for (var i = 0; i < sURLVariables.length; i++) {
371+
var sParameterName = sURLVariables[i].split('=');
381372
if (sParameterName[0] === sParam) {
382373
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
383374
}
384375
}
385376
};
386-
function toggle(className){
377+
function toggle(className) {
387378
var order = getUrlParameter('order');
388379
var elements = document.getElementsByClassName(className);
389380
for(var i = 0, length = elements.length; i < length; i++) {
390381
var currHref = elements[i].href;
391-
if(order=='desc'){
382+
if(order=='desc') {
392383
var chg = currHref.replace('desc', 'asc');
393384
elements[i].href = chg;
394385
}
395-
if(order=='asc'){
386+
if(order=='asc') {
396387
var chg = currHref.replace('asc', 'desc');
397388
elements[i].href = chg;
398389
}
@@ -407,10 +398,8 @@ <h1>
407398
}
408399
return parseFloat(size).toFixed(2) + ' ' + units[i];
409400
}
410-
411401
function changeSize() {
412402
var sizes = document.getElementsByTagName("size");
413-
414403
for (var i = 0; i < sizes.length; i++) {
415404
humanSize = readableFileSize(sizes[i].innerHTML);
416405
sizes[i].innerHTML = humanSize

0 commit comments

Comments
 (0)