From c706998a5a5412aacd3e1d69d3a58d1ee7b8c978 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 3 Jan 2017 17:35:13 +0000 Subject: [PATCH] identation and stuff --- .jsbeautifyrc | 22 + _embed/public/css/.jsbeautifyrc | 11 - _embed/public/css/fonts.css | 178 +-- _embed/public/css/normalize.css | 2 +- _embed/public/css/styles.css | 1669 +++++++++++++------------ _embed/public/js/common.js | 855 ++++++------- _embed/public/js/editor.js | 90 +- _embed/public/js/listing.js | 175 ++- _embed/public/js/vendor/.jsbeautifyrc | 32 - _embed/templates/.jsbeautifyrc | 16 - _embed/templates/base.tmpl | 4 +- 11 files changed, 1515 insertions(+), 1539 deletions(-) create mode 100644 .jsbeautifyrc delete mode 100644 _embed/public/css/.jsbeautifyrc delete mode 100644 _embed/public/js/vendor/.jsbeautifyrc delete mode 100644 _embed/templates/.jsbeautifyrc diff --git a/.jsbeautifyrc b/.jsbeautifyrc new file mode 100644 index 00000000..71f718e7 --- /dev/null +++ b/.jsbeautifyrc @@ -0,0 +1,22 @@ +{ + "html": { + "brace_style": "collapse", + "indent_scripts": "normal", + "max_preserve_newlines": 1, + "preserve_newlines": true, + "unformatted": ["a", "sub", "sup", "b", "i", "u"], + "wrap_line_length": 0 + }, + "css": { + "end_with_newline": false, + "newline_between_rules": true, + "selector_separator": " ", + "selector_separator_newline": true + }, + "js": { + "indent_with_tabs": false, + "preserve_newlines": true, + "max_preserve_newlines": 2, + "jslint_happy": true + } +} diff --git a/_embed/public/css/.jsbeautifyrc b/_embed/public/css/.jsbeautifyrc deleted file mode 100644 index 9d9f6d3e..00000000 --- a/_embed/public/css/.jsbeautifyrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "css": { - "allowed_file_extensions": ["css", "scss", "sass", "less"], - "end_with_newline": false, // End output with newline - "indent_char": " ", // Indentation character - "indent_size": 4, // Indentation size - "newline_between_rules": true, // Add a new line after every css rule - "selector_separator": " ", - "selector_separator_newline": true // Separate selectors with newline or not (e.g. "a,\nbr" or "a, br") - } -} diff --git a/_embed/public/css/fonts.css b/_embed/public/css/fonts.css index 93202bfd..1911d377 100644 --- a/_embed/public/css/fonts.css +++ b/_embed/public/css/fonts.css @@ -1,137 +1,137 @@ @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-cyrillic-ext.woff2) format('woff2'); - unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-cyrillic-ext.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-cyrillic.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-cyrillic.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-greek-ext.woff2) format('woff2'); - unicode-range: U+1F00-1FFF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-greek-ext.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-greek.woff2) format('woff2'); - unicode-range: U+0370-03FF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-greek.woff2) format('woff2'); + unicode-range: U+0370-03FF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-vietnamese.woff2) format('woff2'); - unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-vietnamese.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-latin-ext.woff2) format('woff2'); - unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-latin-ext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-latin.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(roboto/normal-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-cyrillic-ext.woff2) format('woff2'); - unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-cyrillic-ext.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-cyrillic.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-cyrillic.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-greek-ext.woff2) format('woff2'); - unicode-range: U+1F00-1FFF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-greek-ext.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-greek.woff2) format('woff2'); - unicode-range: U+0370-03FF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-greek.woff2) format('woff2'); + unicode-range: U+0370-03FF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-vietnamese.woff2) format('woff2'); - unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-vietnamese.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-latin-ext.woff2) format('woff2'); - unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-latin-ext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: 'Roboto'; - font-style: normal; - font-weight: 500; - src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-latin.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(roboto/medium-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { - font-family: 'Material Icons'; - font-style: normal; - font-weight: 400; - src: local('Material Icons'), local('MaterialIcons-Regular'), url(material/icons.woff2) format('woff2'); + font-family: 'Material Icons'; + font-style: normal; + font-weight: 400; + src: local('Material Icons'), local('MaterialIcons-Regular'), url(material/icons.woff2) format('woff2'); } .prompt .file-list ul li:before, .material-icons { - font-family: 'Material Icons'; - font-weight: normal; - font-style: normal; - font-size: 24px; - line-height: 1; - letter-spacing: normal; - text-transform: none; - display: inline-block; - white-space: nowrap; - word-wrap: normal; - direction: ltr; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - font-feature-settings: 'liga'; + font-family: 'Material Icons'; + font-weight: normal; + font-style: normal; + font-size: 24px; + line-height: 1; + letter-spacing: normal; + text-transform: none; + display: inline-block; + white-space: nowrap; + word-wrap: normal; + direction: ltr; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + font-feature-settings: 'liga'; } diff --git a/_embed/public/css/normalize.css b/_embed/public/css/normalize.css index 01ee6971..9b77e0eb 100644 --- a/_embed/public/css/normalize.css +++ b/_embed/public/css/normalize.css @@ -458,4 +458,4 @@ template { [hidden] { display: none; -} \ No newline at end of file +} diff --git a/_embed/public/css/styles.css b/_embed/public/css/styles.css index 5cf7a8dc..47d38520 100644 --- a/_embed/public/css/styles.css +++ b/_embed/public/css/styles.css @@ -1,75 +1,75 @@ body { - font-family: 'Roboto', sans-serif; - padding-top: 7.8em; - background-color: #f8f8f8; + font-family: 'Roboto', sans-serif; + padding-top: 7.8em; + background-color: #f8f8f8; } * { - box-sizing: border-box; + box-sizing: border-box; } *, *:hover, *:active, *:focus { - outline: 0 + outline: 0 } a { - text-decoration: none; + text-decoration: none; } img { - max-width: 100%; + max-width: 100%; } audio, video { - width: 100%; + width: 100%; } pre { - padding: 1em; - border: 1px solid #e6e6e6; - border-radius: 0.5em; - background-color: #f5f5f5; - white-space: pre-wrap; - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - word-wrap: break-word; + padding: 1em; + border: 1px solid #e6e6e6; + border-radius: 0.5em; + background-color: #f5f5f5; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; } button { - border: 0; - padding: .5em 1em; - margin-left: .5em; - border-radius: .1em; - background-color; - cursor: pointer; - background: #2196f3; - color: #fff; - border: 1px solid rgba(0, 0, 0, 0.05); - box-shadow: 0 0 5px rgba(0, 0, 0, 0.05); - transition: .1s ease all; + border: 0; + padding: .5em 1em; + margin-left: .5em; + border-radius: .1em; + background-color; + cursor: pointer; + background: #2196f3; + color: #fff; + border: 1px solid rgba(0, 0, 0, 0.05); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.05); + transition: .1s ease all; } button:hover { - background-color: #1E88E5; + background-color: #1E88E5; } .mobile-only { - display: none !important; + display: none !important; } .container { - width: 95%; - max-width: 960px; - margin: 1em auto 0; + width: 95%; + max-width: 960px; + margin: 1em auto 0; } i.spin { - animation: 1s spin linear infinite; + animation: 1s spin linear infinite; } @@ -78,30 +78,30 @@ i.spin { * * * * * * * * * * * * * * * */ #editor .source { - display: none; + display: none; } #editor .content { - background: #fff; - padding: 1em 0; + background: #fff; + padding: 1em 0; } #editor #ace, #editor h2, #editor .frontmatter { - width: 95%; - max-width: 960px; - margin: 1em auto 0; + width: 95%; + max-width: 960px; + margin: 1em auto 0; } #editor h2 { - margin: 1.5em auto 1em; - color: rgba(0, 0, 0, 0.3); - font-weight: 500; + margin: 1.5em auto 1em; + color: rgba(0, 0, 0, 0.3); + font-weight: 500; } #editor .ace_gutter { - background-color: #fff; + background-color: #fff; } @@ -110,124 +110,124 @@ i.spin { * * * * * * * * * * * * * * * */ .frontmatter { - column-count: 3; - column-gap: 1em; - column-fill: balance; - /* display: flex; */ - /* flex-wrap: wrap; */ - /* justify-content: space-between; */ - /* flex-grow: 1; */ + column-count: 3; + column-gap: 1em; + column-fill: balance; + /* display: flex; */ + /* flex-wrap: wrap; */ + /* justify-content: space-between; */ + /* flex-grow: 1; */ } .frontmatter label { - display: block; - width: calc(100% - 1em); - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; + display: block; + width: calc(100% - 1em); + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } .frontmatter label, .frontmatter h3 { - font-weight: 500; - margin: 0 0; - color: rgba(0, 0, 0, 0.6); + font-weight: 500; + margin: 0 0; + color: rgba(0, 0, 0, 0.6); } .frontmatter input, .frontmatter textarea { - display: block; - width: 100%; - border: 0; - margin-top: .5em; - padding: 0; - line-height: 1; + display: block; + width: 100%; + border: 0; + margin-top: .5em; + padding: 0; + line-height: 1; } .frontmatter .block, .frontmatter fieldset[data-type="array"], .button { - position: relative; - background: #fff; - border-radius: .2em; - border: 1px solid rgba(0, 0, 0, 0.075); - padding: .5em; - break-inside: avoid; - margin: 0 0 1em; - width: 100%; - display: inline-block; + position: relative; + background: #fff; + border-radius: .2em; + border: 1px solid rgba(0, 0, 0, 0.075); + padding: .5em; + break-inside: avoid; + margin: 0 0 1em; + width: 100%; + display: inline-block; } .frontmatter fieldset[data-type="object"] { - position: relative; - margin: 0; + position: relative; + margin: 0; } .frontmatter .button { - background-color: #2196f3; - color: #fff; - cursor: pointer; - text-align: center; + background-color: #2196f3; + color: #fff; + cursor: pointer; + text-align: center; } [data-type="array-item"] { - position: relative; + position: relative; } [data-type="array-item"] .action { - top: 0; - right: 0; + top: 0; + right: 0; } .frontmatter textarea { - resize: none; + resize: none; } [data-type="array-item"] input { - width: calc(100% - 1em); + width: calc(100% - 1em); } .block .action, fieldset .action { - position: absolute; - top: .5em; - right: .5em; + position: absolute; + top: .5em; + right: .5em; } .block>.action, fieldset>.action { - opacity: 0; + opacity: 0; } .block:hover>.action, fieldset:hover>.action { - opacity: 1; + opacity: 1; } .block .action.add, fieldset .action.add { - right: 1.5em; + right: 1.5em; } .frontmatter .action i { - padding: 0; - font-size: 1em; + padding: 0; + font-size: 1em; } fieldset { - border: 0; - padding: 0; + border: 0; + padding: 0; } .frontmatter>fieldset h3, .frontmatter>.group h3 { - font-size: 1.5em; - margin-bottom: .5em; + font-size: 1.5em; + margin-bottom: .5em; } fieldset h3, .group h3 { - font-size: 0.9em; + font-size: 0.9em; } @@ -236,51 +236,51 @@ fieldset h3, * * * * * * * * * * * * * * * */ .action { - display: inline-block; - cursor: pointer; - -webkit-transition: 0.2s ease all; - transition: 0.2s ease all; - border: 0; - margin: 0; - color: #546E7A; - border-radius: 50%; + display: inline-block; + cursor: pointer; + -webkit-transition: 0.2s ease all; + transition: 0.2s ease all; + border: 0; + margin: 0; + color: #546E7A; + border-radius: 50%; } .action.disabled { - opacity: 0.2; - cursor: not-allowed; + opacity: 0.2; + cursor: not-allowed; } .action i { - padding: 0.4em; - -webkit-transition: 0.2s ease-in-out all; - transition: 0.2s ease-in-out all; - border-radius: 50%; + padding: 0.4em; + -webkit-transition: 0.2s ease-in-out all; + transition: 0.2s ease-in-out all; + border-radius: 50%; } .action:hover i { - background-color: rgba(0, 0, 0, .1); + background-color: rgba(0, 0, 0, .1); } .action ul { - position: absolute; - top: 0; - color: #7d7d7d; - list-style: none; - margin: 0; - padding: 0; - flex-direction: column; - display: flex; + position: absolute; + top: 0; + color: #7d7d7d; + list-style: none; + margin: 0; + padding: 0; + flex-direction: column; + display: flex; } .action ul li { - line-height: 1; - padding: .7em; - transition: .1s ease background-color; + line-height: 1; + padding: .7em; + transition: .1s ease background-color; } .action ul li:hover { - background-color: rgba(0, 0, 0, 0.04); + background-color: rgba(0, 0, 0, 0.04); } @@ -289,32 +289,32 @@ fieldset h3, * * * * * * * * * * * * * * * */ .floating { - position: fixed; - bottom: 1em; - right: 1em; + position: fixed; + bottom: 1em; + right: 1em; } .floating .action { - background-color: #2196f3 !important; - color: #fff; - box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); + background-color: #2196f3 !important; + color: #fff; + box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); } #newdir { - position: fixed; - bottom: 1.3em; - right: 5em; - transition: .2s ease all; - opacity: 0; - border: 0; - box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24); - padding: .5em; - width: 22em; - border-radius: .2em; + position: fixed; + bottom: 1.3em; + right: 5em; + transition: .2s ease all; + opacity: 0; + border: 0; + box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24); + padding: .5em; + width: 22em; + border-radius: .2em; } #newdir.enabled { - opacity: 1; + opacity: 1; } @@ -323,76 +323,76 @@ fieldset h3, * * * * * * * * * * * * * * * */ header { - z-index: 1000; - background-color: #fff; - border-bottom: 1px solid rgba(0, 0, 0, 0.075); - box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); - position: fixed; - top: 0; - left: 0; - width: 100%; - padding: 0; + z-index: 1000; + background-color: #fff; + border-bottom: 1px solid rgba(0, 0, 0, 0.075); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); + position: fixed; + top: 0; + left: 0; + width: 100%; + padding: 0; } header a, header a:hover { - color: inherit; + color: inherit; } header p i { - font-size: 1em !important; - color: rgba(255, 255, 255, .31); + font-size: 1em !important; + color: rgba(255, 255, 255, .31); } header>div { - display: flex; - width: 100%; - padding: 0.5em 0.5em 0.5em 1em; - align-items: center; + display: flex; + width: 100%; + padding: 0.5em 0.5em 0.5em 1em; + align-items: center; } header p { - display: inline-block; - margin: 0; - vertical-align: middle; + display: inline-block; + margin: 0; + vertical-align: middle; } header p a, header p a:hover { - color: inherit; + color: inherit; } header .action span { - display: none; + display: none; } header>div div { - vertical-align: middle; - position: relative; + vertical-align: middle; + position: relative; } header .actions { - /* margin-left: auto; */ + /* margin-left: auto; */ } #logout { - border-radius: 0; - margin-left: auto; - padding: .15em; + border-radius: 0; + margin-left: auto; + padding: .15em; } #click-overlay { - display: none; - position: fixed; - cursor: pointer; - top: 0; - left: 0; - height: 100%; - width: 100%; + display: none; + position: fixed; + cursor: pointer; + top: 0; + left: 0; + height: 100%; + width: 100%; } #click-overlay.active { - display: block; + display: block; } @@ -401,14 +401,14 @@ header .actions { * * * * * * * * * * * * * * * */ #top-bar { - height: 4em; + height: 4em; } #top-bar>div:nth-child(1) { - margin-right: 1em; - font-weight: 500; - font-size: 1.5em; - line-height: 2; + margin-right: 1em; + font-weight: 500; + font-size: 1.5em; + line-height: 2; } @@ -417,128 +417,128 @@ header .actions { * * * * * * * * * * * * * * * */ #search { - position: relative; - display: flex; - height: 100%; - padding: 0.75em; - vertical-align: middle; - border-radius: 0.3em; - background-color: #f5f5f5; - transition: .1s ease all; - width: 100%; - max-width: 25em; + position: relative; + display: flex; + height: 100%; + padding: 0.75em; + vertical-align: middle; + border-radius: 0.3em; + background-color: #f5f5f5; + transition: .1s ease all; + width: 100%; + max-width: 25em; } #search.active { - background-color: #fff; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); + background-color: #fff; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); } #search.active i, #search.active input { - color: #212121; + color: #212121; } #search i, #search input { - vertical-align: middle; + vertical-align: middle; } #search i { - margin-right: 0.3em; - user-select: none; + margin-right: 0.3em; + user-select: none; } #search input { - width: 100%; - border: 0; - outline: 0; - background-color: transparent; + width: 100%; + border: 0; + outline: 0; + background-color: transparent; } #search.active div { - visibility: visible; - opacity: 1; - top: 100%; + visibility: visible; + opacity: 1; + top: 100%; } #search ul { - padding: 0; - margin: 0; - list-style: none; + padding: 0; + margin: 0; + list-style: none; } #search li { - margin-bottom: .5em; + margin-bottom: .5em; } #search>div { - position: absolute; - top: 0; - width: 100%; - left: 0; - z-index: 999999; - background-color: #fff; - text-align: left; - color: #ccc; - box-shadow: 0 2px 3px rgba(0, 0, 0, .06), 0 2px 2px rgba(0, 0, 0, .12); - padding: .5em; - border-bottom-left-radius: .3em; - border-bottom-right-radius: .3em; - transition: .1s ease all; - visibility: hidden; - opacity: 0; - overflow-x: hidden; - overflow-y: auto; - max-height: 50vh; + position: absolute; + top: 0; + width: 100%; + left: 0; + z-index: 999999; + background-color: #fff; + text-align: left; + color: #ccc; + box-shadow: 0 2px 3px rgba(0, 0, 0, .06), 0 2px 2px rgba(0, 0, 0, .12); + padding: .5em; + border-bottom-left-radius: .3em; + border-bottom-right-radius: .3em; + transition: .1s ease all; + visibility: hidden; + opacity: 0; + overflow-x: hidden; + overflow-y: auto; + max-height: 50vh; } #search>div div { - white-space: pre-wrap; - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - word-wrap: break-word; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; } #search>div p { - width: 100%; - text-align: center; - display: none; - margin: 0; - max-width: none; + width: 100%; + text-align: center; + display: none; + margin: 0; + max-width: none; } #search.ongoing p { - display: block; + display: block; } #search.active div i, #sidebar #search.active div i { - color: #ccc; - text-align: center; - margin: 0 auto; - display: table; + color: #ccc; + text-align: center; + margin: 0 auto; + display: table; } #search::-webkit-input-placeholder { - color: rgba(255, 255, 255, .5); + color: rgba(255, 255, 255, .5); } #search:-moz-placeholder { - opacity: 1; - color: rgba(255, 255, 255, .5); + opacity: 1; + color: rgba(255, 255, 255, .5); } #search::-moz-placeholder { - opacity: 1; - color: rgba(255, 255, 255, .5); + opacity: 1; + color: rgba(255, 255, 255, .5); } #search:-ms-input-placeholder { - color: rgba(255, 255, 255, .5); + color: rgba(255, 255, 255, .5); } @@ -547,60 +547,60 @@ header .actions { * * * * * * * * * * * * * * * */ #bottom-bar { - background-color: #fafafa; - border-top: 1px solid rgba(0, 0, 0, 0.075); - border-bottom: 1px solid rgba(0, 0, 0, 0.075); - height: 3.8em; + background-color: #fafafa; + border-top: 1px solid rgba(0, 0, 0, 0.075); + border-bottom: 1px solid rgba(0, 0, 0, 0.075); + height: 3.8em; } #bottom-bar>div:first-child>* { - display: inline-block; - vertical-align: middle; + display: inline-block; + vertical-align: middle; } #bottom-bar>div:first-child>i { - margin-right: .3em; + margin-right: .3em; } #bottom-bar>*:first-child { - margin-right: auto; - max-width: calc(100% - 25em); - width: 100%; + margin-right: auto; + max-width: calc(100% - 25em); + width: 100%; } #bottom-bar p { - text-overflow: ellipsis; - overflow: hidden; - width: calc(100% - 3em); - white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + width: calc(100% - 3em); + white-space: nowrap; } #more { - display: none; + display: none; } #file-only { - display: inline-block; - border-right: 1px solid rgba(0, 0, 0, 0.075); - padding-right: .3em; - margin-right: .3em; - transition: .2s ease opacity, visibility; - visibility: visible; + display: inline-block; + border-right: 1px solid rgba(0, 0, 0, 0.075); + padding-right: .3em; + margin-right: .3em; + transition: .2s ease opacity, visibility; + visibility: visible; } #file-only.disabled { - opacity: 0; - visibility: hidden; + opacity: 0; + visibility: hidden; } #download ul.active { - top: 0; - right: 0; + top: 0; + right: 0; } #more ul.active { - right: .5em; - top: 4.5em; + right: .5em; + top: 4.5em; } @@ -609,6 +609,528 @@ header .actions { * * * * * * * * * * * * * * * */ .dropdown { + position: fixed; + top: -100%; + right: -100%; + visibility: hidden; + display: flex; + flex-direction: column; + border-radius: .1em; + border-top-left-radius: 0; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); + background: #fff; + z-index: 9999999; +} + +.dropdown.active { + visibility: visible; +} + +.dropdown .action { + padding: .7em; +} + +.dropdown i { + padding: 0; + vertical-align: middle; +} + +.dropdown span { + display: inline-block; + margin-left: .5em; + font-size: .9em; +} + + +/* * * * * * * * * * * * * * * * + * BREADCRUMBS * + * * * * * * * * * * * * * * * */ + +#previous { + margin-left: -.5em; +} + +#breadcrumbs { + min-width: 7em; +} + +#breadcrumbs.active { + top: 0; + left: 0; + right: auto; +} + + +/* * * * * * * * * * * * * * * * + * LISTING * + * * * * * * * * * * * * * * * */ + +#listing { + max-width: calc(100% - 1.2em); + width: 100%; +} + +#listing h2 { + margin: 0 0 0 0.5em; + font-size: 1em; + color: rgba(0, 0, 0, 0.2); + font-weight: 500; +} + +#listing .item div:last-of-type * { + text-overflow: ellipsis; + overflow: hidden; +} + +#listing>div { + display: flex; + padding: 0; + flex-wrap: wrap; + justify-content: flex-start; + position: relative; +} + +#listing .item { + background-color: #fff; + position: relative; + display: flex; + flex-wrap: nowrap; + color: #6f6f6f; + transition: .1s ease all; + align-items: center; + cursor: pointer; +} + +#listing .item div:last-of-type { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +#listing .item p { + margin: 0; +} + +#listing .item .size, +#listing .item .modified { + font-size: 0.9em; +} + +#listing .item .name { + font-weight: bold; +} + +#listing .item i { + font-size: 4em; + margin-right: 0.1em; + vertical-align: bottom; +} + +#listing h2.message, +.message { + text-align: center; + font-size: 3em; + margin: 1em auto; + display: block !important; + width: 95%; + color: rgba(0, 0, 0, 0.2); + font-weight: 500; +} + +.message i { + font-size: inherit; + vertical-align: middle; +} + + +/* * * * * * * * * * * * * * * * + * LISTING - MOSAIC * + * * * * * * * * * * * * * * * */ + +#listing.mosaic { + margin-top: 1em; +} + +#listing.mosaic .item { + width: calc(33% - 1em); + margin: .5em; + padding: 0.5em; + border-radius: 0.2em; + box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); +} + +#listing.mosaic .item:hover { + box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24) !important; +} + +#listing.mosaic .header { + display: none; +} + +#listing.mosaic .item div:first-of-type { + width: 5em; +} + +#listing.mosaic .item div:last-of-type { + width: calc(100% - 5vw); +} + + +/* * * * * * * * * * * * * * * * + * LISTING - DETAIL * + * * * * * * * * * * * * * * * */ + +#listing.list { + flex-direction: column; + padding-top: 3.25em; + width: 100%; + max-width: 100%; + margin: 0; +} + +#listing.list .item { + width: 100%; + margin: 0; + border: 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + padding: 1em; +} + +#listing.list h2 { + display: none; +} + +#listing .item[aria-selected=true] { + background: #2196f3 !important; + color: #fff !important; +} + +#listing.list .item div:first-of-type { + width: 3em; +} + +#listing.list .item div:first-of-type i { + font-size: 2em; +} + +#listing.list .item div:last-of-type { + width: calc(100% - 3em); + display: flex; + align-items: center; +} + +#listing.list .item .name { + width: 50%; +} + +#listing.list .item .size { + width: 25%; +} + +#listing .item.header { + display: none !important; + background-color: #ccc; +} + +#listing.list .header i { + font-size: 1.5em; + vertical-align: middle; + margin-left: .2em; +} + +#listing.list .item.header { + display: flex !important; + background: #fafafa; + position: fixed; + width: 100%; + top: 7.8em; + left: 0; + z-index: 999; + padding: .85em; +} + +#listing.list .item.header>div:first-child { + width: 0; +} + +#listing.list .item.header .name { + margin-right: 3em; +} + +#listing.list .header { + display: flex; + background: #fafafa; + position: fixed; + width: 100%; + top: 7.8em; + left: 0; + z-index: 999; +} + +#listing.list .header a { + color: inherit; +} + +#listing.list .item.header>div:first-child { + width: 0; +} + +#listing.list .name { + font-weight: normal; +} + +#listing.list .item.header .name { + margin-right: 3em; +} + +#listing.list .header span { + vertical-align: middle; +} + +#listing.list .header i { + opacity: 0; + transition: .1s ease all; +} + +#listing.list .header p:hover i, +#listing.list .header .active i { + opacity: 1; +} + +#listing.list .item.header .active { + font-weight: bold; +} + + +/* * * * * * * * * * * * * * * * + * MULTIPLE SELECTION DIALOG * + * * * * * * * * * * * * * * * */ + +#multiple-selection { + position: fixed; + bottom: -4em; + left: 0; + z-index: 99999999; + width: 100%; + background-color: #2196f3; + height: 4em; + display: flex !important; + padding: 0.5em 0.5em 0.5em 1em; + justify-content: space-between; + align-items: center; + transition: .2s ease all; +} + +#multiple-selection.active { + bottom: 0; +} + +#multiple-selection * { + margin: 0; +} + +#multiple-selection p, +#multiple-selection i { + color: #fff; +} + + +/* * * * * * * * * * * * * * * * + * PROMPT * + * * * * * * * * * * * * * * * */ + +.overlay, +.prompt, +.help { + opacity: 0; + z-index: -1; + transition: .1s ease opacity, z-index; +} + +.overlay.active, +.prompt.active, +.help.active { + z-index: 9999999; + opacity: 1; +} + +.overlay { + background-color: rgba(0, 0, 0, 0.5); + position: fixed; + top: 0; + left: 0; + height: 0; + width: 0; +} + +.overlay.active { + height: 100%; + width: 100%; +} + +.prompt, +.help { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 99999999; + background: #fff; + border: 1px solid rgba(0, 0, 0, 0.075); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); + padding: 2em; + max-width: 25em; + width: 90%; +} + +.prompt h3, +.help h3 { + margin: 0; + font-weight: 500; + font-size: 1.5em; +} + +.prompt p, +.help p { + font-size: .9em; + color: rgba(0, 0, 0, 0.8); + margin: .5em 0 1em; +} + +.prompt input { + width: 100%; + border: 1px solid #dadada; + line-height: 1; + padding: .3em; +} + +.prompt div, +.help div { + margin-top: 1em; + display: flex; + justify-content: flex-start; + flex-direction: row-reverse; +} + +.prompt .cancel { + background-color: #ECEFF1; + color: #37474F; +} + +.prompt .cancel:hover { + background-color: #e9eaeb; +} + + +/* * * * * * * * * * * * * * * * + * PROMPT - MOVE * + * * * * * * * * * * * * * * * */ + +.prompt .file-list { + flex-direction: initial; +} + +.prompt .file-list ul { + list-style: none; + margin: 0; + padding: 0; + width: 100%; +} + +.prompt .file-list ul li { + width: 100%; + user-select: none; +} + +.prompt .file-list ul li[aria-selected=true] { + background: #2196f3 !important; + color: #fff !important; + transition: .1s ease all; +} + +.prompt .file-list ul li:hover { + background-color: #e9eaeb; + cursor: pointer; +} + +.prompt .file-list ul li:before { + content: "folder"; + color: #6f6f6f; + vertical-align: middle; + padding: 0 .25em; + line-height: 2em; +} + +.prompt .file-list ul li[aria-selected=true]:before { + color: white; +} + + +/* * * * * * * * * * * * * * * * + * HELP * + * * * * * * * * * * * * * * * */ + +.help { + max-width: 24em; + visibility: hidden; + top: -100%; + left: -100%; +} + +.help.active { + visibility: visible; + top: 50%; + left: 50%; +} + +.help ul { + padding: 0; + margin: 1em 0; + list-style: none; +} + + +/* * * * * * * * * * * * * * * * + * FOOTER * + * * * * * * * * * * * * * * * */ + +footer { + font-size: 0.6em; + margin: 2em 0 2em; + text-align: center; + color: grey; +} + +footer a, +footer a:hover { + color: inherit; +} + + +/* * * * * * * * * * * * * * * * + * MEDIA QUERIES * + * * * * * * * * * * * * * * * */ + +@media screen and (max-width: 850px) { + .frontmatter { + column-count: 2; + } +} + +@media screen and (max-width: 650px) { + body { + transition: .2s ease padding; + } + .mobile-only { + display: inherit !important; + } + #top-bar>div:nth-child(1) { + display: none; + } + #bottom-bar>*:first-child { + max-width: calc(100% - 16em); + } + #main-actions { position: fixed; top: -100%; right: -100%; @@ -620,570 +1142,49 @@ header .actions { box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); background: #fff; z-index: 9999999; -} - -.dropdown.active { + } + #main-actions.active { + right: .5em; + top: 4.5em; visibility: visible; -} - -.dropdown .action { + } + #main-actions .action { padding: .7em; -} - -.dropdown i { + border-radius: 0; + align-items: center; + } + #main-actions .action:hover { + background-color: rgba(0, 0, 0, 0.04); + } + #main-actions i { padding: 0; vertical-align: middle; -} - -.dropdown span { + } + #main-actions .action:hover i { + padding: 0; + background-color: transparent; + } + #main-actions span { display: inline-block; margin-left: .5em; font-size: .9em; -} - - -/* * * * * * * * * * * * * * * * - * BREADCRUMBS * - * * * * * * * * * * * * * * * */ - -#previous { - margin-left: -.5em; -} - -#breadcrumbs { - min-width: 7em; -} - -#breadcrumbs.active { - top: 0; - left: 0; - right: auto; -} - - -/* * * * * * * * * * * * * * * * - * LISTING * - * * * * * * * * * * * * * * * */ - -#listing { - max-width: calc(100% - 1.2em); - width: 100%; -} - -#listing h2 { - margin: 0 0 0 0.5em; - font-size: 1em; - color: rgba(0, 0, 0, 0.2); - font-weight: 500; -} - -#listing .item div:last-of-type * { - text-overflow: ellipsis; - overflow: hidden; -} - -#listing>div { - display: flex; - padding: 0; - flex-wrap: wrap; - justify-content: flex-start; - position: relative; -} - -#listing .item { - background-color: #fff; - position: relative; - display: flex; - flex-wrap: nowrap; - color: #6f6f6f; - transition: .1s ease all; - align-items: center; - cursor: pointer; -} - -#listing .item div:last-of-type { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; -} - -#listing .item p { - margin: 0; -} - -#listing .item .size, -#listing .item .modified { - font-size: 0.9em; -} - -#listing .item .name { - font-weight: bold; -} - -#listing .item i { - font-size: 4em; - margin-right: 0.1em; - vertical-align: bottom; -} - -#listing h2.message, -.message { - text-align: center; - font-size: 3em; - margin: 1em auto; - display: block !important; - width: 95%; - color: rgba(0, 0, 0, 0.2); - font-weight: 500; -} - -.message i { - font-size: inherit; - vertical-align: middle; -} - - -/* * * * * * * * * * * * * * * * - * LISTING - MOSAIC * - * * * * * * * * * * * * * * * */ - -#listing.mosaic { - margin-top: 1em; -} - -#listing.mosaic .item { - width: calc(33% - 1em); - margin: .5em; - padding: 0.5em; - border-radius: 0.2em; - box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); -} - -#listing.mosaic .item:hover { - box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24) !important; -} - -#listing.mosaic .header { + } + #listing.list .item .size, + #listing.list .item .modified { display: none; -} - -#listing.mosaic .item div:first-of-type { - width: 5em; -} - -#listing.mosaic .item div:last-of-type { - width: calc(100% - 5vw); -} - - -/* * * * * * * * * * * * * * * * - * LISTING - DETAIL * - * * * * * * * * * * * * * * * */ - -#listing.list { - flex-direction: column; - padding-top: 3.25em; + } + #listing.list .item .name { width: 100%; - max-width: 100%; - margin: 0; -} - -#listing.list .item { - width: 100%; - margin: 0; - border: 0; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 1em; -} - -#listing.list h2 { - display: none; -} - -#listing .item[aria-selected=true] { - background: #2196f3 !important; - color: #fff !important; -} - -#listing.list .item div:first-of-type { - width: 3em; -} - -#listing.list .item div:first-of-type i { - font-size: 2em; -} - -#listing.list .item div:last-of-type { - width: calc(100% - 3em); - display: flex; - align-items: center; -} - -#listing.list .item .name { - width: 50%; -} - -#listing.list .item .size { - width: 25%; -} - -#listing .item.header { - display: none !important; - background-color: #ccc; -} - -#listing.list .header i { - font-size: 1.5em; - vertical-align: middle; - margin-left: .2em; -} - -#listing.list .item.header { - display: flex !important; - background: #fafafa; - position: fixed; - width: 100%; - top: 7.8em; - left: 0; - z-index: 999; - padding: .85em; -} - -#listing.list .item.header>div:first-child { - width: 0; -} - -#listing.list .item.header .name { - margin-right: 3em; -} - -#listing.list .header { - display: flex; - background: #fafafa; - position: fixed; - width: 100%; - top: 7.8em; - left: 0; - z-index: 999; -} - -#listing.list .header a { - color: inherit; -} - -#listing.list .item.header>div:first-child { - width: 0; -} - -#listing.list .name { - font-weight: normal; -} - -#listing.list .item.header .name { - margin-right: 3em; -} - -#listing.list .header span { - vertical-align: middle; -} - -#listing.list .header i { - opacity: 0; - transition: .1s ease all; -} - -#listing.list .header p:hover i, -#listing.list .header .active i { - opacity: 1; -} - -#listing.list .item.header .active { - font-weight: bold; -} - - -/* * * * * * * * * * * * * * * * - * MULTIPLE SELECTION DIALOG * - * * * * * * * * * * * * * * * */ - -#multiple-selection { - position: fixed; - bottom: -4em; - left: 0; - z-index: 99999999; - width: 100%; - background-color: #2196f3; - height: 4em; - display: flex !important; - padding: 0.5em 0.5em 0.5em 1em; - justify-content: space-between; - align-items: center; - transition: .2s ease all; -} - -#multiple-selection.active { - bottom: 0; -} - -#multiple-selection * { - margin: 0; -} - -#multiple-selection p, -#multiple-selection i { - color: #fff; -} - - -/* * * * * * * * * * * * * * * * - * PROMPT * - * * * * * * * * * * * * * * * */ - -.overlay, -.prompt, -.help { - opacity: 0; - z-index: -1; - transition: .1s ease opacity, z-index; -} - -.overlay.active, -.prompt.active, -.help.active { - z-index: 9999999; - opacity: 1; -} - -.overlay { - background-color: rgba(0, 0, 0, 0.5); - position: fixed; - top: 0; - left: 0; - height: 0; - width: 0; -} - -.overlay.active { - height: 100%; - width: 100%; -} - -.prompt, -.help { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 99999999; - background: #fff; - border: 1px solid rgba(0, 0, 0, 0.075); - box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); - padding: 2em; - max-width: 25em; - width: 90%; -} - -.prompt h3, -.help h3 { - margin: 0; - font-weight: 500; - font-size: 1.5em; -} - -.prompt p, -.help p { - font-size: .9em; - color: rgba(0, 0, 0, 0.8); - margin: .5em 0 1em; -} - -.prompt input { - width: 100%; - border: 1px solid #dadada; - line-height: 1; - padding: .3em; -} - -.prompt div, -.help div { - margin-top: 1em; - display: flex; - justify-content: flex-start; - flex-direction: row-reverse; -} - -.prompt .cancel { - background-color: #ECEFF1; - color: #37474F; -} - -.prompt .cancel:hover { - background-color: #e9eaeb; -} - -/* * * * * * * * * * * * * * * * - * PROMPT - MOVE * - * * * * * * * * * * * * * * * */ - -.prompt .file-list { - flex-direction: initial; -} - -.prompt .file-list ul { - list-style: none; - margin: 0; - padding: 0; - width: 100%; -} - -.prompt .file-list ul li { - width: 100%; - user-select: none; -} - -.prompt .file-list ul li[aria-selected=true] { - background: #2196f3 !important; - color: #fff !important; - transition: .1s ease all; -} - -.prompt .file-list ul li:hover { - background-color: #e9eaeb; - cursor: pointer; -} - -.prompt .file-list ul li:before { - content: "folder"; - color: #6f6f6f; - vertical-align: middle; - padding: 0 .25em; - line-height: 2em; -} - -.prompt .file-list ul li[aria-selected=true]:before { - color: white; -} - - -/* * * * * * * * * * * * * * * * - * HELP * - * * * * * * * * * * * * * * * */ - -.help { - max-width: 24em; - visibility: hidden; - top: -100%; - left: -100%; -} - -.help.active { - visibility: visible; - top: 50%; - left: 50%; -} - -.help ul { - padding: 0; - margin: 1em 0; - list-style: none; -} - - -/* * * * * * * * * * * * * * * * - * FOOTER * - * * * * * * * * * * * * * * * */ - -footer { - font-size: 0.6em; - margin: 2em 0 2em; - text-align: center; - color: grey; -} - -footer a, -footer a:hover { - color: inherit; -} - - -/* * * * * * * * * * * * * * * * - * MEDIA QUERIES * - * * * * * * * * * * * * * * * */ - -@media screen and (max-width: 850px) { - .frontmatter { - column-count: 2; - } -} - -@media screen and (max-width: 650px) { - body { - transition: .2s ease padding; - } - .mobile-only { - display: inherit !important; - } - #top-bar>div:nth-child(1) { - display: none; - } - #bottom-bar>*:first-child { - max-width: calc(100% - 16em); - } - #main-actions { - position: fixed; - top: -100%; - right: -100%; - visibility: hidden; - display: flex; - flex-direction: column; - border-radius: .1em; - border-top-left-radius: 0; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); - background: #fff; - z-index: 9999999; - } - #main-actions.active { - right: .5em; - top: 4.5em; - visibility: visible; - } - #main-actions .action { - padding: .7em; - border-radius: 0; - align-items: center; - } - #main-actions .action:hover { - background-color: rgba(0, 0, 0, 0.04); - } - #main-actions i { - padding: 0; - vertical-align: middle; - } - #main-actions .action:hover i { - padding: 0; - background-color: transparent; - } - #main-actions span { - display: inline-block; - margin-left: .5em; - font-size: .9em; - } - #listing.list .item .size, - #listing.list .item .modified { - display: none; - } - #listing.list .item .name { - width: 100%; - } - .frontmatter { - column-count: 1; - } + } + .frontmatter { + column-count: 1; + } } @media screen and (max-width: 450px) { - #bottom-bar p { - display: none !important; - } + #bottom-bar p { + display: none !important; + } } @@ -1192,8 +1193,8 @@ footer a:hover { * * * * * * * * * * * * * * * */ @keyframes spin { - 100% { - -webkit-transform: rotate(-360deg); - transform: rotate(-360deg); - } -} + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} \ No newline at end of file diff --git a/_embed/public/js/common.js b/_embed/public/js/common.js index 215881fd..bff18658 100644 --- a/_embed/public/js/common.js +++ b/_embed/public/js/common.js @@ -1,116 +1,123 @@ 'use strict'; var tempID = "_fm_internal_temporary_id", - buttons = {}, - templates = {}, - selectedItems = [], - overlay, clickOverlay, - webdav = {}; + buttons = {}, + templates = {}, + selectedItems = [], + overlay, + clickOverlay, + webdav = {}; // Removes an element, if exists, from an array Array.prototype.removeElement = function (element) { - var i = this.indexOf(element); - if (i != -1) this.splice(i, 1); + var i = this.indexOf(element); + if(i != -1) + this.splice(i, 1); } // Replaces an element inside an array by another Array.prototype.replaceElement = function (oldElement, newElement) { - var i = this.indexOf(oldElement); - if (i != -1) this[i] = newElement; + var i = this.indexOf(oldElement); + if(i != -1) + this[i] = newElement; } // Sends a costum event to itself Document.prototype.sendCostumEvent = function (text) { - this.dispatchEvent(new CustomEvent(text)); + this.dispatchEvent(new CustomEvent(text)); } // Gets the content of a cookie Document.prototype.getCookie = function (name) { - var re = new RegExp("(?:(?:^|.*;\\s*)" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"); - return document.cookie.replace(re, "$1"); + var re = new RegExp("(?:(?:^|.*;\\s*)" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"); + return document.cookie.replace(re, "$1"); } // Changes a button to the loading animation Element.prototype.changeToLoading = function () { - let element = this, - originalText = element.innerHTML; + let element = this, + originalText = element.innerHTML; - element.style.opacity = 0; + element.style.opacity = 0; - setTimeout(function () { - element.classList.add('spin'); - element.innerHTML = 'autorenew'; - element.style.opacity = 1; - }, 200); + setTimeout(function () { + element.classList.add('spin'); + element.innerHTML = 'autorenew'; + element.style.opacity = 1; + }, 200); - return originalText; + return originalText; } // Changes an element to done animation Element.prototype.changeToDone = function (error, html) { - this.style.opacity = 0; - - let thirdStep = () => { - this.innerHTML = html; - this.style.opacity = null; - - if (selectedItems.length == 0 && document.getElementById('listing')) document.sendCostumEvent('changed-selected'); - } - - let secondStep = () => { this.style.opacity = 0; - setTimeout(thirdStep, 200); - } - let firstStep = () => { - this.classList.remove('spin'); - this.innerHTML = error ? 'close' : 'done'; - this.style.opacity = 1; - setTimeout(secondStep, 1000); - } + let thirdStep = () => { + this.innerHTML = html; + this.style.opacity = null; - setTimeout(firstStep, 200); - return false; + if(selectedItems.length == 0 && document.getElementById('listing')) + document.sendCostumEvent('changed-selected'); + } + + let secondStep = () => { + this.style.opacity = 0; + setTimeout(thirdStep, 200); + } + + let firstStep = () => { + this.classList.remove('spin'); + this.innerHTML = error ? + 'close' : + 'done'; + this.style.opacity = 1; + setTimeout(secondStep, 1000); + } + + setTimeout(firstStep, 200); + return false; } function toWebDavURL(url) { - return window.location.origin + url.replace(baseURL + "/", webdavURL + "/"); + return window.location.origin + url.replace(baseURL + "/", webdavURL + "/"); } // Remove the last directory of an url var removeLastDirectoryPartOf = function (url) { - var arr = url.split('/'); - if (arr.pop() === "") { - arr.pop(); - } - return (arr.join('/')); + var arr = url.split('/'); + if(arr.pop() === "") { + arr.pop(); + } + return(arr.join('/')); } function getCSSRule(rules) { - for (let i = 0; i < rules.length; i++) { - rules[i] = rules[i].toLowerCase(); - } + for(let i = 0; i < rules.length; i++) { + rules[i] = rules[i].toLowerCase(); + } - var result = null, - find = Array.prototype.find; + var result = null, + find = Array.prototype.find; - find.call(document.styleSheets, styleSheet => { - result = find.call(styleSheet.cssRules, cssRule => { - let found = false; + find.call(document.styleSheets, styleSheet => { + result = find.call(styleSheet.cssRules, cssRule => { + let found = false; - if (cssRule instanceof CSSStyleRule) { - for (let i = 0; i < rules.length; i++) { - if (cssRule.selectorText.toLowerCase() == rules[i]) found = true; - } - } + if(cssRule instanceof CSSStyleRule) { + for(let i = 0; i < rules.length; i++) { + if(cssRule.selectorText.toLowerCase() == rules[i]) + found = true; + } + } - return found; + return found; + }); + + return result != null; }); - return result != null; - }); - - return result; + return result; } /* * * * * * * * * * * * * * * * @@ -122,36 +129,36 @@ function getCSSRule(rules) { // We must create functions that do the requests to the webdav backend. webdav.move = function (oldLink, newLink) { - return new Promise((resolve, reject) => { - let request = new XMLHttpRequest(); - request.open('MOVE', toWebDavURL(oldLink), true); - request.setRequestHeader('Destination', toWebDavURL(newLink)); - request.onload = () => { - if (request.status == 201 || request.status == 204) { - resolve(request.response); - } else { - reject(request.statusText); - } - } - request.onerror = () => reject(request.statusText); - request.send(); - }); + return new Promise((resolve, reject) => { + let request = new XMLHttpRequest(); + request.open('MOVE', toWebDavURL(oldLink), true); + request.setRequestHeader('Destination', toWebDavURL(newLink)); + request.onload = () => { + if(request.status == 201 || request.status == 204) { + resolve(request.response); + } else { + reject(request.statusText); + } + } + request.onerror = () => reject(request.statusText); + request.send(); + }); } webdav.put = function (link, body) { - return new Promise((resolve, reject) => { - let request = new XMLHttpRequest(); - request.open('PUT', toWebDavURL(link), true); - request.onload = () => { - if (request.status == 201) { - resolve(request.response); - } else { - reject(request.statusText); - } - } - request.onerror = () => reject(request.statusText); - request.send(body); - }); + return new Promise((resolve, reject) => { + let request = new XMLHttpRequest(); + request.open('PUT', toWebDavURL(link), true); + request.onload = () => { + if(request.status == 201) { + resolve(request.response); + } else { + reject(request.statusText); + } + } + request.onerror = () => reject(request.statusText); + request.send(body); + }); } /* * * * * * * * * * * * * * * * @@ -160,402 +167,408 @@ webdav.put = function (link, body) { * * * * * * * * * * * * * * * * * */ function closePrompt(event) { - let prompt = document.querySelector('.prompt'); + let prompt = document.querySelector('.prompt'); - if (!prompt) return; + if(!prompt) + return; - event.preventDefault(); - document.querySelector('.overlay').classList.remove('active'); - prompt.classList.remove('active'); + event.preventDefault(); + document.querySelector('.overlay').classList.remove('active'); + prompt.classList.remove('active'); - setTimeout(() => { - prompt.remove(); - }, 100); + setTimeout(() => { + prompt.remove(); + }, 100); } function notImplemented(event) { - event.preventDefault(); - clickOverlay.click(); + event.preventDefault(); + clickOverlay.click(); - let clone = document.importNode(templates.info.content, true); - clone.querySelector('h3').innerHTML = 'Not implemented'; - clone.querySelector('p').innerHTML = "Sorry, but this feature wasn't implemented yet."; + let clone = document.importNode(templates.info.content, true); + clone.querySelector('h3').innerHTML = 'Not implemented'; + clone.querySelector('p').innerHTML = "Sorry, but this feature wasn't implemented yet."; - document.querySelector('body').appendChild(clone) - document.querySelector('.overlay').classList.add('active'); - document.querySelector('.prompt').classList.add('active'); + document.querySelector('body').appendChild(clone) + document.querySelector('.overlay').classList.add('active'); + document.querySelector('.prompt').classList.add('active'); } // Prevent Default event var preventDefault = function (event) { - event.preventDefault(); + event.preventDefault(); } function logoutEvent(event) { - let request = new XMLHttpRequest(); - request.open('GET', window.location.pathname, true, "username", "password"); - request.send(); - request.onreadystatechange = function () { - if (request.readyState == 4) { - window.location = "/"; + let request = new XMLHttpRequest(); + request.open('GET', window.location.pathname, true, "username", "password"); + request.send(); + request.onreadystatechange = function () { + if(request.readyState == 4) { + window.location = "/"; + } } - } } function openEvent(event) { - if (event.currentTarget.classList.contains('disabled')) return false; + if(event.currentTarget.classList.contains('disabled')) + return false; - let link = '?raw=true'; + let link = '?raw=true'; - if (selectedItems.length) { - link = document.getElementById(selectedItems[0]).dataset.url + link; - } else { - link = window.location + link; - } + if(selectedItems.length) { + link = document.getElementById(selectedItems[0]).dataset.url + link; + } else { + link = window.location + link; + } - window.open(link); - return false; + window.open(link); + return false; } function selectMoveFolder(event) { - if (event.target.getAttribute("aria-selected") === "true") { - event.target.setAttribute("aria-selected", false); - return; - } else { - if (document.querySelector(".file-list li[aria-selected=true]")) { - document.querySelector(".file-list li[aria-selected=true]").setAttribute("aria-selected", false); + if(event.target.getAttribute("aria-selected") === "true") { + event.target.setAttribute("aria-selected", false); + return; + } else { + if(document.querySelector(".file-list li[aria-selected=true]")) { + document.querySelector(".file-list li[aria-selected=true]").setAttribute("aria-selected", false); + } + event.target.setAttribute("aria-selected", true); + return; } - event.target.setAttribute("aria-selected", true); - return; - } } function loadNextFolder(event) { - let request = new XMLHttpRequest(), - prompt = document.querySelector("form.prompt.active"); + let request = new XMLHttpRequest(), + prompt = document.querySelector("form.prompt.active"); - prompt.addEventListener("submit", moveSelected); + prompt.addEventListener("submit", moveSelected); - request.open("GET", event.target.dataset.url); - request.setRequestHeader("Accept", "application/json"); - request.send(); - request.onreadystatechange = function () { - if (request.readyState == 4 && request.status == 200) { - let dirs = 0; + request.open("GET", event.target.dataset.url); + request.setRequestHeader("Accept", "application/json"); + request.send(); + request.onreadystatechange = function () { + if(request.readyState == 4 && request.status == 200) { + let dirs = 0; - prompt.querySelector("ul").innerHTML = ""; - prompt.querySelector('code').innerHTML = event.target.dataset.url; + prompt.querySelector("ul").innerHTML = ""; + prompt.querySelector('code').innerHTML = event.target.dataset.url; - for (let f of JSON.parse(request.response)) { - if (f.IsDir === true) { - dirs++; + for(let f of JSON.parse(request.response)) { + if(f.IsDir === true) { + dirs++; - let newNode = document.createElement("li"); - newNode.dataset.url = f.URL; - newNode.innerHTML = f.Name; - newNode.setAttribute("aria-selected", false); + let newNode = document.createElement("li"); + newNode.dataset.url = f.URL; + newNode.innerHTML = f.Name; + newNode.setAttribute("aria-selected", false); - newNode.addEventListener("dblclick", loadNextFolder); - newNode.addEventListener("click", selectMoveFolder); + newNode.addEventListener("dblclick", loadNextFolder); + newNode.addEventListener("click", selectMoveFolder); - prompt.querySelector("div.file-list ul").appendChild(newNode); + prompt.querySelector("div.file-list ul").appendChild(newNode); + } + } + + if(dirs === 0) { + prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`; + } } - } - - if (dirs === 0) { - prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`; - } } - } } function moveSelected(event) { - event.preventDefault(); + event.preventDefault(); - // TODO: this only works for ONE file. What if there are more files selected? - // TODO: use webdav.rename + // TODO: this only works for ONE file. What if there are more files selected? + // TODO: use webdav.rename - let request = new XMLHttpRequest(), - oldLink = toWebDavURL(window.location.pathname), - newLink = toWebDavURL(event.srcElement.querySelector("li[aria-selected=true]").innerHTML + "/"); + let request = new XMLHttpRequest(), + oldLink = toWebDavURL(window.location.pathname), + newLink = toWebDavURL(event.srcElement.querySelector("li[aria-selected=true]").innerHTML + "/"); - request.open("MOVE", oldLink); - request.setRequestHeader("Destination", newLink); - request.send(); - request.onreadystatechange = function () { - if (request.readyState == 4) { - if (request.status == 200 || request.status == 204) { - window.reload(); - } + request.open("MOVE", oldLink); + request.setRequestHeader("Destination", newLink); + request.send(); + request.onreadystatechange = function () { + if(request.readyState == 4) { + if(request.status == 200 || request.status == 204) { + window.reload(); + } + } } - } } function moveEvent(event) { - if (event.currentTarget.classList.contains("disabled")) return; + if(event.currentTarget.classList.contains("disabled")) + return; - let request = new XMLHttpRequest(); - request.open("GET", window.location.pathname, true); - request.setRequestHeader("Accept", "application/json"); - request.send(); - request.onreadystatechange = function () { - if (request.readyState == 4) { - if (request.status == 200) { - let prompt = document.importNode(templates.move.content, true), - dirs = 0; + let request = new XMLHttpRequest(); + request.open("GET", window.location.pathname, true); + request.setRequestHeader("Accept", "application/json"); + request.send(); + request.onreadystatechange = function () { + if(request.readyState == 4) { + if(request.status == 200) { + let prompt = document.importNode(templates.move.content, true), + dirs = 0; - prompt.querySelector("form").addEventListener("submit", moveSelected); - prompt.querySelector('code').innerHTML = window.location.pathname; + prompt.querySelector("form").addEventListener("submit", moveSelected); + prompt.querySelector('code').innerHTML = window.location.pathname; - for (let f of JSON.parse(request.response)) { - if (f.IsDir === true) { - dirs++; + for(let f of JSON.parse(request.response)) { + if(f.IsDir === true) { + dirs++; - let newNode = document.createElement("li"); - newNode.dataset.url = f.URL; - newNode.innerHTML = f.Name; - newNode.setAttribute("aria-selected", false); + let newNode = document.createElement("li"); + newNode.dataset.url = f.URL; + newNode.innerHTML = f.Name; + newNode.setAttribute("aria-selected", false); - newNode.addEventListener("dblclick", loadNextFolder); - newNode.addEventListener("click", selectMoveFolder); + newNode.addEventListener("dblclick", loadNextFolder); + newNode.addEventListener("click", selectMoveFolder); - prompt.querySelector("div.file-list ul").appendChild(newNode); - } + prompt.querySelector("div.file-list ul").appendChild(newNode); + } + } + + if(dirs === 0) { + prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`; + } + + document.body.appendChild(prompt); + document.querySelector(".overlay").classList.add("active"); + document.querySelector(".prompt").classList.add("active"); + } } - - if (dirs === 0) { - prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`; - } - - document.body.appendChild(prompt); - document.querySelector(".overlay").classList.add("active"); - document.querySelector(".prompt").classList.add("active"); - } } - } } function deleteSelected(single) { - return function (event) { - event.preventDefault(); + return function (event) { + event.preventDefault(); - Array.from(selectedItems).forEach(id => { - let request = new XMLHttpRequest(), - html = buttons.delete.querySelector('i').changeToLoading(), - el, url; + Array.from(selectedItems).forEach(id => { + let request = new XMLHttpRequest(), + html = buttons.delete.querySelector('i').changeToLoading(), + el, + url; - if (single) { - url = window.location.pathname; - } else { - el = document.getElementById(id); - url = el.dataset.url; - } - - request.open('DELETE', toWebDavURL(url)); - request.onreadystatechange = function () { - if (request.readyState == 4) { - if (request.status == 204) { - if (single) { - window.location.pathname = removeLastDirectoryPartOf(window.location.pathname); + if(single) { + url = window.location.pathname; } else { - el.remove(); - selectedItems.removeElement(id); + el = document.getElementById(id); + url = el.dataset.url; } - } - buttons.delete.querySelector('i').changeToDone(request.status != 204, html); - } - } + request.open('DELETE', toWebDavURL(url)); + request.onreadystatechange = function () { + if(request.readyState == 4) { + if(request.status == 204) { + if(single) { + window.location.pathname = removeLastDirectoryPartOf(window.location.pathname); + } else { + el.remove(); + selectedItems.removeElement(id); + } + } - request.send(); - }); + buttons.delete.querySelector('i').changeToDone(request.status != 204, html); + } + } - closePrompt(event); - } + request.send(); + }); + + closePrompt(event); + } } // Handles the delete button event function deleteEvent(event) { - let single = false; + let single = false; - if (!selectedItems.length) { - selectedItems = ["placeholder"]; - single = true; - } + if(!selectedItems.length) { + selectedItems = ["placeholder"]; + single = true; + } - let clone = document.importNode(templates.question.content, true); - clone.querySelector('h3').innerHTML = 'Delete files'; + let clone = document.importNode(templates.question.content, true); + clone.querySelector('h3').innerHTML = 'Delete files'; - if (single) { - clone.querySelector('p').innerHTML = `Are you sure you want to delete this file/folder?`; - } else { - clone.querySelector('p').innerHTML = `Are you sure you want to delete ${selectedItems.length} file(s)?`; - } + if(single) { + clone.querySelector('p').innerHTML = `Are you sure you want to delete this file/folder?`; + } else { + clone.querySelector('p').innerHTML = `Are you sure you want to delete ${selectedItems.length} file(s)?`; + } - clone.querySelector('input').remove(); - clone.querySelector('.ok').innerHTML = 'Delete'; - clone.querySelector('form').addEventListener('submit', deleteSelected(single)); + clone.querySelector('input').remove(); + clone.querySelector('.ok').innerHTML = 'Delete'; + clone.querySelector('form').addEventListener('submit', deleteSelected(single)); - document.body.appendChild(clone); - document.querySelector('.overlay').classList.add('active'); - document.querySelector('.prompt').classList.add('active'); + document.body.appendChild(clone); + document.querySelector('.overlay').classList.add('active'); + document.querySelector('.prompt').classList.add('active'); - return false; + return false; } function resetSearchText() { - let box = document.querySelector('#search > div div'); + let box = document.querySelector('#search > div div'); - if (user.AllowCommands) { - box.innerHTML = `Search or use one of your supported commands: ${user.Commands.join(", ")}.`; - } else { - box.innerHTML = "Type and press enter to search."; - } + if(user.AllowCommands) { + box.innerHTML = `Search or use one of your supported commands: ${user.Commands.join(", ")}.`; + } else { + box.innerHTML = "Type and press enter to search."; + } } function searchEvent(event) { - if (this.value.length == 0) { - resetSearchText(); - return; - } - - let value = this.value, - search = document.getElementById('search'), - scrollable = document.querySelector('#search > div'), - box = document.querySelector('#search > div div'), - pieces = value.split(' '), - supported = false; - - user.Commands.forEach(function (cmd) { - if (cmd == pieces[0]) { - supported = true; - } - }); - - if (!supported || !user.AllowCommands) { - box.innerHTML = "Press enter to search." - } else { - box.innerHTML = "Press enter to execute." - } - - if (event.keyCode == 13) { - box.innerHTML = ''; - search.classList.add('ongoing'); - - let url = window.location.host + window.location.pathname; - - if (document.getElementById("editor")) { - url = removeLastDirectoryPartOf(url); + if(this.value.length == 0) { + resetSearchText(); + return; } - if (supported && user.AllowCommands) { - let conn = new WebSocket(`ws://${url}?command=true`); + let value = this.value, + search = document.getElementById('search'), + scrollable = document.querySelector('#search > div'), + box = document.querySelector('#search > div div'), + pieces = value.split(' '), + supported = false; - conn.onopen = function () { - conn.send(value); - }; + user.Commands.forEach(function (cmd) { + if(cmd == pieces[0]) { + supported = true; + } + }); - conn.onmessage = function (event) { - box.innerHTML = event.data; - scrollable.scrollTop = scrollable.scrollHeight; - } - - conn.onclose = function (event) { - search.classList.remove('ongoing'); - reloadListing(); - } - - return; + if(!supported || !user.AllowCommands) { + box.innerHTML = "Press enter to search." + } else { + box.innerHTML = "Press enter to execute." } - box.innerHTML = ''; + if(event.keyCode == 13) { + box.innerHTML = ''; + search.classList.add('ongoing'); - let ul = box.querySelector('ul'), - conn = new WebSocket(`ws://${url}?search=true`); + let url = window.location.host + window.location.pathname; - conn.onopen = function () { - conn.send(value); - }; + if(document.getElementById("editor")) { + url = removeLastDirectoryPartOf(url); + } - conn.onmessage = function (event) { - ul.innerHTML += '
  • ' + event.data + '
  • '; - scrollable.scrollTop = scrollable.scrollHeight; + if(supported && user.AllowCommands) { + let conn = new WebSocket(`ws://${url}?command=true`); + + conn.onopen = function () { + conn.send(value); + }; + + conn.onmessage = function (event) { + box.innerHTML = event.data; + scrollable.scrollTop = scrollable.scrollHeight; + } + + conn.onclose = function (event) { + search.classList.remove('ongoing'); + reloadListing(); + } + + return; + } + + box.innerHTML = ''; + + let ul = box.querySelector('ul'), + conn = new WebSocket(`ws://${url}?search=true`); + + conn.onopen = function () { + conn.send(value); + }; + + conn.onmessage = function (event) { + ul.innerHTML += '
  • ' + event.data + '
  • '; + scrollable.scrollTop = scrollable.scrollHeight; + } + + conn.onclose = function (event) { + search.classList.remove('ongoing'); + } } - - conn.onclose = function (event) { - search.classList.remove('ongoing'); - } - } } function setupSearch() { - let search = document.getElementById("search"), - searchInput = search.querySelector("input"), - searchDiv = search.querySelector("div"), - hover = false, - focus = false; + let search = document.getElementById("search"), + searchInput = search.querySelector("input"), + searchDiv = search.querySelector("div"), + hover = false, + focus = false; - resetSearchText(); + resetSearchText(); - searchInput.addEventListener('focus', event => { - focus = true; - search.classList.add('active'); - }); + searchInput.addEventListener('focus', event => { + focus = true; + search.classList.add('active'); + }); - searchDiv.addEventListener('mouseover', event => { - hover = true; - search.classList.add('active'); - }); + searchDiv.addEventListener('mouseover', event => { + hover = true; + search.classList.add('active'); + }); - searchInput.addEventListener('blur', event => { - focus = false; - if (hover) return; - search.classList.remove('active'); - }); + searchInput.addEventListener('blur', event => { + focus = false; + if(hover) + return; + search.classList.remove('active'); + }); - search.addEventListener('mouseleave', event => { - hover = false; - if (focus) return; - search.classList.remove('active'); - }); + search.addEventListener('mouseleave', event => { + hover = false; + if(focus) + return; + search.classList.remove('active'); + }); - search.addEventListener("click", event => { - search.classList.add("active"); - search.querySelector("input").focus(); - }); + search.addEventListener("click", event => { + search.classList.add("active"); + search.querySelector("input").focus(); + }); - searchInput.addEventListener('keyup', searchEvent); + searchInput.addEventListener('keyup', searchEvent); } function closeHelp(event) { - event.preventDefault(); + event.preventDefault(); - document.querySelector('.help').classList.remove('active'); - document.querySelector('.overlay').classList.remove('active'); + document.querySelector('.help').classList.remove('active'); + document.querySelector('.overlay').classList.remove('active'); } function openHelp(event) { - closePrompt(event); + closePrompt(event); - document.querySelector('.help').classList.add('active'); - document.querySelector('.overlay').classList.add('active'); + document.querySelector('.help').classList.add('active'); + document.querySelector('.overlay').classList.add('active'); } window.addEventListener('keydown', (event) => { - if (event.keyCode == 27) { - if (document.querySelector('.help.active')) { - closeHelp(event); + if(event.keyCode == 27) { + if(document.querySelector('.help.active')) { + closeHelp(event); + } } - } - if (event.keyCode == 46) { - deleteEvent(event); - } + if(event.keyCode == 46) { + deleteEvent(event); + } - if (event.keyCode == 112) { - event.preventDefault(); - openHelp(event); - } + if(event.keyCode == 112) { + event.preventDefault(); + openHelp(event); + } }); /* * * * * * * * * * * * * * * * @@ -565,65 +578,65 @@ window.addEventListener('keydown', (event) => { * * * * * * * * * * * * * * * */ document.addEventListener("DOMContentLoaded", function (event) { - overlay = document.querySelector('.overlay'); - clickOverlay = document.querySelector('#click-overlay'); + overlay = document.querySelector('.overlay'); + clickOverlay = document.querySelector('#click-overlay'); - buttons.logout = document.getElementById("logout"); - buttons.open = document.getElementById("open"); - buttons.delete = document.getElementById("delete"); - buttons.previous = document.getElementById("previous"); - buttons.move = document.getElementById("move"); + buttons.logout = document.getElementById("logout"); + buttons.open = document.getElementById("open"); + buttons.delete = document.getElementById("delete"); + buttons.previous = document.getElementById("previous"); + buttons.move = document.getElementById("move"); - // Attach event listeners - buttons.logout.addEventListener("click", logoutEvent); - buttons.open.addEventListener("click", openEvent); - buttons.move.addEventListener("click", moveEvent); + // Attach event listeners + buttons.logout.addEventListener("click", logoutEvent); + buttons.open.addEventListener("click", openEvent); + buttons.move.addEventListener("click", moveEvent); - templates.question = document.querySelector('#question-template'); - templates.info = document.querySelector('#info-template'); - templates.move = document.querySelector("#move-template"); + templates.question = document.querySelector('#question-template'); + templates.info = document.querySelector('#info-template'); + templates.move = document.querySelector("#move-template"); - if (user.AllowEdit) { - buttons.delete.addEventListener("click", deleteEvent); - } - - let dropdownButtons = document.querySelectorAll('.action[data-dropdown]') - Array.from(dropdownButtons).forEach(button => { - button.addEventListener("click", event => { - button.querySelector('ul').classList.toggle("active"); - clickOverlay.classList.add('active'); - - clickOverlay.addEventListener('click', event => { - button.querySelector('ul').classList.remove("active"); - clickOverlay.classList.remove('active'); - }) - }); - }); - - overlay.addEventListener('click', event => { - if (document.querySelector('.help.active')) { - closeHelp(event); - return; + if(user.AllowEdit) { + buttons.delete.addEventListener("click", deleteEvent); } - closePrompt(event); - }) + let dropdownButtons = document.querySelectorAll('.action[data-dropdown]') + Array.from(dropdownButtons).forEach(button => { + button.addEventListener("click", event => { + button.querySelector('ul').classList.toggle("active"); + clickOverlay.classList.add('active'); - let mainActions = document.getElementById('main-actions'); + clickOverlay.addEventListener('click', event => { + button.querySelector('ul').classList.remove("active"); + clickOverlay.classList.remove('active'); + }) + }); + }); - document.getElementById('more').addEventListener('click', event => { - event.preventDefault(); - event.stopPropagation(); + overlay.addEventListener('click', event => { + if(document.querySelector('.help.active')) { + closeHelp(event); + return; + } - clickOverlay.classList.add('active'); - mainActions.classList.add('active'); - - clickOverlay.addEventListener('click', event => { - mainActions.classList.remove('active'); - clickOverlay.classList.remove('active'); + closePrompt(event); }) - }) - setupSearch(); - return false; + let mainActions = document.getElementById('main-actions'); + + document.getElementById('more').addEventListener('click', event => { + event.preventDefault(); + event.stopPropagation(); + + clickOverlay.classList.add('active'); + mainActions.classList.add('active'); + + clickOverlay.addEventListener('click', event => { + mainActions.classList.remove('active'); + clickOverlay.classList.remove('active'); + }) + }) + + setupSearch(); + return false; }); \ No newline at end of file diff --git a/_embed/public/js/editor.js b/_embed/public/js/editor.js index 045c40fb..231478ad 100644 --- a/_embed/public/js/editor.js +++ b/_embed/public/js/editor.js @@ -2,8 +2,8 @@ var editor = {}; -editor.textareaAutoGrow = function() { - let autogrow = function() { +editor.textareaAutoGrow = function () { + let autogrow = function () { console.log(this.style.height) this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px'; @@ -36,7 +36,7 @@ function makeFromBaseTemplate(id, type, name, parent) { clone.querySelector('.delete').addEventListener('click', deleteFrontMatterItem); clone.querySelector('.add').addEventListener('click', addFrontMatterItem); - if (parent.classList.contains("frontmatter")) { + if(parent.classList.contains("frontmatter")) { parent.insertBefore(clone, document.querySelector('div.button.add')); return } @@ -71,20 +71,20 @@ function makeFromObjectItemTemplate(id, name, parent) { } function addFrontMatterItemPrompt(parent) { - return function(event) { + return function (event) { event.preventDefault(); let value = event.currentTarget.querySelector('input').value; - if (value === '') { + if(value === '') { return true; } closePrompt(event); let name = value.substring(0, value.lastIndexOf(':')), - type = value.substring(value.lastIndexOf(':') + 1, value.length); + type = value.substring(value.lastIndexOf(':') + 1, value.length); - if (type !== "" && type !== "array" && type !== "object") { + if(type !== "" && type !== "array" && type !== "object") { name = value; } @@ -92,12 +92,12 @@ function addFrontMatterItemPrompt(parent) { let id = name; - if (parent.id != '') { + if(parent.id != '') { id = parent.id + "." + id; } - if (type == "array" || type == "object") { - if (parent.dataset.type == "parent") { + if(type == "array" || type == "object") { + if(parent.dataset.type == "parent") { makeFromBaseTemplate(id, type, name, document.querySelector('.frontmatter')); return; } @@ -108,7 +108,7 @@ function addFrontMatterItemPrompt(parent) { let group = parent.querySelector('.group'); - if (group == null) { + if(group == null) { parent.insertAdjacentHTML('afterbegin', '
    '); group = parent.querySelector('.group'); } @@ -121,18 +121,18 @@ function addFrontMatterItem(event) { event.preventDefault(); let parent = event.currentTarget.parentNode, - type = parent.dataset.type; + type = parent.dataset.type; // If the block is an array - if (type === "array") { + if(type === "array") { let id = parent.id + "[]", - count = parent.querySelectorAll('.group > div').length, - fieldsets = parent.getElementsByTagName("fieldset"); + count = parent.querySelectorAll('.group > div').length, + fieldsets = parent.getElementsByTagName("fieldset"); - if (fieldsets.length > 0) { + if(fieldsets.length > 0) { let itemType = fieldsets[0].dataset.type, - itemID = parent.id + "[" + fieldsets.length + "]", - itemName = fieldsets.length; + itemID = parent.id + "[" + fieldsets.length + "]", + itemName = fieldsets.length; makeFromBaseTemplate(itemID, itemType, itemName, parent); } else { @@ -142,7 +142,7 @@ function addFrontMatterItem(event) { return; } - if (type == "object" || type == "parent") { + if(type == "object" || type == "parent") { let clone = document.importNode(templates.question.content, true); clone.querySelector('form').id = tempID; clone.querySelector('h3').innerHTML = 'New field'; @@ -160,7 +160,7 @@ function addFrontMatterItem(event) { } document.addEventListener("DOMContentLoaded", (event) => { - if (!document.getElementById('editor')) return; + if(!document.getElementById('editor')) return; editor.textareaAutoGrow(); templates.arrayItem = document.getElementById("array-item-template"); @@ -170,29 +170,29 @@ document.addEventListener("DOMContentLoaded", (event) => { buttons.save = document.querySelector('#save'); let container = document.getElementById('editor'), - kind = container.dataset.kind; + kind = container.dataset.kind; - if (kind != 'frontmatter-only') { + if(kind != 'frontmatter-only') { let editor = document.querySelector('.content #ace'), - mode = editor.dataset.mode, - textarea = document.querySelector('textarea[name="content"]'), - aceEditor = ace.edit('ace'), - options = { - wrap: true, - maxLines: Infinity, - theme: "ace/theme/github", - showPrintMargin: false, - fontSize: "1em", - minLines: 20 - }; + mode = editor.dataset.mode, + textarea = document.querySelector('textarea[name="content"]'), + aceEditor = ace.edit('ace'), + options = { + wrap: true, + maxLines: Infinity, + theme: "ace/theme/github", + showPrintMargin: false, + fontSize: "1em", + minLines: 20 + }; aceEditor.getSession().setMode("ace/mode/" + mode); aceEditor.getSession().setValue(textarea.value); - aceEditor.getSession().on('change', function() { + aceEditor.getSession().on('change', function () { textarea.value = aceEditor.getSession().getValue(); }); - if (mode == "markdown") options.showGutter = false; + if(mode == "markdown") options.showGutter = false; aceEditor.setOptions(options); } @@ -206,25 +206,25 @@ document.addEventListener("DOMContentLoaded", (event) => { button.addEventListener('click', addFrontMatterItem); }); - let saveContent = function() { + let saveContent = function () { let data = form2js(document.querySelector('form')); - if (typeof data.content === "undefined" && kind != 'frontmatter-only') { + if(typeof data.content === "undefined" && kind != 'frontmatter-only') { data.content = ""; } - if (typeof data.content === "number") { + if(typeof data.content === "number") { data.content = data.content.toString(); } let html = buttons.save.querySelector('i').changeToLoading(), - request = new XMLHttpRequest(); + request = new XMLHttpRequest(); request.open("PUT", toWebDavURL(window.location.pathname)); request.setRequestHeader('Kind', kind); request.send(JSON.stringify(data)); - request.onreadystatechange = function() { - if (request.readyState == 4) { + request.onreadystatechange = function () { + if(request.readyState == 4) { buttons.save.querySelector('i').changeToDone((request.status != 201), html); } } @@ -241,9 +241,9 @@ document.addEventListener("DOMContentLoaded", (event) => { }); window.addEventListener('keydown', (event) => { - if (event.ctrlKey || event.metaKey) { - switch (String.fromCharCode(event.which).toLowerCase()) { - case 's': + if(event.ctrlKey || event.metaKey) { + switch(String.fromCharCode(event.which).toLowerCase()) { + case 's': event.preventDefault(); saveContent(); break; @@ -252,4 +252,4 @@ document.addEventListener("DOMContentLoaded", (event) => { }); return false; -}); +}); \ No newline at end of file diff --git a/_embed/public/js/listing.js b/_embed/public/js/listing.js index d5d3ad4c..e9c7ae74 100644 --- a/_embed/public/js/listing.js +++ b/_embed/public/js/listing.js @@ -4,19 +4,19 @@ var listing = { selectMultiple: false }; -listing.reload = function(callback) { +listing.reload = function (callback) { let request = new XMLHttpRequest(); request.open('GET', window.location); request.setRequestHeader('Minimal', 'true'); request.send(); - request.onreadystatechange = function() { - if (request.readyState == 4) { - if (request.status == 200) { + request.onreadystatechange = function () { + if(request.readyState == 4) { + if(request.status == 200) { document.querySelector('body main').innerHTML = request.responseText; listing.addDoubleTapEvent(); - if (typeof callback == 'function') { + if(typeof callback == 'function') { callback(); } } @@ -24,11 +24,11 @@ listing.reload = function(callback) { } } -listing.itemDragStart = function(event) { +listing.itemDragStart = function (event) { let el = event.target; - for (let i = 0; i < 5; i++) { - if (!el.classList.contains('item')) { + for(let i = 0; i < 5; i++) { + if(!el.classList.contains('item')) { el = el.parentElement; } } @@ -37,12 +37,12 @@ listing.itemDragStart = function(event) { event.dataTransfer.setData("name", el.querySelector('.name').innerHTML); } -listing.itemDragOver = function(event) { +listing.itemDragOver = function (event) { event.preventDefault(); let el = event.target; - for (let i = 0; i < 5; i++) { - if (!el.classList.contains('item')) { + for(let i = 0; i < 5; i++) { + if(!el.classList.contains('item')) { el = el.parentElement; } } @@ -50,46 +50,46 @@ listing.itemDragOver = function(event) { el.style.opacity = 1; } -listing.itemDrop = function(e) { +listing.itemDrop = function (e) { e.preventDefault(); let el = e.target, - id = e.dataTransfer.getData("id"), - name = e.dataTransfer.getData("name"); + id = e.dataTransfer.getData("id"), + name = e.dataTransfer.getData("name"); - if (id == "" || name == "") return; + if(id == "" || name == "") return; - for (let i = 0; i < 5; i++) { - if (!el.classList.contains('item')) { + for(let i = 0; i < 5; i++) { + if(!el.classList.contains('item')) { el = el.parentElement; } } - if (el.id === id) return; + if(el.id === id) return; let oldLink = document.getElementById(id).dataset.url, - newLink = el.dataset.url + name; + newLink = el.dataset.url + name; webdav.move(oldLink, newLink) - .then(() => listing.reload()) - .catch(e => console.log(e)); + .then(() => listing.reload()) + .catch(e => console.log(e)); } -listing.documentDrop = function(event) { +listing.documentDrop = function (event) { event.preventDefault(); let dt = event.dataTransfer, - files = dt.files, - el = event.target, - items = document.getElementsByClassName('item'); + files = dt.files, + el = event.target, + items = document.getElementsByClassName('item'); - for (let i = 0; i < 5; i++) { - if (el != null && !el.classList.contains('item')) { + for(let i = 0; i < 5; i++) { + if(el != null && !el.classList.contains('item')) { el = el.parentElement; } } - if (files.length > 0) { - if (el != null && el.classList.contains('item') && el.dataset.dir == "true") { + if(files.length > 0) { + if(el != null && el.classList.contains('item') && el.dataset.dir == "true") { listing.handleFiles(files, el.querySelector('.name').innerHTML + "/"); return; } @@ -102,27 +102,27 @@ listing.documentDrop = function(event) { } } -listing.rename = function(event) { - if (!selectedItems.length || selectedItems.length > 1) { +listing.rename = function (event) { + if(!selectedItems.length || selectedItems.length > 1) { return false; } let item = document.getElementById(selectedItems[0]); - if (item.classList.contains('disabled')) { + if(item.classList.contains('disabled')) { return false; } let link = item.dataset.url, - field = item.querySelector('.name'), - name = field.innerHTML; + field = item.querySelector('.name'), + name = field.innerHTML; let submit = (event) => { event.preventDefault(); let newName = event.currentTarget.querySelector('input').value, - newLink = removeLastDirectoryPartOf(link) + "/" + newName, - html = buttons.rename.querySelector('i').changeToLoading(); + newLink = removeLastDirectoryPartOf(link) + "/" + newName, + html = buttons.rename.querySelector('i').changeToLoading(); closePrompt(event); webdav.move(link, newLink).then(() => { @@ -157,28 +157,28 @@ listing.rename = function(event) { return false; } -listing.handleFiles = function(files, base) { +listing.handleFiles = function (files, base) { let html = buttons.upload.querySelector('i').changeToLoading(), - promises = []; + promises = []; - for (let file of files) { + for(let file of files) { promises.push(webdav.put(window.location.pathname + base + file.name, file)); } Promise.all(promises) - .then(() => { - listing.reload(); - buttons.upload.querySelector('i').changeToDone(false, html); - }) - .catch(e => { - console.log(e); - buttons.upload.querySelector('i').changeToDone(true, html); - }) + .then(() => { + listing.reload(); + buttons.upload.querySelector('i').changeToDone(false, html); + }) + .catch(e => { + console.log(e); + buttons.upload.querySelector('i').changeToDone(true, html); + }) return false; } -listing.unselectAll = function() { +listing.unselectAll = function () { let items = document.getElementsByClassName('item'); Array.from(items).forEach(link => { link.setAttribute("aria-selected", false); @@ -190,22 +190,22 @@ listing.unselectAll = function() { return false; } -listing.handleSelectionChange = function(event) { +listing.handleSelectionChange = function (event) { listing.redefineDownloadURLs(); let selectedNumber = selectedItems.length, - fileAction = document.getElementById("file-only"); + fileAction = document.getElementById("file-only"); - if (selectedNumber) { + if(selectedNumber) { fileAction.classList.remove("disabled"); - if (selectedNumber > 1) { + if(selectedNumber > 1) { buttons.open.classList.add("disabled"); buttons.rename.classList.add("disabled"); } - if (selectedNumber == 1) { - if (document.getElementById(selectedItems[0]).dataset.dir == "true") { + if(selectedNumber == 1) { + if(document.getElementById(selectedItems[0]).dataset.dir == "true") { buttons.open.classList.add("disabled"); } else { buttons.open.classList.remove("disabled"); @@ -221,10 +221,10 @@ listing.handleSelectionChange = function(event) { return false; } -listing.redefineDownloadURLs = function() { +listing.redefineDownloadURLs = function () { let files = ""; - for (let i = 0; i < selectedItems.length; i++) { + for(let i = 0; i < selectedItems.length; i++) { let url = document.getElementById(selectedItems[i]).dataset.url; files += url.replace(window.location.pathname, "") + ","; } @@ -238,16 +238,16 @@ listing.redefineDownloadURLs = function() { }); } -listing.openItem = function(event) { +listing.openItem = function (event) { window.location = event.currentTarget.dataset.url; } -listing.selectItem = function(event) { +listing.selectItem = function (event) { let el = event.currentTarget; - if (selectedItems.length != 0) event.preventDefault(); - if (selectedItems.indexOf(el.id) == -1) { - if (!event.ctrlKey && !listing.selectMultiple) listing.unselectAll(); + if(selectedItems.length != 0) event.preventDefault(); + if(selectedItems.indexOf(el.id) == -1) { + if(!event.ctrlKey && !listing.selectMultiple) listing.unselectAll(); el.setAttribute("aria-selected", true); selectedItems.push(el.id); @@ -260,7 +260,7 @@ listing.selectItem = function(event) { return false; } -listing.newFileButton = function(event) { +listing.newFileButton = function (event) { event.preventDefault(); let clone = document.importNode(templates.question.content, true); @@ -274,18 +274,18 @@ listing.newFileButton = function(event) { document.querySelector('.prompt').classList.add('active'); } -listing.newFilePrompt = function(event) { +listing.newFilePrompt = function (event) { event.preventDefault(); let button = document.getElementById('new'), - html = button.querySelector('i').changeToLoading(), - request = new XMLHttpRequest(), - name = event.currentTarget.querySelector('input').value; + html = button.querySelector('i').changeToLoading(), + request = new XMLHttpRequest(), + name = event.currentTarget.querySelector('input').value; request.open((name.endsWith("/") ? "MKCOL" : "PUT"), toWebDavURL(window.location.pathname + name)); request.send(); - request.onreadystatechange = function() { - if (request.readyState == 4) { + request.onreadystatechange = function () { + if(request.readyState == 4) { button.querySelector('i').changeToDone((request.status != 201), html); listing.reload(); } @@ -295,23 +295,23 @@ listing.newFilePrompt = function(event) { return false; } -listing.updateColumns = function(event) { +listing.updateColumns = function (event) { let columns = Math.floor(document.getElementById('listing').offsetWidth / 300), - items = getCSSRule(['#listing.mosaic .item', '.mosaic#listing .item']); + items = getCSSRule(['#listing.mosaic .item', '.mosaic#listing .item']); items.style.width = `calc(${100/columns}% - 1em)`; } -listing.addDoubleTapEvent = function() { +listing.addDoubleTapEvent = function () { let items = document.getElementsByClassName('item'), - touches = { - id: '', - count: 0 - }; + touches = { + id: '', + count: 0 + }; Array.from(items).forEach(file => { file.addEventListener('touchstart', event => { - if (touches.id != file.id) { + if(touches.id != file.id) { touches.id = file.id; touches.count = 1; @@ -324,7 +324,7 @@ listing.addDoubleTapEvent = function() { touches.count++; - if (touches.count > 1) { + if(touches.count > 1) { window.location = file.dataset.url; } }); @@ -333,22 +333,22 @@ listing.addDoubleTapEvent = function() { // Keydown events window.addEventListener('keydown', (event) => { - if (event.keyCode == 27) { + if(event.keyCode == 27) { listing.unselectAll(); - if (document.querySelectorAll('.prompt').length) { + if(document.querySelectorAll('.prompt').length) { closePrompt(event); } } - if (event.keyCode == 113) { + if(event.keyCode == 113) { listing.rename(); } - if (event.ctrlKey || event.metaKey) { + if(event.ctrlKey || event.metaKey) { console.log("hey") - switch (String.fromCharCode(event.which).toLowerCase()) { - case 's': + switch(String.fromCharCode(event.which).toLowerCase()) { + case 's': event.preventDefault(); window.location = "?download=true" } @@ -383,13 +383,13 @@ document.addEventListener('DOMContentLoaded', event => { document.getElementById('multiple-selection').classList.remove('active'); }) - if (user.AllowEdit) { + if(user.AllowEdit) { buttons.rename.addEventListener("click", listing.rename); } let items = document.getElementsByClassName('item'); - if (user.AllowNew) { + if(user.AllowNew) { buttons.upload.addEventListener("click", (event) => { document.getElementById("upload-input").click(); }); @@ -397,7 +397,7 @@ document.addEventListener('DOMContentLoaded', event => { buttons.new.addEventListener('click', listing.newFileButton); // Drag and Drop - document.addEventListener("dragover", function(event) { + document.addEventListener("dragover", function (event) { event.preventDefault(); }, false); @@ -416,5 +416,4 @@ document.addEventListener('DOMContentLoaded', event => { document.addEventListener("drop", listing.documentDrop, false); } - -}); +}); \ No newline at end of file diff --git a/_embed/public/js/vendor/.jsbeautifyrc b/_embed/public/js/vendor/.jsbeautifyrc deleted file mode 100644 index fe7d3e4c..00000000 --- a/_embed/public/js/vendor/.jsbeautifyrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - "js": { - "allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"], - - // Set brace_style - // collapse: (old default) Put braces on the same line as control statements - // collapse-preserve-inline: (new default) Same as collapse but better support for ES6 destructuring and other features. https://github.com/victorporof/Sublime-HTMLPrettify/issues/231 - // expand: Put braces on own line (Allman / ANSI style) - // end-expand: Put end braces on own line - // none: Keep them where they are - "brace_style": "collapse-preserve-inline", - - "break_chained_methods": false, // Break chained method calls across subsequent lines - "e4x": false, // Pass E4X xml literals through untouched - "end_with_newline": false, // End output with newline - "indent_char": " ", // Indentation character - "indent_level": 0, // Initial indentation level - "indent_size": 2, // Indentation size - "indent_with_tabs": false, // Indent with tabs, overrides `indent_size` and `indent_char` - "jslint_happy": false, // If true, then jslint-stricter mode is enforced - "keep_array_indentation": false, // Preserve array indentation - "keep_function_indentation": false, // Preserve function indentation - "max_preserve_newlines": 0, // Maximum number of line breaks to be preserved in one chunk (0 disables) - "preserve_newlines": true, // Whether existing line breaks should be preserved - "space_after_anon_function": false, // Should the space before an anonymous function's parens be added, "function()" vs "function ()" - "space_before_conditional": true, // Should the space before conditional statement be added, "if(true)" vs "if (true)" - "space_in_empty_paren": false, // Add padding spaces within empty paren, "f()" vs "f( )" - "space_in_paren": false, // Add padding spaces within paren, ie. f( a, b ) - "unescape_strings": false, // Should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65" - "wrap_line_length": 0 // Lines should wrap at next opportunity after this number of characters (0 disables) - } -} diff --git a/_embed/templates/.jsbeautifyrc b/_embed/templates/.jsbeautifyrc deleted file mode 100644 index 52301b6e..00000000 --- a/_embed/templates/.jsbeautifyrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "html": { - "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"], - "brace_style": "collapse", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are - "end_with_newline": false, // End output with newline - "indent_char": " ", // Indentation character - "indent_handlebars": false, // e.g. {{#foo}}, {{/foo}} - "indent_inner_html": false, // Indent and sections - "indent_scripts": "keep", // [keep|separate|normal] - "indent_size": 4, // Indentation size - "max_preserve_newlines": 0, // Maximum number of line breaks to be preserved in one chunk (0 disables) - "preserve_newlines": true, // Whether existing line breaks before elements should be preserved (only works before elements, not inside tags or for text) - "unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1", "h2", "h3", "h4", "h5", "h6"], // List of tags that should not be reformatted - "wrap_line_length": 0 // Lines should wrap at next opportunity after this number of characters (0 disables) - } -} diff --git a/_embed/templates/base.tmpl b/_embed/templates/base.tmpl index f17580fd..07af65a3 100644 --- a/_embed/templates/base.tmpl +++ b/_embed/templates/base.tmpl @@ -197,12 +197,12 @@

    Move

    Choose new house for your file(s)/folder(s):

    - +
    - +

    Currently navigating on: .