1
0
mirror of https://github.com/oupala/apaxy.git synced 2025-08-18 01:41:34 +02:00

Merge pull request #108 from PeterDaveHelloKitchen/format-improvement

Improve code readability, maintainability, style
This commit is contained in:
oupala
2018-02-27 20:56:39 +01:00
committed by GitHub
7 changed files with 163 additions and 137 deletions

View File

@@ -3,8 +3,8 @@ document.getElementsByTagName('tr')[1].className = 'parent';
// fix links when not adding a / at the end of the URI // fix links when not adding a / at the end of the URI
var uri = window.location.pathname.substr(1); var uri = window.location.pathname.substr(1);
if (uri.substring(uri.length - 1) != '/') { if (uri.substring(uri.length - 1) != '/') {
var indexes = document.getElementsByClassName('indexcolname'), var indexes = document.getElementsByClassName('indexcolname');
i = indexes.length; var i = indexes.length;
while (i--) { while (i--) {
var a = indexes[i].getElementsByTagName('a')[0]; var a = indexes[i].getElementsByTagName('a')[0];
a.href = '/' + uri + '/' + a.getAttribute('href', 2); a.href = '/' + uri + '/' + a.getAttribute('href', 2);

View File

@@ -10,13 +10,14 @@ button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-bloc
\*------------------------------------*/ \*------------------------------------*/
@import url('//fonts.googleapis.com/css?family=Open+Sans'); @import url('//fonts.googleapis.com/css?family=Open+Sans');
/* Have to use @import for the font, as you can only specify a single stylesheet */ /* Have to use @import for the font, as you can only specify a single stylesheet */
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing: border-box; box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
} }
html { html {
@@ -29,76 +30,96 @@ html {
font-family: 'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
line-height: 2em; line-height: 2em;
} }
body { body {
padding: 20px; padding: 20px;
-webkit-backface-visibility: hidden; -webkit-backface-visibility: hidden;
} }
code { code {
font-family: consolas,monospace; font-family: consolas,monospace;
} }
a { a {
color: #61666c; color: #61666c;
text-decoration: none; text-decoration: none;
} }
a, img { a, img {
border: none; border: none;
outline:none outline: none;
} }
a:hover { a:hover {
color: #2a2a2a; color: #2a2a2a;
} }
/*------------------------------------*\ /*------------------------------------*\
Wrapper Wrapper
\*------------------------------------*/ \*------------------------------------*/
.wrapper { .wrapper {
margin: 0 auto; margin: 0 auto;
padding-top: 20px; padding-top: 20px;
max-width: 80%; max-width: 80%;
} }
/*------------------------------------*\ /*------------------------------------*\
Demo block Demo block
\*------------------------------------*/ \*------------------------------------*/
.block { .block {
font-size: .875em; font-size: .875em;
margin: 20px 0; margin: 20px 0;
padding: 20px; padding: 20px;
color: #9099A3; color: #9099A3;
} }
/*------------------------------------*\ /*------------------------------------*\
Table (directory listing) Table (directory listing)
\*------------------------------------*/ \*------------------------------------*/
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: .875em; font-size: .875em;
} }
tr { tr {
outline: 0; outline: 0;
border: 0; border: 0;
} }
tr:hover td { tr:hover td {
background: #f6f6f6; background: #f6f6f6;
} }
th { th {
text-align: left; text-align: left;
font-size: .75em; font-size: .75em;
padding-right: 20px; padding-right: 20px;
} }
/* 2nd Column: Filename */ /* 2nd Column: Filename */
th + th { th + th {
width: 65%; width: 65%;
} }
/* 3rd Column: Last Modified */ /* 3rd Column: Last Modified */
th + th + th { th + th + th {
} }
/* 4th Column: Size */ /* 4th Column: Size */
th + th + th + th { th + th + th + th {
width: 5%; width: 5%;
} }
tr td:first-of-type { tr td:first-of-type {
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
td { td {
padding: 5px 0; padding: 5px 0;
outline: 0; outline: 0;
@@ -106,24 +127,29 @@ td {
border-bottom: 1px solid #edf1f5; border-bottom: 1px solid #edf1f5;
vertical-align: middle; vertical-align: middle;
text-align: left; text-align: left;
-webkit-transition:background 300ms ease;
-moz-transition:background 300ms ease;
-ms-transition:background 300ms ease;
-o-transition:background 300ms ease;
transition: background 300ms ease; transition: background 300ms ease;
-o-transition: background 300ms ease;
-ms-transition: background 300ms ease;
-moz-transition: background 300ms ease;
-webkit-transition: background 300ms ease;
} }
td a { td a {
display: block; display: block;
} }
tr.parent a[href^="/"] { tr.parent a[href^="/"] {
color: #9099A3; color: #9099A3;
} }
.parent a[href^="/"]:hover { .parent a[href^="/"]:hover {
color: #2281d0; color: #2281d0;
} }
/*------------------------------------*\ /*------------------------------------*\
Footer Footer
\*------------------------------------*/ \*------------------------------------*/
.footer { .footer {
text-align: center; text-align: center;
font-size: .75em; font-size: .75em;