From 375a2647eaa35a778b112af29d99e389f5606a12 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 1 Jul 2016 10:46:09 +0100 Subject: [PATCH] updates; fixes; progresses #5 --- assets/.jsbeautifyrc | 62 - assets/binary.go | 124 +- assets/embed/public/css/.jsbeautifyrc | 11 + assets/embed/public/css/styles.css | 1097 +++++++++++++++++ assets/embed/public/js/.jsbeautifyrc | 32 + assets/{ => embed}/public/js/application.js | 5 +- assets/{ => embed}/public/js/form2js.js | 0 assets/embed/templates/.jsbeautifyrc | 16 + assets/{ => embed}/templates/actions.tmpl | 6 +- assets/{ => embed}/templates/base.tmpl | 42 +- assets/{ => embed}/templates/editor.tmpl | 0 assets/{ => embed}/templates/frontmatter.tmpl | 0 assets/{ => embed}/templates/listing.tmpl | 2 +- assets/{ => embed}/templates/minimal.tmpl | 0 assets/{ => embed}/templates/single.tmpl | 0 assets/public/css/styles.css | 1054 ---------------- assets/templates/buttons.tmpl | 23 - filemanager.go | 2 +- page/page.go | 2 +- 19 files changed, 1227 insertions(+), 1251 deletions(-) delete mode 100644 assets/.jsbeautifyrc create mode 100644 assets/embed/public/css/.jsbeautifyrc create mode 100644 assets/embed/public/css/styles.css create mode 100644 assets/embed/public/js/.jsbeautifyrc rename assets/{ => embed}/public/js/application.js (99%) rename assets/{ => embed}/public/js/form2js.js (100%) create mode 100644 assets/embed/templates/.jsbeautifyrc rename assets/{ => embed}/templates/actions.tmpl (58%) rename assets/{ => embed}/templates/base.tmpl (63%) rename assets/{ => embed}/templates/editor.tmpl (100%) rename assets/{ => embed}/templates/frontmatter.tmpl (100%) rename assets/{ => embed}/templates/listing.tmpl (97%) rename assets/{ => embed}/templates/minimal.tmpl (100%) rename assets/{ => embed}/templates/single.tmpl (100%) delete mode 100644 assets/public/css/styles.css delete mode 100644 assets/templates/buttons.tmpl diff --git a/assets/.jsbeautifyrc b/assets/.jsbeautifyrc deleted file mode 100644 index 54a7a705..00000000 --- a/assets/.jsbeautifyrc +++ /dev/null @@ -1,62 +0,0 @@ -{ - // The plugin looks for a .jsbeautifyrc file in the same directory as the - // source file you're prettifying (or any directory above if it doesn't exist, - // or in your home folder if everything else fails) and uses those options - // along the default ones. - - // Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options - // Documentation: https://github.com/einars/js-beautify/ - "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) - }, - "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") - }, - "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": 4, // 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/assets/binary.go b/assets/binary.go index f96d6d21..be4f93e4 100644 --- a/assets/binary.go +++ b/assets/binary.go @@ -1,19 +1,15 @@ // Code generated by go-bindata. // sources: -// assets/.jsbeautifyrc -// assets/assets.go -// assets/binary.go -// assets/public/css/styles.css -// assets/public/js/application.js -// assets/public/js/form2js.js -// assets/templates/actions.tmpl -// assets/templates/base.tmpl -// assets/templates/buttons.tmpl -// assets/templates/editor.tmpl -// assets/templates/frontmatter.tmpl -// assets/templates/listing.tmpl -// assets/templates/minimal.tmpl -// assets/templates/single.tmpl +// assets/embed/public/css/styles.css +// assets/embed/public/js/application.js +// assets/embed/public/js/form2js.js +// assets/embed/templates/actions.tmpl +// assets/embed/templates/base.tmpl +// assets/embed/templates/editor.tmpl +// assets/embed/templates/frontmatter.tmpl +// assets/embed/templates/listing.tmpl +// assets/embed/templates/minimal.tmpl +// assets/embed/templates/single.tmpl // DO NOT EDIT! package assets @@ -40,63 +36,9 @@ type asset struct { info os.FileInfo } -// Jsbeautifyrc reads file data from disk. It returns an error on failure. -func Jsbeautifyrc() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\.jsbeautifyrc" - name := ".jsbeautifyrc" - bytes, err := bindataRead(path, name) - if err != nil { - return nil, err - } - - fi, err := os.Stat(path) - if err != nil { - err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) - } - - a := &asset{bytes: bytes, info: fi} - return a, err -} - -// assetsGo reads file data from disk. It returns an error on failure. -func assetsGo() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\assets.go" - name := "assets.go" - bytes, err := bindataRead(path, name) - if err != nil { - return nil, err - } - - fi, err := os.Stat(path) - if err != nil { - err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) - } - - a := &asset{bytes: bytes, info: fi} - return a, err -} - -// binaryGo reads file data from disk. It returns an error on failure. -func binaryGo() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\binary.go" - name := "binary.go" - bytes, err := bindataRead(path, name) - if err != nil { - return nil, err - } - - fi, err := os.Stat(path) - if err != nil { - err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) - } - - a := &asset{bytes: bytes, info: fi} - return a, err -} - // publicCssStylesCss reads file data from disk. It returns an error on failure. func publicCssStylesCss() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\public\\css\\styles.css" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\public\\css\\styles.css" name := "public/css/styles.css" bytes, err := bindataRead(path, name) if err != nil { @@ -114,7 +56,7 @@ func publicCssStylesCss() (*asset, error) { // publicJsApplicationJs reads file data from disk. It returns an error on failure. func publicJsApplicationJs() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\public\\js\\application.js" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\public\\js\\application.js" name := "public/js/application.js" bytes, err := bindataRead(path, name) if err != nil { @@ -132,7 +74,7 @@ func publicJsApplicationJs() (*asset, error) { // publicJsForm2jsJs reads file data from disk. It returns an error on failure. func publicJsForm2jsJs() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\public\\js\\form2js.js" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\public\\js\\form2js.js" name := "public/js/form2js.js" bytes, err := bindataRead(path, name) if err != nil { @@ -150,7 +92,7 @@ func publicJsForm2jsJs() (*asset, error) { // templatesActionsTmpl reads file data from disk. It returns an error on failure. func templatesActionsTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\actions.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\actions.tmpl" name := "templates/actions.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -168,7 +110,7 @@ func templatesActionsTmpl() (*asset, error) { // templatesBaseTmpl reads file data from disk. It returns an error on failure. func templatesBaseTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\base.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\base.tmpl" name := "templates/base.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -184,27 +126,9 @@ func templatesBaseTmpl() (*asset, error) { return a, err } -// templatesButtonsTmpl reads file data from disk. It returns an error on failure. -func templatesButtonsTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\buttons.tmpl" - name := "templates/buttons.tmpl" - bytes, err := bindataRead(path, name) - if err != nil { - return nil, err - } - - fi, err := os.Stat(path) - if err != nil { - err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err) - } - - a := &asset{bytes: bytes, info: fi} - return a, err -} - // templatesEditorTmpl reads file data from disk. It returns an error on failure. func templatesEditorTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\editor.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\editor.tmpl" name := "templates/editor.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -222,7 +146,7 @@ func templatesEditorTmpl() (*asset, error) { // templatesFrontmatterTmpl reads file data from disk. It returns an error on failure. func templatesFrontmatterTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\frontmatter.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\frontmatter.tmpl" name := "templates/frontmatter.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -240,7 +164,7 @@ func templatesFrontmatterTmpl() (*asset, error) { // templatesListingTmpl reads file data from disk. It returns an error on failure. func templatesListingTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\listing.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\listing.tmpl" name := "templates/listing.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -258,7 +182,7 @@ func templatesListingTmpl() (*asset, error) { // templatesMinimalTmpl reads file data from disk. It returns an error on failure. func templatesMinimalTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\minimal.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\minimal.tmpl" name := "templates/minimal.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -276,7 +200,7 @@ func templatesMinimalTmpl() (*asset, error) { // templatesSingleTmpl reads file data from disk. It returns an error on failure. func templatesSingleTmpl() (*asset, error) { - path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\templates\\single.tmpl" + path := "D:\\Code\\Go\\src\\github.com\\hacdias\\caddy-filemanager\\assets\\embed\\templates\\single.tmpl" name := "templates/single.tmpl" bytes, err := bindataRead(path, name) if err != nil { @@ -344,15 +268,11 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - ".jsbeautifyrc": Jsbeautifyrc, - "assets.go": assetsGo, - "binary.go": binaryGo, "public/css/styles.css": publicCssStylesCss, "public/js/application.js": publicJsApplicationJs, "public/js/form2js.js": publicJsForm2jsJs, "templates/actions.tmpl": templatesActionsTmpl, "templates/base.tmpl": templatesBaseTmpl, - "templates/buttons.tmpl": templatesButtonsTmpl, "templates/editor.tmpl": templatesEditorTmpl, "templates/frontmatter.tmpl": templatesFrontmatterTmpl, "templates/listing.tmpl": templatesListingTmpl, @@ -400,9 +320,6 @@ type bintree struct { Children map[string]*bintree } var _bintree = &bintree{nil, map[string]*bintree{ - ".jsbeautifyrc": &bintree{Jsbeautifyrc, map[string]*bintree{}}, - "assets.go": &bintree{assetsGo, map[string]*bintree{}}, - "binary.go": &bintree{binaryGo, map[string]*bintree{}}, "public": &bintree{nil, map[string]*bintree{ "css": &bintree{nil, map[string]*bintree{ "styles.css": &bintree{publicCssStylesCss, map[string]*bintree{}}, @@ -415,7 +332,6 @@ var _bintree = &bintree{nil, map[string]*bintree{ "templates": &bintree{nil, map[string]*bintree{ "actions.tmpl": &bintree{templatesActionsTmpl, map[string]*bintree{}}, "base.tmpl": &bintree{templatesBaseTmpl, map[string]*bintree{}}, - "buttons.tmpl": &bintree{templatesButtonsTmpl, map[string]*bintree{}}, "editor.tmpl": &bintree{templatesEditorTmpl, map[string]*bintree{}}, "frontmatter.tmpl": &bintree{templatesFrontmatterTmpl, map[string]*bintree{}}, "listing.tmpl": &bintree{templatesListingTmpl, map[string]*bintree{}}, diff --git a/assets/embed/public/css/.jsbeautifyrc b/assets/embed/public/css/.jsbeautifyrc new file mode 100644 index 00000000..9d9f6d3e --- /dev/null +++ b/assets/embed/public/css/.jsbeautifyrc @@ -0,0 +1,11 @@ +{ + "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/assets/embed/public/css/styles.css b/assets/embed/public/css/styles.css new file mode 100644 index 00000000..8d9abb12 --- /dev/null +++ b/assets/embed/public/css/styles.css @@ -0,0 +1,1097 @@ +/* NORMALIZE CSS */ + +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100% +} + +body { + margin: 0 +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary { + display: block +} + +audio, +canvas, +progress, +video { + display: inline-block +} + +audio:not([controls]) { + display: none; + height: 0 +} + +progress { + vertical-align: baseline +} + +template, +[hidden] { + display: none +} + +a { + background-color: transparent; + -webkit-text-decoration-skip: objects +} + +a:active, +a:hover { + outline-width: 0 +} + +abbr[title] { + border-bottom: none; + text-decoration: underline; + text-decoration: underline dotted +} + +b, +strong { + font-weight: inherit +} + +b, +strong { + font-weight: bolder +} + +dfn { + font-style: italic +} + +h1 { + font-size: 2em; + margin: 0.67em 0 +} + +mark { + background-color: #ff0; + color: #000 +} + +small { + font-size: 80% +} + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline +} + +sub { + bottom: -0.25em +} + +sup { + top: -0.5em +} + +img { + border-style: none; + max-width: 100%; +} + +svg:not(:root) { + overflow: hidden +} + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em +} + +figure { + margin: 1em 40px +} + +hr { + box-sizing: content-box; + height: 0; + overflow: visible +} + +button, +input, +select, +textarea { + font: inherit; + margin: 0 +} + +optgroup { + font-weight: bold +} + +button, +input { + overflow: visible +} + +button, +select { + text-transform: none +} + +button, +.button, +html [type="button"], +[type="reset"], +[type="submit"] { + /* -webkit-appearance: button; */ + text-decoration: none; + color: #fff !important; + background-color: #26a69a; + text-align: center; + letter-spacing: .5px; + -webkit-transition: .2s ease-out; + transition: .2s ease-out; + cursor: pointer; + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); + border: none; + border-radius: 2px; + display: inline-block; + height: 2.25em; + line-height: 2.25em; + outline: 0; + padding: 0 2rem; + text-transform: uppercase; + vertical-align: middle; + -webkit-tap-highlight-color: transparent; +} + +button::-moz-focus-inner, +.button::-moz-focus-inner, +. [type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0 +} + +button:-moz-focusring, +.button:-moz-focusring, +, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText +} + +fieldset { + border: none; + margin: 0; + padding: 0; + -webkit-column-break-inside: avoid; + page-break-inside: avoid; + break-inside: avoid; +} + +legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal +} + +textarea { + overflow: auto +} + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; + padding: 0 +} + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto +} + +[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px +} + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none +} + +::-webkit-input-placeholder { + color: inherit; + opacity: 0.54 +} + +::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit +} + + +/* TANANANA */ + +body { + font-family: 'Roboto', sans-serif; + padding-top: 5em; + background-color: #fcfcfc; + text-rendering: optimizespeed; +} + +a { + text-decoration: none; + color: #006ed3; +} + +a:hover, +h1 a:hover { + color: #319cff; +} + +#summary, +header { + padding-right: 7%; + padding-left: 7%; +} + +td:first-child, +th:first-child { + padding-left: 1em; +} + +td:last-child, +th:last-child { + padding-right: 1em; +} + +h1 { + font-size: 1.5em; + font-weight: normal; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +h1 a { + color: inherit; +} + +h1 a:hover { + text-decoration: underline; +} + +main { + display: block; +} + +.meta-item { + margin-right: 1em; +} + +table { + width: 100%; + border-collapse: collapse; +} + +tr { + cursor: pointer; + -webkit-transition: 0.1s ease all; + transition: 0.1s ease all; + border-bottom: 1px dashed #dadada; +} + +tr.selected { + background-color: #ccc; +} + +td, +th { + padding: 1em 0; + text-align: left; +} + +th { + font-size: 16px; + padding-top: 15px; + padding-bottom: 15px; + white-space: nowrap; +} + +th a { + color: black; +} + +th svg { + vertical-align: middle; +} + +td { + font-size: 14px; +} + +td:first-child { + width: 50%; +} + +td:last-child, +th:last-child { + text-align: right; +} + +td:first-child svg { + position: absolute; +} + +td .goup, +td .name { + margin-left: 1.1em; + vertical-align: middle; + white-space: pre-wrap; + word-break: break-all; + color: #424242; + overflow-wrap: break-word; +} + +footer { + font-size: 0.6em; + margin: 3em 0 2em; + text-align: center; + color: grey; +} + +footer a, +footer a:hover { + color: inherit; +} + +.container { + width: 95%; + max-width: 960px; + margin: 0 auto; +} + +pre { + padding: 1em; + border: 1px solid #e6e6e6; + border-radius: 0.5em; + background-color: #f5f5f5; +} + +@media (max-width: 600px) { + td:first-child { + width: auto; + } + td:nth-child(2), + th:nth-child(2) { + padding-right: 5%; + text-align: right; + } +} + + +/* MY STYLES */ + +* { + box-sizing: border-box; +} + + +/* MATERIAL ICONS */ + +.material-icons { + font-family: 'Material Icons'; + font-size: 1.5em; + font-weight: normal; + font-style: normal; + line-height: 1; + /* Preferred icon size */ + display: inline-block; + white-space: nowrap; + letter-spacing: normal; + text-transform: none; + word-wrap: normal; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + -webkit-font-feature-settings: 'liga'; + font-feature-settings: 'liga'; +} + + +/* HEADER */ + +header { + z-index: 999; + padding: 1.7em 0; + background-color: #2196f3; +} + +header h1 { + font-size: 2em; + margin: 0; +} + +header a, +header a:hover { + color: inherit; +} + +header p { + font-size: 1.5em; + max-width: calc(100% - 3em); +} + +header p i { + font-size: 1em !important; + color: rgba(255, 255, 255, .31); +} + +header #logout { + background-color: rgba(0, 0, 0, 0.1); + border-radius: 0; + margin: -0.5em -0.5em -0.5em 0; + padding: .5em; +} + +header p i { + vertical-align: middle; +} + +#search { + position: relative; + display: inline-block; + height: 100%; + padding: 0.75em; + vertical-align: middle; + color: #fff; + border-radius: 0.3em; + background-color: #1e88e5; + transition: .1s ease all; +} + +#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); +} + +#search.active i, +#search.active input { + color: #212121; +} + +#search i, +#search input { + vertical-align: middle; +} + +#search i { + margin-right: 0.3em; + color: rgba(255, 255, 255, .5); +} + +#search input { + min-width: 20em; + border: 0; + outline: 0; + color: #fff; + background-color: transparent; +} + +#search.active div { + visibility: visible; + opacity: 1; + top: 100%; +} + +#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; +} + +#search.active div i, +#sidebar #search.active div i { + color: #ccc; + display: block; + text-align: center; +} + +#search::-webkit-input-placeholder { + /* WebKit, Blink, Edge */ + color: rgba(255, 255, 255, .5); +} + +#search:-moz-placeholder { + opacity: 1; + /* Mozilla Firefox 4 to 18 */ + color: rgba(255, 255, 255, .5); +} + +#search::-moz-placeholder { + opacity: 1; + /* Mozilla Firefox 19+ */ + color: rgba(255, 255, 255, .5); +} + +#search:-ms-input-placeholder { + /* Internet Explorer 10-11 */ + color: rgba(255, 255, 255, .5); +} + +#toolbar, +header { + position: fixed; + top: 0; + left: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: 100%; + padding: 0.5em; + color: #fff; +} + +#toolbar div, +header div { + vertical-align: middle; + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} + +#toolbar p, +header p { + display: inline-block; + margin: 0; + vertical-align: middle; +} + +header #open-nav { + display: none; +} + +#toolbar p a, +#toolbar p a:hover, +header p a, +header p a:hover { + color: inherit; +} + +#toolbar { + z-index: 1000; + top: -4em; + -webkit-transition: 0.2s ease-in-out all; + transition: 0.2s ease-in-out all; + opacity: 0; + color: #fff; + background-color: #6f6f6f; +} + +#toolbar.enabled { + top: 0; + opacity: 1; +} + +#toolbar div:nth-child(2), +header div:nth-child(2) { + text-align: right; +} + +header #overlay { + visibility: hidden; + opacity: 0; + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 999; + transition: .2s ease all; + background-color: rgba(0, 0, 0, 0.35); +} + +header .only-side { + display: none; +} + +.action { + display: inline-block; + margin: 0 0.2em; + cursor: pointer; + -webkit-transition: 0.2s ease all; + transition: 0.2s ease all; + border: 0; + border-radius: 50%; +} + +.action.disabled { + opacity: 0.2; + cursor: not-allowed; +} + +.action i { + padding: 0.5em; + -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); +} + +#toolbar .action span, +header .action span { + display: none; +} + +.floating { + position: fixed; + bottom: 1em; + right: 1em; +} + +.floating .action { + background-color: #68EFAD; + color: #306e50; + 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: 10em; + border-radius: .2em; +} + +#newdir.enabled { + opacity: 1; +} + +*, +*:hover, +*:active, +*:focus { + outline: 0 +} + + +/* SIDEBAR */ + + +/* LISTING */ + +#listing { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding: 0 0.5em; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +#listing.list { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} + +#listing .item { + margin: 0 0.5em 1em; + padding: 0.5em; + cursor: pointer; + -webkit-transition: 0.2s ease all; + transition: 0.2s ease all; + border: 0.2em solid #fff; + border-radius: 0.2em; + background-color: #fff; + box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + position: relative; +} + +#listing .item:hover .checkbox { + opacity: 1; +} + +#listing .item .checkbox { + position: absolute; + top: -.9em; + right: -.9em; + border-radius: 50%; + background: #fff; + border: 0; + -webkit-appearance: initial; + box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); + line-height: 0; + padding: .4em; + transition: .2s ease all; + opacity: 0; +} + +#listing .checkbox i { + font-size: 1em; + margin: 0; +} + +.item:hover { + box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24) !important; +} + +.item.selected { + border-color: #6f6f6f !important; +} + +.item div { + display: inline-block; + vertical-align: middle; +} + +.item p { + font-size: 0.9em; + margin: 0; + color: #4e4e4e; +} + +.item span { + font-weight: bold; +} + +.item i { + font-size: 4em; + margin-right: 0.1em; +} + +.item a, +.item a:hover { + color: #6f6f6f; +} + + +/* ANIMATIONS */ + +i.spin { + -webkit-animation: 1s spin linear infinite; + animation: 1s spin linear infinite; +} + +@-webkit-keyframes spin { + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} + +@keyframes spin { + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} + + +/* EDITOR */ + +#editor .frontmatter { + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; + -webkit-column-gap: 1em; + -moz-column-gap: 1em; + column-gap: 1em; + margin-bottom: 1em; +} + +#editor .group, +#editor #editor-source { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); + display: block; + border-radius: .2em; + padding: .5em; + margin-bottom: 1em; + -webkit-column-break-inside: avoid; + page-break-inside: avoid; + break-inside: avoid; + background-color: #fff; + display: inline-block; + width: 100%; + break-inside: avoid-column; +} + +#editor .block { + border-bottom: 1px solid #eee; + margin-bottom: .5em; + padding-bottom: .5em; +} + +#editor .block:last-child { + border: 0; + margin: 0; + padding: 0; +} + +#editor .block label { + display: block; + color: #212121; + font-weight: 500; +} + +#editor h3 { + margin: 0 0 .5em; + display: inline-block; + vertical-align: middle; + width: calc(100% - 2.5em); +} + +#editor .block input, +#editor .block .actions { + display: inline-block; +} + +#editor .block input, +#editor .block textarea, +#editor fieldset input, +#editor fieldset textarea { + border: 0; + background-color: transparent; + overflow: hidden; + color: #9E9E9E; + resize: none; + width: calc(100% - 1.5em); +} + +#editor .action { + border: 0; + background-color: transparent; + font-size: .8em; + margin: 0; +} + +#editor .delete, +#editor .add { + color: #ddd; +} + +#editor i { + padding: 0; +} + +#editor .add:hover i { + color: #8BC34A; +} + +#editor .delete:hover i { + color: #E53935; +} + +#editor .add:hover i, +#editor .delete:hover i { + background-color: transparent; +} + +#editor fieldset> .action { + opacity: 0; +} + +#editor fieldset:hover> .action { + opacity: 1; +} + +#editor textarea[name="content"] { + display: none; +} + +#editor fieldset fieldset { + margin-left: 1em; +} + +#editor button span { + vertical-align: middle; + transition: 0.2s ease-in-out all; +} + +#editor button span i { + vertical-align: sub; + font-size: 1.3rem; + margin-right: .2em; +} + +#editor #publish { + background-color: #167169; +} + +#editor .group.temp { + background-color: #f5f5f5; +} + +#editor .group.temp label { + font-weight: lighter; + font-size: .8em; + margin-bottom: 1em; + color: #7d7d7d; +} + +#editor .group.temp input { + color: #212121; +} + +#editor .right { + display: inline-block; + text-align: right; + float: right; +} + +@media screen and (max-width: 1024px) { + header .only-side { + display: block; + padding: .5em; + background-color: #2196f3; + color: #fff; + max-height: 4em; + } + header> div:first-child #prev { + display: none; + } + header #open-nav { + display: inline-block; + } + /* SIDEBAR */ + header> div:nth-child(2) { + position: fixed; + top: 0; + z-index: 999999; + background-color: #fff; + height: 100%; + width: 95%; + max-width: 20em; + text-align: left; + color: #212121; + left: -100%; + transition: .2s ease-in-out all; + } + header> div:nth-child(2).active { + left: 0; + } + header> div:nth-child(2).active+ #overlay { + opacity: 1; + visibility: visible; + } + header #search { + height: auto; + background-color: transparent; + color: #212121; + padding: 0; + border-bottom: 1px solid #eee; + border-radius: 0; + display: block; + width: 100%; + text-align: left; + } + header #search input { + color: #212121; + display: inline-block; + width: auto; + min-width: 0; + } + header #search i { + color: #212121; + display: inline-block; + padding: .5em; + margin: 0; + } + header> div:nth-child(2)> div { + display: block; + } + header> div:nth-child(2) .action { + border-radius: 0 !important; + padding: 0 !important; + margin: 0 !important; + text-align: left; + background-color: transparent !important; + } + header> div:nth-child(2) #prev { + border-radius: 50% !important; + } + header> div:nth-child(2) .action:hover { + background-color: rgba(0, 0, 0, .1) !important; + } + header> div:nth-child(2) .action:hover i { + background-color: transparent; + } + header> div:nth-child(2) .action i { + border-radius: 0; + } + header> div:nth-child(2) .action span {} + header> div:nth-child(2) .action i, + header> div:nth-child(2) .action span { + vertical-align: middle; + display: inline-block; + } +} + +@media screen and (max-width: 700px) { + header> div:first-child p a, + header> div:first-child p i { + display: none !important; + } + #editor .frontmatter { + column-count: 1; + column-gap: 0; + } +} \ No newline at end of file diff --git a/assets/embed/public/js/.jsbeautifyrc b/assets/embed/public/js/.jsbeautifyrc new file mode 100644 index 00000000..3077c481 --- /dev/null +++ b/assets/embed/public/js/.jsbeautifyrc @@ -0,0 +1,32 @@ +{ + "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": 4, // 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/assets/public/js/application.js b/assets/embed/public/js/application.js similarity index 99% rename from assets/public/js/application.js rename to assets/embed/public/js/application.js index 7b897f35..585df96d 100644 --- a/assets/public/js/application.js +++ b/assets/embed/public/js/application.js @@ -785,7 +785,10 @@ document.addEventListener("DOMContentLoaded", function(event) { document.getElementById("delete").addEventListener("click", deleteEvent); document.getElementById("download").addEventListener("click", downloadEvent); document.getElementById("open-nav").addEventListener("click", event => { - let sidebar = document.querySelector("header > div:nth-child(2)").classList.toggle("active"); + document.querySelector("header > div:nth-child(2)").classList.toggle("active"); + }); + document.getElementById("overlay").addEventListener("click", event => { + document.querySelector("header > div:nth-child(2)").classList.toggle("active"); }); if (document.getElementById('listing')) { diff --git a/assets/public/js/form2js.js b/assets/embed/public/js/form2js.js similarity index 100% rename from assets/public/js/form2js.js rename to assets/embed/public/js/form2js.js diff --git a/assets/embed/templates/.jsbeautifyrc b/assets/embed/templates/.jsbeautifyrc new file mode 100644 index 00000000..52301b6e --- /dev/null +++ b/assets/embed/templates/.jsbeautifyrc @@ -0,0 +1,16 @@ +{ + "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/assets/templates/actions.tmpl b/assets/embed/templates/actions.tmpl similarity index 58% rename from assets/templates/actions.tmpl rename to assets/embed/templates/actions.tmpl index 2dfb4f45..635da57f 100644 --- a/assets/templates/actions.tmpl +++ b/assets/embed/templates/actions.tmpl @@ -1,6 +1,6 @@ {{ define "actions" }}
- open_in_new + open_in_new See raw
{{ if .IsDir }}
@@ -8,9 +8,9 @@
{{ end }}
- file_download + file_download Download
- delete + delete Delete
{{ end }} diff --git a/assets/templates/base.tmpl b/assets/embed/templates/base.tmpl similarity index 63% rename from assets/templates/base.tmpl rename to assets/embed/templates/base.tmpl index effeb83a..79b30893 100644 --- a/assets/templates/base.tmpl +++ b/assets/embed/templates/base.tmpl @@ -42,8 +42,48 @@
- {{ template "buttons" . }} + + + {{ if .IsDir}} + + + +
+ view_headline Switch view +
+
+ file_upload Upload +
+ {{ else }} + {{ template "actions" . }} + {{ end }} + +
+ exit_to_app Logout +
+
{{ if .IsDir }} diff --git a/assets/templates/editor.tmpl b/assets/embed/templates/editor.tmpl similarity index 100% rename from assets/templates/editor.tmpl rename to assets/embed/templates/editor.tmpl diff --git a/assets/templates/frontmatter.tmpl b/assets/embed/templates/frontmatter.tmpl similarity index 100% rename from assets/templates/frontmatter.tmpl rename to assets/embed/templates/frontmatter.tmpl diff --git a/assets/templates/listing.tmpl b/assets/embed/templates/listing.tmpl similarity index 97% rename from assets/templates/listing.tmpl rename to assets/embed/templates/listing.tmpl index 5ca6e9d6..6f19f6c6 100644 --- a/assets/templates/listing.tmpl +++ b/assets/embed/templates/listing.tmpl @@ -20,7 +20,7 @@ {{- else}}

{{.HumanSize}}

{{- end}} -

+

diff --git a/assets/templates/minimal.tmpl b/assets/embed/templates/minimal.tmpl similarity index 100% rename from assets/templates/minimal.tmpl rename to assets/embed/templates/minimal.tmpl diff --git a/assets/templates/single.tmpl b/assets/embed/templates/single.tmpl similarity index 100% rename from assets/templates/single.tmpl rename to assets/embed/templates/single.tmpl diff --git a/assets/public/css/styles.css b/assets/public/css/styles.css deleted file mode 100644 index 4b693333..00000000 --- a/assets/public/css/styles.css +++ /dev/null @@ -1,1054 +0,0 @@ -/* NORMALIZE CSS */ - -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100% -} - -body { - margin: 0 -} - -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block -} - -audio, -canvas, -progress, -video { - display: inline-block -} - -audio:not([controls]) { - display: none; - height: 0 -} - -progress { - vertical-align: baseline -} - -template, -[hidden] { - display: none -} - -a { - background-color: transparent; - -webkit-text-decoration-skip: objects -} - -a:active, -a:hover { - outline-width: 0 -} - -abbr[title] { - border-bottom: none; - text-decoration: underline; - text-decoration: underline dotted -} - -b, -strong { - font-weight: inherit -} - -b, -strong { - font-weight: bolder -} - -dfn { - font-style: italic -} - -h1 { - font-size: 2em; - margin: 0.67em 0 -} - -mark { - background-color: #ff0; - color: #000 -} - -small { - font-size: 80% -} - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline -} - -sub { - bottom: -0.25em -} - -sup { - top: -0.5em -} - -img { - border-style: none; - max-width: 100%; -} - -svg:not(:root) { - overflow: hidden -} - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em -} - -figure { - margin: 1em 40px -} - -hr { - box-sizing: content-box; - height: 0; - overflow: visible -} - -button, -input, -select, -textarea { - font: inherit; - margin: 0 -} - -optgroup { - font-weight: bold -} - -button, -input { - overflow: visible -} - -button, -select { - text-transform: none -} - -button, -.button, -html [type="button"], -[type="reset"], -[type="submit"] { - /* -webkit-appearance: button; */ - text-decoration: none; - color: #fff !important; - background-color: #26a69a; - text-align: center; - letter-spacing: .5px; - -webkit-transition: .2s ease-out; - transition: .2s ease-out; - cursor: pointer; - box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); - border: none; - border-radius: 2px; - display: inline-block; - height: 2.25em; - line-height: 2.25em; - outline: 0; - padding: 0 2rem; - text-transform: uppercase; - vertical-align: middle; - -webkit-tap-highlight-color: transparent; -} - -button::-moz-focus-inner, -.button::-moz-focus-inner, -. [type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0 -} - -button:-moz-focusring, -.button:-moz-focusring, -, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText -} - -fieldset { - border: none; - margin: 0; - padding: 0; - -webkit-column-break-inside: avoid; - page-break-inside: avoid; - break-inside: avoid; -} - -legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal -} - -textarea { - overflow: auto -} - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; - padding: 0 -} - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto -} - -[type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px -} - -[type="search"]::-webkit-search-cancel-button, -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none -} - -::-webkit-input-placeholder { - color: inherit; - opacity: 0.54 -} - -::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit -} - - -/* TANANANA */ - -body { - font-family: 'Roboto', sans-serif; - padding-top: 5em; - background-color: #fcfcfc; - text-rendering: optimizespeed; -} - -a { - text-decoration: none; - color: #006ed3; -} - -a:hover, -h1 a:hover { - color: #319cff; -} - -#summary, -header { - padding-right: 7%; - padding-left: 7%; -} - -td:first-child, -th:first-child { - padding-left: 1em; -} - -td:last-child, -th:last-child { - padding-right: 1em; -} - -h1 { - font-size: 1.5em; - font-weight: normal; - overflow-x: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -h1 a { - color: inherit; -} - -h1 a:hover { - text-decoration: underline; -} - -main { - display: block; -} - -.meta-item { - margin-right: 1em; -} - -table { - width: 100%; - border-collapse: collapse; -} - -tr { - cursor: pointer; - -webkit-transition: 0.1s ease all; - transition: 0.1s ease all; - border-bottom: 1px dashed #dadada; -} - -tr.selected { - background-color: #ccc; -} - -td, -th { - padding: 1em 0; - text-align: left; -} - -th { - font-size: 16px; - padding-top: 15px; - padding-bottom: 15px; - white-space: nowrap; -} - -th a { - color: black; -} - -th svg { - vertical-align: middle; -} - -td { - font-size: 14px; -} - -td:first-child { - width: 50%; -} - -td:last-child, -th:last-child { - text-align: right; -} - -td:first-child svg { - position: absolute; -} - -td .goup, -td .name { - margin-left: 1.1em; - vertical-align: middle; - white-space: pre-wrap; - word-break: break-all; - color: #424242; - overflow-wrap: break-word; -} - -footer { - font-size: 0.6em; - margin: 3em 0 2em; - text-align: center; - color: grey; -} - -footer a, -footer a:hover { - color: inherit; -} - -.container { - width: 95%; - max-width: 960px; - margin: 0 auto; -} - -pre { - padding: 1em; - border: 1px solid #e6e6e6; - border-radius: 0.5em; - background-color: #f5f5f5; -} - -@media (max-width: 600px) { - .hideable { - display: none; - } - td:first-child { - width: auto; - } - td:nth-child(2), - th:nth-child(2) { - padding-right: 5%; - text-align: right; - } -} - - -/* MY STYLES */ - -* { - box-sizing: border-box; -} - - -/* MATERIAL ICONS */ - -.material-icons { - font-family: 'Material Icons'; - font-size: 1.5em; - font-weight: normal; - font-style: normal; - line-height: 1; - /* Preferred icon size */ - display: inline-block; - white-space: nowrap; - letter-spacing: normal; - text-transform: none; - word-wrap: normal; - direction: ltr; - /* Support for all WebKit browsers. */ - -webkit-font-smoothing: antialiased; - /* Support for Safari and Chrome. */ - text-rendering: optimizeLegibility; - /* Support for Firefox. */ - -moz-osx-font-smoothing: grayscale; - /* Support for IE. */ - -webkit-font-feature-settings: 'liga'; - font-feature-settings: 'liga'; -} - - -/* HEADER */ - -header { - z-index: 999; - padding: 1.7em 0; - background-color: #2196f3; -} - -header h1 { - font-size: 2em; - margin: 0; -} - -header a, -header a:hover { - color: inherit; -} - -header p { - font-size: 1.5em; -} - -header p i { - font-size: 1em !important; - color: rgba(255, 255, 255, .31); -} - -header #logout { - background-color: rgba(0, 0, 0, 0.1); - border-radius: 0; - margin: -0.5em -0.5em -0.5em 0; - padding: .5em; -} - -header p i { - vertical-align: middle; -} - -#search { - position: relative; - display: inline-block; - height: 100%; - padding: 0.75em; - vertical-align: middle; - color: #fff; - border-radius: 0.3em; - background-color: #1e88e5; - transition: .1s ease all; -} - -#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); -} - -#search.active i, -#search.active input { - color: #212121; -} - -#search i, -#search input { - vertical-align: middle; -} - -#search i { - margin-right: 0.3em; - color: rgba(255, 255, 255, .5); -} - -#search input { - min-width: 20em; - border: 0; - outline: 0; - color: #fff; - background-color: transparent; -} - -#search.active div { - visibility: visible; - opacity: 1; - top: 100%; -} - -#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; -} - -#search.active div i, -#sidebar #search.active div i { - color: #ccc; - display: block; - text-align: center; -} - -#search::-webkit-input-placeholder { - /* WebKit, Blink, Edge */ - color: rgba(255, 255, 255, .5); -} - -#search:-moz-placeholder { - opacity: 1; - /* Mozilla Firefox 4 to 18 */ - color: rgba(255, 255, 255, .5); -} - -#search::-moz-placeholder { - opacity: 1; - /* Mozilla Firefox 19+ */ - color: rgba(255, 255, 255, .5); -} - -#search:-ms-input-placeholder { - /* Internet Explorer 10-11 */ - color: rgba(255, 255, 255, .5); -} - -#toolbar, -header { - position: fixed; - top: 0; - left: 0; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - width: 100%; - padding: 0.5em; - color: #fff; -} - -#toolbar div, -header div { - vertical-align: middle; - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; -} - -#toolbar p, -header p { - display: inline-block; - margin: 0; - vertical-align: middle; -} - -header #open-nav { - display: none; -} - -#toolbar p a, -#toolbar p a:hover, -header p a, -header p a:hover { - color: inherit; -} - -#toolbar { - z-index: 1000; - top: -4em; - -webkit-transition: 0.2s ease-in-out all; - transition: 0.2s ease-in-out all; - opacity: 0; - color: #fff; - background-color: #6f6f6f; -} - -#toolbar.enabled { - top: 0; - opacity: 1; -} - -#toolbar div:nth-child(2), -header div:nth-child(2) { - text-align: right; -} - -.action { - display: inline-block; - margin: 0 0.2em; - cursor: pointer; - -webkit-transition: 0.2s ease all; - transition: 0.2s ease all; - border: 0; - border-radius: 50%; -} - -.action.disabled { - opacity: 0.2; - cursor: not-allowed; -} - -.action i { - padding: 0.5em; - -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); -} - -header .action span { - display: none; -} - -.floating { - position: fixed; - bottom: 1em; - right: 1em; -} - -.floating .action { - background-color: #68EFAD; - color: #306e50; - 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: 10em; - border-radius: .2em; -} - -#newdir.enabled { - opacity: 1; -} - -*, -*:hover, -*:active, -*:focus { - outline: 0 -} - - -/* SIDEBAR */ - - -/* LISTING */ - -#listing { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - padding: 0 0.5em; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; -} - -#listing.list { - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; -} - -#listing .item { - margin: 0 0.5em 1em; - padding: 0.5em; - cursor: pointer; - -webkit-transition: 0.2s ease all; - transition: 0.2s ease all; - border: 0.2em solid #fff; - border-radius: 0.2em; - background-color: #fff; - box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - position: relative; -} - -#listing .item:hover .checkbox { - opacity: 1; -} - -#listing .item .checkbox { - position: absolute; - top: -.9em; - right: -.9em; - border-radius: 50%; - background: #fff; - border: 0; - -webkit-appearance: initial; - box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12); - line-height: 0; - padding: .4em; - transition: .2s ease all; - opacity: 0; -} - -#listing .checkbox i { - font-size: 1em; - margin: 0; -} - -.item:hover { - box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24) !important; -} - -.item.selected { - border-color: #6f6f6f !important; -} - -.item div { - display: inline-block; - vertical-align: middle; -} - -.item p { - font-size: 0.9em; - margin: 0; - color: #4e4e4e; -} - -.item span { - font-weight: bold; -} - -.item i { - font-size: 4em; - margin-right: 0.1em; -} - -.item a, -.item a:hover { - color: #6f6f6f; -} - - -/* ANIMATIONS */ - -i.spin { - -webkit-animation: 1s spin linear infinite; - animation: 1s spin linear infinite; -} - -@-webkit-keyframes spin { - 100% { - -webkit-transform: rotate(-360deg); - transform: rotate(-360deg); - } -} - -@keyframes spin { - 100% { - -webkit-transform: rotate(-360deg); - transform: rotate(-360deg); - } -} - - -/* EDITOR */ - -#editor .frontmatter { - -webkit-column-count: 2; - -moz-column-count: 2; - column-count: 2; - -webkit-column-gap: 1em; - -moz-column-gap: 1em; - column-gap: 1em; - margin-bottom: 1em; -} - -#editor .group, -#editor #editor-source { - box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); - display: block; - border-radius: .2em; - padding: .5em; - margin-bottom: 1em; - -webkit-column-break-inside: avoid; - page-break-inside: avoid; - break-inside: avoid; - background-color: #fff; - display: inline-block; - width: 100%; - break-inside: avoid-column; -} - -#editor .block { - border-bottom: 1px solid #eee; - margin-bottom: .5em; - padding-bottom: .5em; -} - -#editor .block:last-child { - border: 0; - margin: 0; - padding: 0; -} - -#editor .block label { - display: block; - color: #212121; - font-weight: 500; -} - -#editor h3 { - margin: 0 0 .5em; - display: inline-block; - vertical-align: middle; - width: calc(100% - 2.5em); -} - -#editor .block input, -#editor .block .actions { - display: inline-block; -} - -#editor .block input, -#editor .block textarea, -#editor fieldset input, -#editor fieldset textarea { - border: 0; - background-color: transparent; - overflow: hidden; - color: #9E9E9E; - resize: none; - width: calc(100% - 1.5em); -} - -#editor .action { - border: 0; - background-color: transparent; - font-size: .8em; - margin: 0; -} - -#editor .delete, -#editor .add { - color: #ddd; -} - -#editor i { - padding: 0; -} - -#editor .add:hover i { - color: #8BC34A; -} - -#editor .delete:hover i { - color: #E53935; -} - -#editor .add:hover i, -#editor .delete:hover i { - background-color: transparent; -} - -#editor fieldset> .action { - opacity: 0; -} - -#editor fieldset:hover> .action { - opacity: 1; -} - -#editor textarea[name="content"] { - display: none; -} - -#editor fieldset fieldset { - margin-left: 1em; -} - -#editor button span { - vertical-align: middle; - transition: 0.2s ease-in-out all; -} - -#editor button span i { - vertical-align: sub; - font-size: 1.3rem; - margin-right: .2em; -} - -#editor #publish { - background-color: #167169; -} - -#editor .group.temp { - background-color: #f5f5f5; -} - -#editor .group.temp label { - font-weight: lighter; - font-size: .8em; - margin-bottom: 1em; - color: #7d7d7d; -} - -#editor .group.temp input { - color: #212121; -} - -#editor .right { - display: inline-block; - text-align: right; - float: right; -} - -@media screen and (max-width: 1024px) { - header #prev { - display: none; - } - header #open-nav { - display: inline-block; - } - /* SIDEBAR */ - header> div:nth-child(2) { - position: fixed; - top: 0; - z-index: 999999; - background-color: #fff; - height: 100%; - width: 95%; - max-width: 20em; - text-align: left; - color: #212121; - left: -100%; - transition: .2s ease-in-out all; - } - header> div:nth-child(2).active { - left: 0; - } - header #search { - height: auto; - background-color: transparent; - color: #212121; - padding: 0; - border-bottom: 1px solid #eee; - border-radius: 0; - display: block; - } - header #search input { - color: #212121; - display: inline-block; - width: auto; - min-width: 0; - } - header #search i { - color: #212121; - display: inline-block; - padding: .5em; - margin: 0; - } - header> div:nth-child(2)> div { - display: block; - } - header> div:nth-child(2) .action { - border-radius: 0 !important; - padding: 0 !important; - margin: 0 !important; - text-align: left; - background-color: transparent !important; - } - header> div:nth-child(2) .action:hover { - background-color: rgba(0, 0, 0, .1); - } - header> div:nth-child(2) .action:hover i { - background-color: transparent; - } - header> div:nth-child(2) .action i { - border-radius: 0; - } - header> div:nth-child(2) .action span {} - header> div:nth-child(2) .action i, - header> div:nth-child(2) .action span { - vertical-align: middle; - display: inline-block; - } -} diff --git a/assets/templates/buttons.tmpl b/assets/templates/buttons.tmpl deleted file mode 100644 index 5f9dce57..00000000 --- a/assets/templates/buttons.tmpl +++ /dev/null @@ -1,23 +0,0 @@ -{{ define "buttons" }} -{{ if .IsDir}} - - - -
- view_headline Switch view -
-
- file_upload Upload -
- {{ else }} - {{ template "actions" . }} -{{ end }} - -
- exit_to_app Logout -
-{{ end }} diff --git a/filemanager.go b/filemanager.go index 29c10f16..5f62ecea 100644 --- a/filemanager.go +++ b/filemanager.go @@ -1,6 +1,6 @@ //go:generate go get github.com/jteeuwen/go-bindata //go:generate go install github.com/jteeuwen/go-bindata/go-bindata -//go:generate go-bindata -debug -pkg assets -prefix "assets" -o assets/binary.go assets/... +//go:generate go-bindata -debug -pkg assets -ignore .jsbeautifyrc -prefix "assets/embed" -o assets/binary.go assets/embed/... // Package filemanager provides middleware for managing files in a directory // when directory path is requested instead of a specific file. Based on browse diff --git a/page/page.go b/page/page.go index da6ddcf1..4037af88 100644 --- a/page/page.go +++ b/page/page.go @@ -82,7 +82,7 @@ func (p Page) PrintAsHTML(w http.ResponseWriter, templates ...string) (int, erro if p.Minimal { templates = append(templates, "actions", "minimal") } else { - templates = append(templates, "buttons", "actions", "base") + templates = append(templates, "actions", "base") } var tpl *template.Template