diff --git a/LICENSE.md b/LICENSE.md index bab9d95b..35363c3f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2012 Lars Jung, http://larsjung.de +Copyright (c) 2013 Lars Jung, http://larsjung.de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 1660cc29..2faf2a74 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ create [a new issue](http://github.com/lrsjng/h5ai/issues/new) on GitHub! ## Install -(**note:** please don't use files from the `src` folder for installation, -they need to be preprocessed to work correctly) +( **note:** please don't use files from the `src` folder for installation, +they need to be preprocessed to work correctly ) You'll find a preprocessed package, as well as detailed installation instructions on the [project page](http://larsjung.de/h5ai/). @@ -16,7 +16,7 @@ instructions on the [project page](http://larsjung.de/h5ai/). ## Build -(there are repositories of the latest [releases](http://release.larsjung.de/h5ai/) and [dev builds](http://release.larsjung.de/h5ai/dev/)) +( there are repositories for the latest [releases](http://release.larsjung.de/h5ai/) and [dev builds](http://release.larsjung.de/h5ai/dev/) ) If you want to build **h5ai** yourself you need to install the build tool [fQuery](http://larsjung.de/fquery/) first: @@ -39,6 +39,7 @@ You'll find a new directory `build` including a fresh zipball. It profits from these great projects: [Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL), +[Gnome Symbolic Icon Theme](https://git.gnome.org/browse/gnome-icon-theme-symbolic/) (CC BY-SA 3.0), [HTML5 ★ Boilerplate](http://html5boilerplate.com) (MIT), [jQuery](http://jquery.com) (MIT), [jQuery.filedrop](http://www.github.com/weixiyen/jquery-filedrop) (MIT), @@ -50,13 +51,38 @@ It profits from these great projects: [Modernizr](http://www.modernizr.com) (MIT/BSD), [modulejs](http://larsjung.de/modulejs/) (MIT), [Moment.js](http://momentjs.com) (MIT), -[spin.js](http://fgnass.github.com/spin.js/) (MIT), [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL), [Underscore.js](http://underscorejs.org) (MIT) ## Changelog -(**h5ai** uses [semantic versioning](http://semver.org/)) +( **h5ai** uses [semantic versioning](http://semver.org/) ) + + +### v0.23.0 - *2013-07-21* + +* removes `aai` mode! +* drops support for IE7+8 (simple fallback, same as no javascript) +* uses History API if available (way faster browsing) +* faster thumbnail generation if EXIF thumbnails available +* adds optional custom headers/footers that are propageted to all subfolders +* optional hide parent folder links +* some fixes on previews +* speeds up packaged downloads +* add line wrap and line highlighting (on hover) to text preview +* new design (colors, images) +* now uses scalable images for the interface +* fixes filter (ignore parent folder, display of `no match`) +* lots of small fixes +* updates H5BP to 4.2.0 +* updates jQuery to 2.0.3 +* updates jQuery.mousewheel to 3.1.3 +* updates Moment.js to 2.1.0 +* updates markdown-js to 0.4.0-9c21acdf08 +* updates json2.js to 2013-05-26 +* adds `uk` translation by Viktor Matveenko +* updates to `pl` translation by Mark + ### v0.22.1 - *2012-10-16* diff --git a/package.json b/package.json index 85301372..5bdc18ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "h5ai", - "version": "0.22.1", + "version": "0.23.0", "description": "a modern HTTP web server index", "url": "http://larsjung.de/h5ai/", "author": "Lars Jung", diff --git a/src/_h5ai/.htaccess b/src/_h5ai/.htaccess index 9540a5a2..d9ff56e5 100644 --- a/src/_h5ai/.htaccess +++ b/src/_h5ai/.htaccess @@ -1,45 +1,115 @@ -Options -Indexes - DirectoryIndex index.html - - Header set Cache-Control "public" - ExpiresActive on - # Perhaps better to whitelist expires rules? Perhaps. - ExpiresDefault "access plus 1 month" - # cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5) - ExpiresByType text/cache-manifest "access plus 0 seconds" - # your document html - ExpiresByType text/html "access plus 0 seconds" +# ------------------------------------------------------------------------------ +# | File access | +# ------------------------------------------------------------------------------ - # data - ExpiresByType text/xml "access plus 0 seconds" - ExpiresByType application/xml "access plus 0 seconds" - ExpiresByType application/json "access plus 0 seconds" +# Block access to directories without a default document. +# Usually you should leave this uncommented because you shouldn't allow anyone +# to surf through every directory on your server (which may includes rather +# private places like the CMS's directories). + + + Options -Indexes + + + + + +# ------------------------------------------------------------------------------ +# | Better website experience | +# ------------------------------------------------------------------------------ + +# Force IE to render pages in the highest available mode in the various +# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf. +# Use, if installed, Google Chrome Frame. + + + Header set X-UA-Compatible "IE=edge,chrome=1" + # `mod_headers` can't match based on the content-type, however, we only + # want to send this header for HTML pages and not for the other resources + + Header unset X-UA-Compatible + + + + + + +# ------------------------------------------------------------------------------ +# | UTF-8 encoding | +# ------------------------------------------------------------------------------ + +# Use UTF-8 encoding for anything served as `text/html` or `text/plain`. +AddDefaultCharset utf-8 + +# Force UTF-8 for certain file formats. + + AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml + + + + + +# ------------------------------------------------------------------------------ +# | Expires headers (for better cache control) | +# ------------------------------------------------------------------------------ + +# The following expires headers are set pretty far in the future. If you don't +# control versioning with filename-based cache busting, consider lowering the +# cache time for resources like CSS and JS to something like 1 week. + + + + ExpiresActive on + ExpiresDefault "access plus 1 month" + + # CSS + ExpiresByType text/css "access plus 1 week" + + # Data interchange + ExpiresByType application/json "access plus 0 seconds" + ExpiresByType application/xml "access plus 0 seconds" + ExpiresByType text/xml "access plus 0 seconds" + + # Favicon (cannot be renamed!) + ExpiresByType image/x-icon "access plus 1 week" + + # HTML components (HTCs) + ExpiresByType text/x-component "access plus 1 month" + + # HTML + ExpiresByType text/html "access plus 0 seconds" + + # JavaScript + ExpiresByType application/javascript "access plus 1 week" + + # Manifest files + ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" + ExpiresByType text/cache-manifest "access plus 0 seconds" + + # Media + ExpiresByType audio/ogg "access plus 1 month" + ExpiresByType image/gif "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType video/mp4 "access plus 1 month" + ExpiresByType video/ogg "access plus 1 month" + ExpiresByType video/webm "access plus 1 month" + + # Web feeds + ExpiresByType application/atom+xml "access plus 1 hour" + ExpiresByType application/rss+xml "access plus 1 hour" + + # Web fonts + ExpiresByType application/font-woff "access plus 1 month" + ExpiresByType application/vnd.ms-fontobject "access plus 1 month" + ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/opentype "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" - # media: images, video, audio - ExpiresByType image/gif "access plus 1 month" - ExpiresByType image/png "access plus 1 month" - ExpiresByType image/jpg "access plus 1 month" - ExpiresByType image/jpeg "access plus 1 month" - ExpiresByType video/ogg "access plus 1 month" - ExpiresByType audio/ogg "access plus 1 month" - ExpiresByType video/mp4 "access plus 1 month" - ExpiresByType video/webm "access plus 1 month" - - # webfonts - ExpiresByType font/truetype "access plus 1 month" - ExpiresByType font/opentype "access plus 1 month" - ExpiresByType font/woff "access plus 1 month" - ExpiresByType image/svg+xml "access plus 1 month" - ExpiresByType application/vnd.ms-fontobject "access plus 1 month" - - # css and javascript - ExpiresByType text/css "access plus 1 month" - ExpiresByType application/javascript "access plus 1 month" - ExpiresByType text/javascript "access plus 1 month" diff --git a/src/_h5ai/client/css/inc/bottombar.less b/src/_h5ai/client/css/inc/bottombar.less index 74c3ef69..646a5e33 100644 --- a/src/_h5ai/client/css/inc/bottombar.less +++ b/src/_h5ai/client/css/inc/bottombar.less @@ -7,8 +7,10 @@ left: 0; bottom: 0; padding: 6px 0 8px 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border-top: 1px solid rgb(210,210,210); + // .vert-gradient(rgb(241,241,241), rgb(228,228,228)); + background-color: @col-widget-back; + border-top: @border-widget; + // .box-shadow(0 -2px 4px 0 rgba(0, 0, 0, 0.15); color: #999; text-align: center; @@ -20,7 +22,7 @@ opacity: 0.7; &:hover { - color: #e80; + color: @col-hover; opacity: 1; } } @@ -40,18 +42,19 @@ padding: 0 8px; } .noJsMsg { - color: #c33; + color: @col-error; margin-left: 16px; } - .oldBrowser { + .noBrowserMsg { display: none; - color: #c33; + color: @col-error; margin-left: 16px; a, a:active, a:visited { - color: #c33; + color: @col-error; text-decoration: underline; + opacity: 1; &:hover { - color: #e80; + color: @col-hover; } } } diff --git a/src/_h5ai/client/css/inc/content.less b/src/_h5ai/client/css/inc/content.less index 6511f851..1059d0f0 100644 --- a/src/_h5ai/client/css/inc/content.less +++ b/src/_h5ai/client/css/inc/content.less @@ -9,7 +9,7 @@ color: #333; a, a:active, a:visited { - color: #2080FF; + color: @col-link; text-decoration: none; cursor: pointer; diff --git a/src/_h5ai/client/css/inc/context-menu.less b/src/_h5ai/client/css/inc/context-menu.less index 6014e527..3135941b 100644 --- a/src/_h5ai/client/css/inc/context-menu.less +++ b/src/_h5ai/client/css/inc/context-menu.less @@ -1,12 +1,12 @@ -#extended .context-menu { +#view .context-menu { display: block; position: absolute; right: 0; top: 0; - background-color: rgb(241,241,241); - border: 1px solid rgb(210,210,210); + background-color: @col-widget-back; + border: @border-widget; color: #999; z-index: 10; font-size: 0.9em; @@ -20,12 +20,12 @@ li { padding: 8px 12px 10px 12px; white-space: nowrap; - border-top: 1px solid rgb(231,231,231); + border-top: @border-widget-sep; .transition(all 0.2s ease-in-out); &:hover { - color: #e80; - background-color: rgba(255,255,255,0.8); + color: @col-hover; + background-color: @col-widget-back-hover; } } } diff --git a/src/_h5ai/client/css/inc/delete.less b/src/_h5ai/client/css/inc/delete.less index 6008c9d4..1942ce80 100644 --- a/src/_h5ai/client/css/inc/delete.less +++ b/src/_h5ai/client/css/inc/delete.less @@ -8,23 +8,3 @@ background-color: rgba(255,0,0,0.5); } } - -#delete-auth { - display: none; - position: fixed; - z-index: 5; - left: 0; - top: 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border: 1px solid rgb(210,210,210); - - input { - display: block; - margin: 4px 6px; - border: 1px solid rgb(210,210,210); - font-family: Ubuntu, sans-serif; - color: #555; - background-color: rgba(255,255,255,1); - width: 100px; - } -} diff --git a/src/_h5ai/client/css/inc/download.less b/src/_h5ai/client/css/inc/download.less index d56119ec..502b70bf 100644 --- a/src/_h5ai/client/css/inc/download.less +++ b/src/_h5ai/client/css/inc/download.less @@ -8,23 +8,3 @@ background-color: rgba(255,0,0,0.5); } } - -#download-auth { - display: none; - position: fixed; - z-index: 5; - left: 0; - top: 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border: 1px solid rgb(210,210,210); - - input { - display: block; - margin: 4px 6px; - border: 1px solid rgb(210,210,210); - font-family: Ubuntu, sans-serif; - color: #555; - background-color: rgba(255,255,255,1); - width: 100px; - } -} diff --git a/src/_h5ai/client/css/inc/extended-list.less b/src/_h5ai/client/css/inc/extended-list.less deleted file mode 100644 index f32e3e86..00000000 --- a/src/_h5ai/client/css/inc/extended-list.less +++ /dev/null @@ -1,39 +0,0 @@ - -#extended.view-list { - - li { - - &.entry { - - a, a:active, a:visited { - height: 56px; - border-bottom: 1px solid #e8e8e8; - } - } - - .icon, .label, .date, .size { - padding: 6px; - } - - .icon.big { - display: inline-block; - position: absolute; - left: 0; - top: -2px; - width: 100px; - } - - .label { - margin: 0 270px 0 106px; - } - - .date { - margin: 0 0 0 106px; - } - - .date, .size { - position: relative; - top: -6px; - } - } -} diff --git a/src/_h5ai/client/css/inc/fallback-table.less b/src/_h5ai/client/css/inc/fallback.less similarity index 84% rename from src/_h5ai/client/css/inc/fallback-table.less rename to src/_h5ai/client/css/inc/fallback.less index c2180336..9c0c50e0 100644 --- a/src/_h5ai/client/css/inc/fallback-table.less +++ b/src/_h5ai/client/css/inc/fallback.less @@ -1,7 +1,8 @@ -#data-apache-autoindex, #data-php-no-js-fallback { +#fallback { + display: none; max-width: 960px; - margin: 0 auto 80px auto; + margin: 80px auto; table { display: block; @@ -36,9 +37,7 @@ } } td { - border: 1px solid #ddd; - border-left: none; - border-right: none; + border-bottom: 1px solid @col-border; overflow: hidden; white-space: nowrap; font-size: 16px; @@ -50,7 +49,7 @@ cursor: pointer; &:hover { - color: #e80; + color: @col-hover; } } } @@ -63,8 +62,6 @@ img { width: 16px; height: 16px; - position: relative; - top: -2px; } } td:nth-child(2), th:nth-child(2) { @@ -83,3 +80,11 @@ } } } + + +html.no-js, html.no-browser { + + #fallback { + display: block; + } +} diff --git a/src/_h5ai/client/css/inc/filter.less b/src/_h5ai/client/css/inc/filter.less index 8ae0ae6d..9040dc23 100644 --- a/src/_h5ai/client/css/inc/filter.less +++ b/src/_h5ai/client/css/inc/filter.less @@ -3,17 +3,16 @@ .topbar-right; input { - display: none; border: none; - font-family: Ubuntu, sans-serif; - color: #555; + font-family: @font-family; + color: @col; background-color: rgba(0,0,0,0); - width: 100px; + width: 30px; } &.current { input { - display: inline; + width: 150px; } } } diff --git a/src/_h5ai/client/css/inc/general.less b/src/_h5ai/client/css/inc/general.less index 4546397d..47307d19 100644 --- a/src/_h5ai/client/css/inc/general.less +++ b/src/_h5ai/client/css/inc/general.less @@ -1,24 +1,56 @@ +@col: rgb(85,85,85); +@col-back: rgb(255,255,255); +@col-hover: rgb(29,119,194); +@col-border: rgba(0,0,0,0.05); +@col-border-strong: rgba(0,0,0,0.15); + +@col-error: rgb(204,51,51); + +@col-link: rgb(29,119,194); +@col-link-hover: rgb(29,119,194); + +@col-widget-back: rgb(245,245,245); +@col-widget-back-highlight: rgba(255,255,255,0.8); +@col-widget-back-hover: rgba(255,255,255,0.8); +@col-widget-back-sel: rgba(255,255,255,0.8); +@col-widget-sep: @col-border; + +// @col-sb-back: rgb(210,210,210); +// @col-sb-thumb: rgb(180,180,180); +// @col-sb-thumb-active: rgb(150,150,150); +@col-sb-back: rgba(0,0,0,0.08); +@col-sb-thumb: rgba(0,0,0,0.15); +@col-sb-thumb-active: rgba(0,0,0,0.25); + + +@border-widget: 1px solid @col-border; +@border-widget-sep: 1px solid @col-widget-sep; + + + + + +@font-family: Ubuntu, sans-serif; +@font-family-mono: "Ubuntu Mono", monospace; + + html { overflow-y: auto; } ::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } ::selection { background: #68A9FF; color: #fff; text-shadow: none; } body { - font-family: Ubuntu, sans-serif; + font-family: @font-family; + // font-weight: 400; font-size: 13px; - color: #555; - background-color: #fff; + color: @col; + background-color: @col-back; margin: 30px; } html.js .hideOnJs, html.no-js .hideOnNoJs { display: none; } -html.oldie { - .oldBrowser { - display: inline !important; - } - #tree { - display: none !important; - } +html.no-browser .noBrowserMsg { + display: inline !important; } diff --git a/src/_h5ai/client/css/inc/h5ai-info.less b/src/_h5ai/client/css/inc/h5ai-info.less index 1a7cb7a1..c77f1d9b 100644 --- a/src/_h5ai/client/css/inc/h5ai-info.less +++ b/src/_h5ai/client/css/inc/h5ai-info.less @@ -1,12 +1,22 @@ body#h5ai-info { - font-family: Ubuntu, Arial, sans; + font-family: @font-family; margin: 2em auto 4em auto; font-size: 20px; - color: #555; + color: @col; max-width: 600px; text-align: center; + a, a:active, a:visited { + color: @col; + text-decoration: none; + .transition(all 0.2s ease-in-out); + + &:hover { + color: @col-hover; + } + } + .build-version { display: block; } @@ -16,6 +26,22 @@ body#h5ai-info { font-size: 0.6em; color: #aaa; } + .idx-file { + margin-top: 1em; + font-size: 0.6em; + display: block; + color: #aaa; + + .value { + margin-left: 0.5em; + padding: 2px 4px; + .border-radius(4px); + font-family: @font-family-mono; + letter-spacing: 0.1em; + background-color: @col-widget-back; + border: @border-widget; + } + } h1 { font-size: 3.6em; margin: 0; diff --git a/src/_h5ai/client/css/inc/l10n.less b/src/_h5ai/client/css/inc/l10n.less index 4ece6ed8..04c0c037 100644 --- a/src/_h5ai/client/css/inc/l10n.less +++ b/src/_h5ai/client/css/inc/l10n.less @@ -11,20 +11,20 @@ right: 0; top: 0; max-height: 200px; - background-color: rgb(241,241,241); - border: 1px solid rgb(210,210,210); + background-color: @col-widget-back; + border: @border-widget; .sp-scrollbar { margin: 0; width: 6px; - background-color: rgb(210,210,210); + background-color: @col-sb-back; cursor: pointer; .sp-thumb { - background-color: rgb(180,180,180); + background-color: @col-sb-thumb; } &.active .sp-thumb { - background-color: rgb(150,150,150); + background-color: @col-sb-thumb-active; } } @@ -38,16 +38,16 @@ li { padding: 8px 24px 10px 24px; white-space: nowrap; - border-top: 1px solid rgb(231,231,231); + border-top: @border-widget-sep; .transition(all 0.2s ease-in-out); &.current { color: #333; - background-color: rgba(255,255,255,0.8); + background-color: @col-widget-back-sel; } &:hover { - color: #e80; - background-color: rgba(255,255,255,0.8); + color: @col-hover; + background-color: @col-widget-back-hover; } } } diff --git a/src/_h5ai/client/css/inc/notify.less b/src/_h5ai/client/css/inc/notify.less new file mode 100644 index 00000000..4ac6545e --- /dev/null +++ b/src/_h5ai/client/css/inc/notify.less @@ -0,0 +1,14 @@ + +#notify { + position: fixed; + left: 50%; + top: 3px; + width: 200px; + margin-left: -100px; + z-index: 100; + padding: 2px 6px 2px 6px; + color: #fff; + background-color: rgba(0, 0, 0, 0.2); + .border-radius(4px); + text-align: center; +} diff --git a/src/_h5ai/client/css/inc/preview-img.less b/src/_h5ai/client/css/inc/preview-img.less index f11e9708..a4542c22 100644 --- a/src/_h5ai/client/css/inc/preview-img.less +++ b/src/_h5ai/client/css/inc/preview-img.less @@ -14,13 +14,10 @@ text-align: center; } -#pv-img-content { +#pv-img-content, #pv-spinner { position: fixed; - } -// @check-white: rgba(255,255,255,0.5); -// @check-black: rgba(0,0,0,0.2); @check-white: #f8f8f8; @check-black: #e8e8e8; #pv-img-image { @@ -99,7 +96,7 @@ opacity: 1.0; } - @bar-sep-border: 1px solid rgba(255,255,255,0.05); + @bar-sep-border: 1px solid rgba(255,255,255,0.08); .bar-button { .bar-label; @@ -120,22 +117,14 @@ } } -// #pv-img-topbar { -// position: fixed; -// z-index: 5; -// width: 100%; -// left: 0; -// top: 0; -// .vert-gradient(rgb(37,37,37), rgb(24,24,24)); -// border-bottom: 1px solid rgb(27,27,27); -// } - #pv-img-bottombar { position: fixed; z-index: 5; width: 100%; + height: 32px; left: 0; bottom: 0; - .vert-gradient(rgb(27,27,27), rgb(14,14,14)); + // .vert-gradient(rgb(27,27,27), rgb(14,14,14)); + background-color: rgb(27,27,27); border-top: 1px solid rgb(45,45,45); } diff --git a/src/_h5ai/client/css/inc/preview-txt.less b/src/_h5ai/client/css/inc/preview-txt.less index 413327a3..bbbb893a 100644 --- a/src/_h5ai/client/css/inc/preview-txt.less +++ b/src/_h5ai/client/css/inc/preview-txt.less @@ -25,20 +25,102 @@ position: relative; } +#pv-txt-spinner { + position: fixed; +} + #pv-txt-text { - word-break: break-all; - .syntaxhighlighter { - overflow: visible !important; + &.highlighted { + word-break: break-all; - .gutter .line { - border-right: none !important; + tr:hover { + background-color: rgba(0,0,0,0.05); + + .nr { + color: #333; + } + } + + td { + vertical-align: top; + font-family: @font-family-mono; + font-size: 16px; + line-height: 1.2em; + color: #999; + word-break: normal; + + &.nr { + text-align: right; + padding: 0 8px 0 4px; + } + + &.line { + width: 100%; + padding: 0 4px 0 8px; + } + + code { + font-family: @font-family-mono; + font-size: 16px; + line-height: 1.2em; + } + } + + .plain { + color: #000; + } + .comments { + color: #008200; + } + .string { + color: #1111ff; + } + .keyword { + color: #006699; + font-weight: bold; + } + .preprocessor { + color: #999; + } + .variable { + color: #aa7700; + } + .value { + color: #009900; + } + .functions { + color: #ff1493; + } + .constants { + color: #0066cc; + } + .script { + color: #006699; + font-weight: bold; + } + .color1 { + color: #999; + } + .color2 { + color: #ff1493; + } + .color3 { + color: #ff1111; + } + + a, a:active, a:visited { + color: #2080FF; + text-decoration: none; + cursor: pointer; + + &:hover { + color: #68A9FF; + } } - // .code .line, table td.code .container textarea { - // white-space: normal !important; - // } } + &.markdown { font-size: 16px; padding: 8px 24px; @@ -54,7 +136,7 @@ } pre, code { - font-family: "Ubuntu Mono", monospace; + font-family: @font-family-mono; } code { color: #008200; @@ -138,20 +220,11 @@ } } -// #pv-txt-topbar { -// position: fixed; -// z-index: 5; -// width: 100%; -// left: 0; -// top: 0; -// .vert-gradient(rgb(37,37,37), rgb(24,24,24)); -// border-bottom: 1px solid rgb(27,27,27); -// } - #pv-txt-bottombar { position: fixed; z-index: 5; width: 100%; + height: 32px; left: 0; bottom: 0; .vert-gradient(rgb(27,27,27), rgb(14,14,14)); diff --git a/src/_h5ai/client/css/inc/qrcode.less b/src/_h5ai/client/css/inc/qrcode.less index 8fa52c13..f12c94b4 100644 --- a/src/_h5ai/client/css/inc/qrcode.less +++ b/src/_h5ai/client/css/inc/qrcode.less @@ -6,8 +6,8 @@ bottom: 50px; z-index: 1; - background-color: #fff; - border: 2px solid #ddd; + background-color: @col-widget-back; + border: @border-widget; padding: 8px; canvas { diff --git a/src/_h5ai/client/css/inc/responsive.less b/src/_h5ai/client/css/inc/responsive.less index ec1f8837..2002a07a 100644 --- a/src/_h5ai/client/css/inc/responsive.less +++ b/src/_h5ai/client/css/inc/responsive.less @@ -1,8 +1,5 @@ -@media only screen and (max-width: 500px) { -body { - margin: 8px; -} +@media only screen and (max-width: 700px) { #topbar { .crumb { display: none; @@ -14,24 +11,29 @@ body { display: none; } } -#extended.view-details { - .header .label, .entry .label { +#view.view-details, #view.view-list { + .header .label, .item .label { margin-right: 110px; } - .header .date, .entry .date { + .header .date, .item .date { display: none; } } -#extended.view-icons { +#view.view-icons { padding: 0; border: none; - margin: 0 -14px; } #bottombar { .center { display: none; } } +} + +@media only screen and (max-width: 500px) { +body { + margin: 8px; +} #tree { display: none !important; } diff --git a/src/_h5ai/client/css/inc/topbar.less b/src/_h5ai/client/css/inc/topbar.less index 048f0959..04b52559 100644 --- a/src/_h5ai/client/css/inc/topbar.less +++ b/src/_h5ai/client/css/inc/topbar.less @@ -6,31 +6,31 @@ min-height: 30px; left: 0; top: 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border-bottom: 1px solid rgb(210,210,210); + // .vert-gradient(rgb(241,241,241), rgb(228,228,228)); + background-color: @col-widget-back; + border-bottom: @border-widget; + // .box-shadow(0 2px 4px 0 rgba(0, 0, 0, 0.15); } .topbar-highlight { - background-color: rgba(255,255,255,0.5); + background-color: @col-widget-back-highlight; opacity: 1.0; } .topbar-hover { .topbar-highlight; - color: #e80; + color: @col-hover; } -@topbar-sep-border: 1px solid rgba(0,0,0,0.05); - .topbar-left { float: left; - border-right: @topbar-sep-border; + border-right: @border-widget-sep; } .topbar-right { float: right; - border-left: @topbar-sep-border; + border-left: @border-widget-sep; } @@ -41,7 +41,7 @@ padding: 0; a, a:active, a:visited, span.element { - color: #555; + color: @col; cursor: pointer; text-decoration: none; opacity: 0.7; @@ -78,9 +78,9 @@ color: #999; } img.hint { - width: 14px; - height: 14px; opacity: 0.8; + width: 12px; + height: 12px; } } .view { diff --git a/src/_h5ai/client/css/inc/tree.less b/src/_h5ai/client/css/inc/tree.less index 75d0a7d8..2f258b6f 100644 --- a/src/_h5ai/client/css/inc/tree.less +++ b/src/_h5ai/client/css/inc/tree.less @@ -8,22 +8,22 @@ z-index: 3; overflow: auto; padding: 8px; - background-color: rgb(241,241,241); - border-right: 2px solid rgb(221,221,221); + background-color: @col-widget-back; + border-right: @border-widget; .sp-scrollbar { - margin: 8px 8px 8px 0; + // margin: 8px 8px 8px 0; width: 6px; - background-color: rgb(210,210,210); - .border-radius(3px); + background-color: @col-sb-back; + // .border-radius(3px); cursor: pointer; .sp-thumb { - background-color: rgb(180,180,180); - .border-radius(3px); + background-color: @col-sb-thumb; + // .border-radius(3px); } &.active .sp-thumb { - background-color: rgb(150,150,150); + background-color: @col-sb-thumb-active; } } @@ -63,13 +63,14 @@ padding: 4px 6px; color: #555; border: 1px solid rgba(0,0,0,0); - .border-radius(5px); + .border-radius(3px); text-decoration: none; opacity: 0.7; &:hover, &.hover { - color: #e80; - background-color: rgba(255,255,255,0.5); + color: @col-hover; + background-color: @col-widget-back-hover; + // border-color: rgba(0,0,0,0.05); opacity: 1; } } @@ -100,8 +101,8 @@ } .current { > a, > a:active, > a:visited { - background-color: rgba(255,255,255,0.5); - border-color: rgb(221,221,221); + background-color: @col-widget-back-sel; + border-color: @col-widget-sep; opacity: 1; } } @@ -109,7 +110,7 @@ > a, > a:active, > a:visited { color: #999; &:hover, &.hover { - color: #e80; + color: @col-hover; } } .hint { diff --git a/src/_h5ai/client/css/inc/extended-details.less b/src/_h5ai/client/css/inc/view-details.less similarity index 60% rename from src/_h5ai/client/css/inc/extended-details.less rename to src/_h5ai/client/css/inc/view-details.less index 7c30e340..5d1cdeff 100644 --- a/src/_h5ai/client/css/inc/extended-details.less +++ b/src/_h5ai/client/css/inc/view-details.less @@ -1,5 +1,5 @@ -#extended.view-details { +#view.view-details { li { @@ -7,15 +7,27 @@ display: list-item; } - &.entry { + &.item { a, a:active, a:visited { - border-bottom: 1px solid #e8e8e8; + border-top: 1px solid @item-border-col-sep; + border-bottom: 1px solid @item-border-col-sep; + + &:hover, &.hover { + border-color: @item-border-col-hover; + } } // needs to be here, to not conflict with header fields .icon, .label, .date, .size { - padding: 6px; + padding: 8px 6px; + } + } + + &.item + .item { + + a, a:active, a:visited { + border-top: none; } } diff --git a/src/_h5ai/client/css/inc/extended-grid.less b/src/_h5ai/client/css/inc/view-grid.less similarity index 59% rename from src/_h5ai/client/css/inc/extended-grid.less rename to src/_h5ai/client/css/inc/view-grid.less index 1d69c83c..3576b298 100644 --- a/src/_h5ai/client/css/inc/extended-grid.less +++ b/src/_h5ai/client/css/inc/view-grid.less @@ -1,9 +1,9 @@ -#extended.view-grid { +#view.view-grid { li { - &.entry { + &.item { float: left; a, a:active, a:visited { @@ -12,27 +12,26 @@ padding: 8px; width: 164px; height: 24px; - border: 2px solid rgba(0,0,0,0); - .border-radius(5px); + border: 1px solid rgba(0,0,0,0); &:hover, &.hover { - border-color: #e8e8e8; + border-color: @item-border-col-hover; } } } .icon.small { display: inline-block; - position: relative; - left: 0; - top: -2px; + position: absolute; + left: 11px; + top: 9px; width: 16px; } .label { - display: inline-block; - padding-left: 6px; + display: block; max-width: 140px; + margin: 0 0 0 24px; } .date, .size { diff --git a/src/_h5ai/client/css/inc/extended-icons.less b/src/_h5ai/client/css/inc/view-icons.less similarity index 79% rename from src/_h5ai/client/css/inc/extended-icons.less rename to src/_h5ai/client/css/inc/view-icons.less index 006bef97..77415cc1 100644 --- a/src/_h5ai/client/css/inc/extended-icons.less +++ b/src/_h5ai/client/css/inc/view-icons.less @@ -1,10 +1,10 @@ -#extended.view-icons { +#view.view-icons { li { text-align: center; - &.entry { + &.item { float: left; a, a:active, a:visited { @@ -13,11 +13,10 @@ padding: 8px; width: 100px; height: 120px; - border: 2px solid rgba(0,0,0,0); - .border-radius(5px); + border: 1px solid rgba(0,0,0,0); &:hover, &.hover { - border-color: #e8e8e8; + border-color: @item-border-col-hover; } } } diff --git a/src/_h5ai/client/css/inc/view-list.less b/src/_h5ai/client/css/inc/view-list.less new file mode 100644 index 00000000..42b77c6a --- /dev/null +++ b/src/_h5ai/client/css/inc/view-list.less @@ -0,0 +1,62 @@ + +#view.view-list { + + li { + + &.header { + display: list-item; + } + + &.item { + + a, a:active, a:visited { + border-top: 1px solid @item-border-col-sep; + border-bottom: 1px solid @item-border-col-sep; + height: 60px; + + &:hover, &.hover { + border-color: @item-border-col-hover; + } + } + + // needs to be here, to not conflict with header fields + .icon { + padding: 8px 6px; + } + .label, .date, .size { + padding: 18px 6px; + } + } + + &.item + .item { + + a, a:active, a:visited { + border-top: none; + } + } + + .icon.big { + display: inline-block; + position: absolute; + left: 0; + top: -2px; + width: 100px; + } + + .label { + margin: 0 270px 0 110px; + } + + .date { + position: absolute; + right: 100px; + top: 0; + } + + .size { + position: absolute; + right: 0; + top: 0; + } + } +} diff --git a/src/_h5ai/client/css/inc/extended.less b/src/_h5ai/client/css/inc/view.less similarity index 72% rename from src/_h5ai/client/css/inc/extended.less rename to src/_h5ai/client/css/inc/view.less index 8ec706e2..f75c44c7 100644 --- a/src/_h5ai/client/css/inc/extended.less +++ b/src/_h5ai/client/css/inc/view.less @@ -5,12 +5,23 @@ left: 0; top: 0; z-index: 2; - border: 1px dashed rgba(240,100,0,0.5); - background-color: rgba(240,100,0,0.2); + border: 1px dashed @col-border-strong; + background-color: rgba(0,0,0,0.01); } -#extended { +@item-border-col-sep: @col-border; + +@item-background-col-hover: rgba(0,0,0,0.02); +@item-border-col-hover: @col-border; + +@item-background-col-sel: rgba(0,0,0,0.02); +@item-border-col-sel: @col-border-strong; + + + +#view { display: none; + margin: 0 auto; a, a:active, a:visited { color: #333; @@ -58,28 +69,31 @@ } } - &.entry { + &.item { a, a:active, a:visited { display: block; overflow: hidden; &:hover, &.hover { - color: #e80; - background-color: #f6f6f6; - border-color: #e8e8e8; + // color: #e80; + color: @col-hover; + background-color: @item-background-col-hover; + border-color: @item-border-col-hover; } } &.selected:not(.selecting), &.selecting:not(.selected) { a, a:active, a:visited { - border-color: rgba(240,100,0,0.2); - background-color: rgba(240,100,0,0.2); + // color: #000; + // color: @col-hover; + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; &:hover, &.hover { - border-color: rgba(240,100,0,0.2); - background-color: rgba(240,100,0,0.2); + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; } } } @@ -91,7 +105,8 @@ color: #aaa; &:hover, &.hover { - color: #e80; + // color: #e80; + color: @col-hover; } } diff --git a/src/_h5ai/client/css/lib/h5bp-main-footer.less b/src/_h5ai/client/css/lib/h5bp-main-footer.less index 9dc81d19..86d54ab9 100644 --- a/src/_h5ai/client/css/lib/h5bp-main-footer.less +++ b/src/_h5ai/client/css/lib/h5bp-main-footer.less @@ -1,4 +1,3 @@ - /* ========================================================================== Helper classes ========================================================================== */ @@ -19,7 +18,7 @@ content: ""; display: block; width: 0; - height: 100%; + height: 150%; } /* @@ -100,21 +99,6 @@ *zoom: 1; } -/* ========================================================================== - EXAMPLE Media Queries for Responsive Design. - Theses examples override the primary ('mobile first') styles. - Modify as content requires. - ========================================================================== */ - -@media only screen and (min-width: 35em) { - /* Style adjustments for viewports that meet the condition */ -} - -@media only screen and (-webkit-min-device-pixel-ratio: 1.5), - only screen and (min-resolution: 144dpi) { - /* Style adjustments for high resolution devices */ -} - /* ========================================================================== Print styles. Inlined to avoid required HTTP connection: h5bp.com/r @@ -124,7 +108,7 @@ * { background: transparent !important; color: #000 !important; /* Black prints faster: h5bp.com/s */ - box-shadow:none !important; + box-shadow: none !important; text-shadow: none !important; } diff --git a/src/_h5ai/client/css/lib/h5bp-main-header.less b/src/_h5ai/client/css/lib/h5bp-main-header.less index 724098df..8e4439ab 100644 --- a/src/_h5ai/client/css/lib/h5bp-main-header.less +++ b/src/_h5ai/client/css/lib/h5bp-main-header.less @@ -25,7 +25,7 @@ body { /* * Remove text-shadow in selection highlight: h5bp.com/i - * These selection declarations have to be separate. + * These selection rule sets have to be separate. * Customize the background color to match your design. */ diff --git a/src/_h5ai/client/css/lib/h5bp-normalize.less b/src/_h5ai/client/css/lib/h5bp-normalize.less index d4210aac..8d57e3c9 100644 --- a/src/_h5ai/client/css/lib/h5bp-normalize.less +++ b/src/_h5ai/client/css/lib/h5bp-normalize.less @@ -1,11 +1,11 @@ -/*! normalize.css v1.0.1 | MIT License | git.io/normalize */ +/*! normalize.css v1.1.1 | MIT License | git.io/normalize */ /* ========================================================================== HTML5 display definitions ========================================================================== */ -/* - * Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3. +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. */ article, @@ -16,14 +16,15 @@ figure, footer, header, hgroup, +main, nav, section, summary { display: block; } -/* - * Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. */ audio, @@ -34,8 +35,8 @@ video { *zoom: 1; } -/* - * Prevents modern browsers from displaying `audio` without controls. +/** + * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ @@ -44,9 +45,8 @@ audio:not([controls]) { height: 0; } -/* - * Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3, - * and Safari 4. +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. * Known issue: no IE 6 support. */ @@ -58,21 +58,27 @@ audio:not([controls]) { Base ========================================================================== */ -/* - * 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using +/** + * 1. Prevent system color scheme's background color being used in Firefox, IE, + * and Opera. + * 2. Prevent system color scheme's text color being used in Firefox, IE, and + * Opera. + * 3. Correct text resizing oddly in IE 6/7 when body `font-size` is set using * `em` units. - * 2. Prevents iOS text size adjust after orientation change, without disabling + * 4. Prevent iOS text size adjust after orientation change, without disabling * user zoom. */ html { - font-size: 100%; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -ms-text-size-adjust: 100%; /* 2 */ + background: #fff; /* 1 */ + color: #000; /* 2 */ + font-size: 100%; /* 3 */ + -webkit-text-size-adjust: 100%; /* 4 */ + -ms-text-size-adjust: 100%; /* 4 */ } -/* - * Addresses `font-family` inconsistency between `textarea` and other form +/** + * Address `font-family` inconsistency between `textarea` and other form * elements. */ @@ -84,8 +90,8 @@ textarea { font-family: sans-serif; } -/* - * Addresses margins handled incorrectly in IE 6/7. +/** + * Address margins handled incorrectly in IE 6/7. */ body { @@ -96,16 +102,16 @@ body { Links ========================================================================== */ -/* - * Addresses `outline` inconsistency between Chrome and other browsers. +/** + * Address `outline` inconsistency between Chrome and other browsers. */ a:focus { outline: thin dotted; } -/* - * Improves readability when focused and also mouse hovered in all browsers. +/** + * Improve readability when focused and also mouse hovered in all browsers. */ a:active, @@ -117,9 +123,9 @@ a:hover { Typography ========================================================================== */ -/* - * Addresses font sizes and margins set differently in IE 6/7. - * Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5, +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, * and Chrome. */ @@ -149,20 +155,20 @@ h5 { } h6 { - font-size: 0.75em; + font-size: 0.67em; margin: 2.33em 0; } -/* - * Addresses styling not present in IE 7/8/9, Safari 5, and Chrome. +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. */ abbr[title] { border-bottom: 1px dotted; } -/* - * Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. */ b, @@ -174,16 +180,27 @@ blockquote { margin: 1em 40px; } -/* - * Addresses styling not present in Safari 5 and Chrome. +/** + * Address styling not present in Safari 5 and Chrome. */ dfn { font-style: italic; } -/* - * Addresses styling not present in IE 6/7/8/9. +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. */ mark { @@ -191,8 +208,8 @@ mark { color: #000; } -/* - * Addresses margins set differently in IE 6/7. +/** + * Address margins set differently in IE 6/7. */ p, @@ -200,8 +217,8 @@ pre { margin: 1em 0; } -/* - * Corrects font family set oddly in IE 6, Safari 4/5, and Chrome. +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. */ code, @@ -213,8 +230,8 @@ samp { font-size: 1em; } -/* - * Improves readability of pre-formatted text in all browsers. +/** + * Improve readability of pre-formatted text in all browsers. */ pre { @@ -223,16 +240,16 @@ pre { word-wrap: break-word; } -/* - * Addresses CSS quotes not supported in IE 6/7. +/** + * Address CSS quotes not supported in IE 6/7. */ q { quotes: none; } -/* - * Addresses `quotes` property not supported in Safari 4. +/** + * Address `quotes` property not supported in Safari 4. */ q:before, @@ -241,16 +258,16 @@ q:after { content: none; } -/* - * Addresses inconsistent and variable font size in all browsers. +/** + * Address inconsistent and variable font size in all browsers. */ small { font-size: 80%; } -/* - * Prevents `sub` and `sup` affecting `line-height` in all browsers. +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. */ sub, @@ -273,8 +290,8 @@ sub { Lists ========================================================================== */ -/* - * Addresses margins set differently in IE 6/7. +/** + * Address margins set differently in IE 6/7. */ dl, @@ -288,8 +305,8 @@ dd { margin: 0 0 0 40px; } -/* - * Addresses paddings set differently in IE 6/7. +/** + * Address paddings set differently in IE 6/7. */ menu, @@ -298,8 +315,8 @@ ul { padding: 0 0 0 40px; } -/* - * Corrects list images handled incorrectly in IE 7. +/** + * Correct list images handled incorrectly in IE 7. */ nav ul, @@ -312,9 +329,9 @@ nav ol { Embedded content ========================================================================== */ -/* - * 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3. - * 2. Improves image quality when scaled in IE 7. +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. */ img { @@ -322,8 +339,8 @@ img { -ms-interpolation-mode: bicubic; /* 2 */ } -/* - * Corrects overflow displayed oddly in IE 9. +/** + * Correct overflow displayed oddly in IE 9. */ svg:not(:root) { @@ -334,8 +351,8 @@ svg:not(:root) { Figures ========================================================================== */ -/* - * Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11. +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. */ figure { @@ -346,15 +363,15 @@ figure { Forms ========================================================================== */ -/* - * Corrects margin displayed oddly in IE 6/7. +/** + * Correct margin displayed oddly in IE 6/7. */ form { margin: 0; } -/* +/** * Define consistent border, margin, and padding. */ @@ -364,10 +381,10 @@ fieldset { padding: 0.35em 0.625em 0.75em; } -/* - * 1. Corrects color not being inherited in IE 6/7/8/9. - * 2. Corrects text not wrapping in Firefox 3. - * 3. Corrects alignment displayed oddly in IE 6/7. +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. */ legend { @@ -377,11 +394,11 @@ legend { *margin-left: -7px; /* 3 */ } -/* - * 1. Corrects font size not being inherited in all browsers. - * 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5, +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, * and Chrome. - * 3. Improves appearance and consistency in all browsers. + * 3. Improve appearance and consistency in all browsers. */ button, @@ -394,8 +411,8 @@ textarea { *vertical-align: middle; /* 3 */ } -/* - * Addresses Firefox 3+ setting `line-height` on `input` using `!important` in +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ @@ -404,13 +421,25 @@ input { line-height: normal; } -/* +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. - * 2. Corrects inability to style clickable `input` types in iOS. - * 3. Improves usability and consistency of cursor style between image-type + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type * `input` and others. - * 4. Removes inner spacing in IE 7 without affecting normal text inputs. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. * Known issue: inner spacing remains in IE 6. */ @@ -423,19 +452,19 @@ input[type="submit"] { *overflow: visible; /* 4 */ } -/* +/** * Re-set default cursor for disabled elements. */ button[disabled], -input[disabled] { +html input[disabled] { cursor: default; } -/* - * 1. Addresses box sizing set to content-box in IE 8/9. - * 2. Removes excess padding in IE 8/9. - * 3. Removes excess padding in IE 7. +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. * Known issue: excess padding remains in IE 6. */ @@ -447,9 +476,9 @@ input[type="radio"] { *width: 13px; /* 3 */ } -/* - * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. - * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome * (include `-moz` to future-proof). */ @@ -460,8 +489,8 @@ input[type="search"] { box-sizing: content-box; } -/* - * Removes inner padding and search cancel button in Safari 5 and Chrome +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome * on OS X. */ @@ -470,8 +499,8 @@ input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } -/* - * Removes inner padding and border in Firefox 3+. +/** + * Remove inner padding and border in Firefox 3+. */ button::-moz-focus-inner, @@ -480,9 +509,9 @@ input::-moz-focus-inner { padding: 0; } -/* - * 1. Removes default vertical scrollbar in IE 6/7/8/9. - * 2. Improves readability and alignment in all browsers. +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. */ textarea { @@ -494,7 +523,7 @@ textarea { Tables ========================================================================== */ -/* +/** * Remove most spacing between table cells. */ diff --git a/src/_h5ai/client/css/lib/sh/shCore.less b/src/_h5ai/client/css/lib/sh/shCore.less deleted file mode 100644 index 41aa11aa..00000000 --- a/src/_h5ai/client/css/lib/sh/shCore.less +++ /dev/null @@ -1,228 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter a, -.syntaxhighlighter div, -.syntaxhighlighter code, -.syntaxhighlighter table, -.syntaxhighlighter table td, -.syntaxhighlighter table tr, -.syntaxhighlighter table tbody, -.syntaxhighlighter table thead, -.syntaxhighlighter table caption, -.syntaxhighlighter textarea { - -moz-border-radius: 0 0 0 0 !important; - -webkit-border-radius: 0 0 0 0 !important; - background: none !important; - border: 0 !important; - bottom: auto !important; - float: none !important; - height: auto !important; - left: auto !important; - line-height: 1.1em !important; - margin: 0 !important; - outline: 0 !important; - overflow: visible !important; - padding: 0 !important; - position: static !important; - right: auto !important; - text-align: left !important; - top: auto !important; - vertical-align: baseline !important; - width: auto !important; - box-sizing: content-box !important; - // font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-family: "Ubuntu Mono", "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - font-weight: normal !important; - font-style: normal !important; - // font-size: 1em !important; - font-size: 16px !important; - min-height: inherit !important; - min-height: auto !important; -} - -.syntaxhighlighter { - width: 100% !important; - margin: 1em 0 1em 0 !important; - position: relative !important; - overflow: auto !important; - font-size: 1em !important; -} -.syntaxhighlighter.source { - overflow: hidden !important; -} -.syntaxhighlighter .bold { - font-weight: bold !important; -} -.syntaxhighlighter .italic { - font-style: italic !important; -} -.syntaxhighlighter .line { - white-space: pre !important; -} -.syntaxhighlighter table { - width: 100% !important; -} -.syntaxhighlighter table caption { - text-align: left !important; - padding: .5em 0 0.5em 1em !important; -} -.syntaxhighlighter table td.code { - width: 100% !important; -} -.syntaxhighlighter table td.code .container { - position: relative !important; -} -.syntaxhighlighter table td.code .container textarea { - box-sizing: border-box !important; - position: absolute !important; - left: 0 !important; - top: 0 !important; - width: 100% !important; - height: 100% !important; - border: none !important; - background: white !important; - padding-left: 1em !important; - overflow: hidden !important; - white-space: pre !important; -} -.syntaxhighlighter table td.gutter .line { - text-align: right !important; - padding: 0 0.5em 0 1em !important; -} -.syntaxhighlighter table td.code .line { - padding: 0 1em !important; -} -.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { - padding-left: 0em !important; -} -.syntaxhighlighter.show { - display: block !important; -} -.syntaxhighlighter.collapsed table { - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar { - padding: 0.1em 0.8em 0em 0.8em !important; - font-size: 1em !important; - position: static !important; - width: auto !important; - height: auto !important; -} -.syntaxhighlighter.collapsed .toolbar span { - display: inline !important; - margin-right: 1em !important; -} -.syntaxhighlighter.collapsed .toolbar span a { - padding: 0 !important; - display: none !important; -} -.syntaxhighlighter.collapsed .toolbar span a.expandSource { - display: inline !important; -} -.syntaxhighlighter .toolbar { - position: absolute !important; - right: 1px !important; - top: 1px !important; - width: 11px !important; - height: 11px !important; - font-size: 10px !important; - z-index: 10 !important; -} -.syntaxhighlighter .toolbar span.title { - display: inline !important; -} -.syntaxhighlighter .toolbar a { - display: block !important; - text-align: center !important; - text-decoration: none !important; - padding-top: 1px !important; -} -.syntaxhighlighter .toolbar a.expandSource { - display: none !important; -} -.syntaxhighlighter.ie { - font-size: .9em !important; - padding: 1px 0 1px 0 !important; -} -.syntaxhighlighter.ie .toolbar { - line-height: 8px !important; -} -.syntaxhighlighter.ie .toolbar a { - padding-top: 0px !important; -} -.syntaxhighlighter.printing .line.alt1 .content, -.syntaxhighlighter.printing .line.alt2 .content, -.syntaxhighlighter.printing .line.highlighted .number, -.syntaxhighlighter.printing .line.highlighted.alt1 .content, -.syntaxhighlighter.printing .line.highlighted.alt2 .content { - background: none !important; -} -.syntaxhighlighter.printing .line .number { - color: #bbbbbb !important; -} -.syntaxhighlighter.printing .line .content { - color: black !important; -} -.syntaxhighlighter.printing .toolbar { - display: none !important; -} -.syntaxhighlighter.printing a { - text-decoration: none !important; -} -.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { - color: black !important; -} -.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { - color: #008200 !important; -} -.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { - color: blue !important; -} -.syntaxhighlighter.printing .keyword { - color: #006699 !important; - font-weight: bold !important; -} -.syntaxhighlighter.printing .preprocessor { - color: gray !important; -} -.syntaxhighlighter.printing .variable { - color: #aa7700 !important; -} -.syntaxhighlighter.printing .value { - color: #009900 !important; -} -.syntaxhighlighter.printing .functions { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .constants { - color: #0066cc !important; -} -.syntaxhighlighter.printing .script { - font-weight: bold !important; -} -.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { - color: gray !important; -} -.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { - color: red !important; -} -.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { - color: black !important; -} diff --git a/src/_h5ai/client/css/lib/sh/shThemeDefault.less b/src/_h5ai/client/css/lib/sh/shThemeDefault.less deleted file mode 100644 index 13654117..00000000 --- a/src/_h5ai/client/css/lib/sh/shThemeDefault.less +++ /dev/null @@ -1,117 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -.syntaxhighlighter { - background-color: white !important; -} -.syntaxhighlighter .line.alt1 { - background-color: white !important; -} -.syntaxhighlighter .line.alt2 { - background-color: white !important; -} -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #e0e0e0 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: black !important; -} -.syntaxhighlighter table caption { - color: black !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #6ce26c !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #6ce26c !important; - color: white !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: blue !important; - background: white !important; - border: 1px solid #6ce26c !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: blue !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: red !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #6ce26c !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: black !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: black !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #008200 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: blue !important; -} -.syntaxhighlighter .keyword { - color: #006699 !important; -} -.syntaxhighlighter .preprocessor { - color: gray !important; -} -.syntaxhighlighter .variable { - color: #aa7700 !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #ff1493 !important; -} -.syntaxhighlighter .constants { - color: #0066cc !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #006699 !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: gray !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: red !important; -} - -.syntaxhighlighter .keyword { - font-weight: bold !important; -} diff --git a/src/_h5ai/client/css/styles.less b/src/_h5ai/client/css/styles.less index 631aba7d..de6b62e8 100644 --- a/src/_h5ai/client/css/styles.less +++ b/src/_h5ai/client/css/styles.less @@ -3,8 +3,6 @@ @import "lib/h5bp-main-header"; @import "lib/mixins"; -@import "lib/sh/shCore"; -@import "lib/sh/shThemeDefault"; @import "inc/general"; @import "inc/topbar"; @@ -17,16 +15,17 @@ @import "inc/qrcode"; @import "inc/preview-img"; @import "inc/preview-txt"; +@import "inc/notify"; @import "inc/content"; -@import "inc/extended"; -@import "inc/extended-details"; -@import "inc/extended-icons"; -@import "inc/extended-list"; -@import "inc/extended-grid"; +@import "inc/view"; +@import "inc/view-details"; +@import "inc/view-icons"; +@import "inc/view-list"; +@import "inc/view-grid"; // @import "inc/context-menu"; @import "inc/dropbox"; -@import "inc/fallback-table"; +@import "inc/fallback"; @import "inc/responsive"; diff --git a/src/_h5ai/client/icons/16x16/folder-0.png b/src/_h5ai/client/icons/16x16/folder-0.png new file mode 100644 index 00000000..7c613e05 Binary files /dev/null and b/src/_h5ai/client/icons/16x16/folder-0.png differ diff --git a/src/_h5ai/client/icons/16x16/folder-home.png b/src/_h5ai/client/icons/16x16/folder-home.png deleted file mode 100644 index 14fe20ab..00000000 Binary files a/src/_h5ai/client/icons/16x16/folder-home.png and /dev/null differ diff --git a/src/_h5ai/client/icons/16x16/folder-open.png b/src/_h5ai/client/icons/16x16/folder-open.png deleted file mode 100644 index 2aa5cc75..00000000 Binary files a/src/_h5ai/client/icons/16x16/folder-open.png and /dev/null differ diff --git a/src/_h5ai/client/icons/16x16/folder-page-0.png b/src/_h5ai/client/icons/16x16/folder-page-0.png new file mode 100644 index 00000000..604f9ad1 Binary files /dev/null and b/src/_h5ai/client/icons/16x16/folder-page-0.png differ diff --git a/src/_h5ai/client/icons/16x16/folder-page.png b/src/_h5ai/client/icons/16x16/folder-page.png index 604f9ad1..bd2f8b99 100644 Binary files a/src/_h5ai/client/icons/16x16/folder-page.png and b/src/_h5ai/client/icons/16x16/folder-page.png differ diff --git a/src/_h5ai/client/icons/16x16/folder-parent-old.png b/src/_h5ai/client/icons/16x16/folder-parent-0.png similarity index 100% rename from src/_h5ai/client/icons/16x16/folder-parent-old.png rename to src/_h5ai/client/icons/16x16/folder-parent-0.png diff --git a/src/_h5ai/client/icons/16x16/folder-parent-1.png b/src/_h5ai/client/icons/16x16/folder-parent-1.png new file mode 100644 index 00000000..3c964f19 Binary files /dev/null and b/src/_h5ai/client/icons/16x16/folder-parent-1.png differ diff --git a/src/_h5ai/client/icons/16x16/folder-parent.png b/src/_h5ai/client/icons/16x16/folder-parent.png index 3c964f19..183c3c8e 100644 Binary files a/src/_h5ai/client/icons/16x16/folder-parent.png and b/src/_h5ai/client/icons/16x16/folder-parent.png differ diff --git a/src/_h5ai/client/icons/16x16/folder.png b/src/_h5ai/client/icons/16x16/folder.png index 7c613e05..a8d601ae 100644 Binary files a/src/_h5ai/client/icons/16x16/folder.png and b/src/_h5ai/client/icons/16x16/folder.png differ diff --git a/src/_h5ai/client/icons/48x48/folder-0.png b/src/_h5ai/client/icons/48x48/folder-0.png new file mode 100644 index 00000000..f47e7e13 Binary files /dev/null and b/src/_h5ai/client/icons/48x48/folder-0.png differ diff --git a/src/_h5ai/client/icons/48x48/folder-home.png b/src/_h5ai/client/icons/48x48/folder-home.png deleted file mode 100644 index 093060ac..00000000 Binary files a/src/_h5ai/client/icons/48x48/folder-home.png and /dev/null differ diff --git a/src/_h5ai/client/icons/48x48/folder-open.png b/src/_h5ai/client/icons/48x48/folder-open.png deleted file mode 100644 index 41ebd8cf..00000000 Binary files a/src/_h5ai/client/icons/48x48/folder-open.png and /dev/null differ diff --git a/src/_h5ai/client/icons/48x48/folder-page-0.png b/src/_h5ai/client/icons/48x48/folder-page-0.png new file mode 100644 index 00000000..cd2175a9 Binary files /dev/null and b/src/_h5ai/client/icons/48x48/folder-page-0.png differ diff --git a/src/_h5ai/client/icons/48x48/folder-page.png b/src/_h5ai/client/icons/48x48/folder-page.png index cd2175a9..6a3ca2be 100644 Binary files a/src/_h5ai/client/icons/48x48/folder-page.png and b/src/_h5ai/client/icons/48x48/folder-page.png differ diff --git a/src/_h5ai/client/icons/48x48/folder-parent-0.png b/src/_h5ai/client/icons/48x48/folder-parent-0.png new file mode 100644 index 00000000..0ae73de1 Binary files /dev/null and b/src/_h5ai/client/icons/48x48/folder-parent-0.png differ diff --git a/src/_h5ai/client/icons/48x48/folder-parent.png b/src/_h5ai/client/icons/48x48/folder-parent.png index 0ae73de1..6a8ec84b 100644 Binary files a/src/_h5ai/client/icons/48x48/folder-parent.png and b/src/_h5ai/client/icons/48x48/folder-parent.png differ diff --git a/src/_h5ai/client/icons/48x48/folder.png b/src/_h5ai/client/icons/48x48/folder.png index f47e7e13..bf477170 100644 Binary files a/src/_h5ai/client/icons/48x48/folder.png and b/src/_h5ai/client/icons/48x48/folder.png differ diff --git a/src/_h5ai/client/icons/scalable/folder-page.svg b/src/_h5ai/client/icons/scalable/folder-page.svg new file mode 100644 index 00000000..0381df9b --- /dev/null +++ b/src/_h5ai/client/icons/scalable/folder-page.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/icons/scalable/folder-parent.svg b/src/_h5ai/client/icons/scalable/folder-parent.svg new file mode 100644 index 00000000..06566450 --- /dev/null +++ b/src/_h5ai/client/icons/scalable/folder-parent.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/icons/scalable/folder.svg b/src/_h5ai/client/icons/scalable/folder.svg new file mode 100644 index 00000000..3104365f --- /dev/null +++ b/src/_h5ai/client/icons/scalable/folder.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/images/app-114x114.png b/src/_h5ai/client/images/app-114x114.png new file mode 100644 index 00000000..6de58eaa Binary files /dev/null and b/src/_h5ai/client/images/app-114x114.png differ diff --git a/src/_h5ai/client/images/app-144x144.png b/src/_h5ai/client/images/app-144x144.png new file mode 100644 index 00000000..ecd9a74f Binary files /dev/null and b/src/_h5ai/client/images/app-144x144.png differ diff --git a/src/_h5ai/client/images/app-16x16.ico b/src/_h5ai/client/images/app-16x16.ico index d8d95d09..63ead9eb 100644 Binary files a/src/_h5ai/client/images/app-16x16.ico and b/src/_h5ai/client/images/app-16x16.ico differ diff --git a/src/_h5ai/client/images/app-48x48.png b/src/_h5ai/client/images/app-48x48.png index f47e7e13..bf477170 100644 Binary files a/src/_h5ai/client/images/app-48x48.png and b/src/_h5ai/client/images/app-48x48.png differ diff --git a/src/_h5ai/client/images/app-57x57.png b/src/_h5ai/client/images/app-57x57.png new file mode 100644 index 00000000..bd9fd698 Binary files /dev/null and b/src/_h5ai/client/images/app-57x57.png differ diff --git a/src/_h5ai/client/images/app-72x72.png b/src/_h5ai/client/images/app-72x72.png new file mode 100644 index 00000000..1e893f8b Binary files /dev/null and b/src/_h5ai/client/images/app-72x72.png differ diff --git a/src/_h5ai/client/images/app.svg b/src/_h5ai/client/images/app.svg new file mode 100644 index 00000000..f9f62db9 --- /dev/null +++ b/src/_h5ai/client/images/app.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/images/ascending.png b/src/_h5ai/client/images/ascending.png deleted file mode 100644 index 4385011f..00000000 Binary files a/src/_h5ai/client/images/ascending.png and /dev/null differ diff --git a/src/_h5ai/client/images/ascending.svg b/src/_h5ai/client/images/ascending.svg new file mode 100644 index 00000000..472e31b6 --- /dev/null +++ b/src/_h5ai/client/images/ascending.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/blank.png b/src/_h5ai/client/images/blank.png deleted file mode 100644 index bef1f600..00000000 Binary files a/src/_h5ai/client/images/blank.png and /dev/null differ diff --git a/src/_h5ai/client/images/blank.svg b/src/_h5ai/client/images/blank.svg new file mode 100644 index 00000000..e0423172 --- /dev/null +++ b/src/_h5ai/client/images/blank.svg @@ -0,0 +1,14 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + diff --git a/src/_h5ai/client/images/crumb.png b/src/_h5ai/client/images/crumb.png deleted file mode 100644 index 8e19959c..00000000 Binary files a/src/_h5ai/client/images/crumb.png and /dev/null differ diff --git a/src/_h5ai/client/images/crumb.svg b/src/_h5ai/client/images/crumb.svg new file mode 100644 index 00000000..662db546 --- /dev/null +++ b/src/_h5ai/client/images/crumb.svg @@ -0,0 +1,19 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + diff --git a/src/_h5ai/client/images/delete.png b/src/_h5ai/client/images/delete.png deleted file mode 100644 index 9d8afaef..00000000 Binary files a/src/_h5ai/client/images/delete.png and /dev/null differ diff --git a/src/_h5ai/client/images/delete.svg b/src/_h5ai/client/images/delete.svg new file mode 100644 index 00000000..4cc729ef --- /dev/null +++ b/src/_h5ai/client/images/delete.svg @@ -0,0 +1,17 @@ + + + + Gnome Symbolic Icon Theme + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + diff --git a/src/_h5ai/client/images/descending.png b/src/_h5ai/client/images/descending.png deleted file mode 100644 index f4341b64..00000000 Binary files a/src/_h5ai/client/images/descending.png and /dev/null differ diff --git a/src/_h5ai/client/images/descending.svg b/src/_h5ai/client/images/descending.svg new file mode 100644 index 00000000..c99a358f --- /dev/null +++ b/src/_h5ai/client/images/descending.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/download.png b/src/_h5ai/client/images/download.png deleted file mode 100644 index a6754f42..00000000 Binary files a/src/_h5ai/client/images/download.png and /dev/null differ diff --git a/src/_h5ai/client/images/download.svg b/src/_h5ai/client/images/download.svg new file mode 100644 index 00000000..0db1eaac --- /dev/null +++ b/src/_h5ai/client/images/download.svg @@ -0,0 +1,21 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + + + diff --git a/src/_h5ai/client/images/filter.png b/src/_h5ai/client/images/filter.png deleted file mode 100644 index 0d55aeec..00000000 Binary files a/src/_h5ai/client/images/filter.png and /dev/null differ diff --git a/src/_h5ai/client/images/filter.svg b/src/_h5ai/client/images/filter.svg new file mode 100644 index 00000000..2f6ae6bb --- /dev/null +++ b/src/_h5ai/client/images/filter.svg @@ -0,0 +1,18 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + diff --git a/src/_h5ai/client/images/folder-open.svg b/src/_h5ai/client/images/folder-open.svg new file mode 100644 index 00000000..482e6d6b --- /dev/null +++ b/src/_h5ai/client/images/folder-open.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/images/folder-page.svg b/src/_h5ai/client/images/folder-page.svg new file mode 100644 index 00000000..c5c41777 --- /dev/null +++ b/src/_h5ai/client/images/folder-page.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/images/folder.svg b/src/_h5ai/client/images/folder.svg new file mode 100644 index 00000000..f9f62db9 --- /dev/null +++ b/src/_h5ai/client/images/folder.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + diff --git a/src/_h5ai/client/images/home.png b/src/_h5ai/client/images/home.png deleted file mode 100644 index 78d42e7a..00000000 Binary files a/src/_h5ai/client/images/home.png and /dev/null differ diff --git a/src/_h5ai/client/images/home.svg b/src/_h5ai/client/images/home.svg new file mode 100644 index 00000000..0ef4276a --- /dev/null +++ b/src/_h5ai/client/images/home.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/loading.png b/src/_h5ai/client/images/loading.png deleted file mode 100644 index bac972a4..00000000 Binary files a/src/_h5ai/client/images/loading.png and /dev/null differ diff --git a/src/_h5ai/client/images/loading.svg b/src/_h5ai/client/images/loading.svg new file mode 100644 index 00000000..50f18365 --- /dev/null +++ b/src/_h5ai/client/images/loading.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/page.png b/src/_h5ai/client/images/page.png deleted file mode 100644 index 24655400..00000000 Binary files a/src/_h5ai/client/images/page.png and /dev/null differ diff --git a/src/_h5ai/client/images/page.svg b/src/_h5ai/client/images/page.svg new file mode 100644 index 00000000..20a2724f --- /dev/null +++ b/src/_h5ai/client/images/page.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/preview/close.png b/src/_h5ai/client/images/preview/close.png deleted file mode 100644 index 6131af8c..00000000 Binary files a/src/_h5ai/client/images/preview/close.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/close.svg b/src/_h5ai/client/images/preview/close.svg new file mode 100644 index 00000000..c73fcf93 --- /dev/null +++ b/src/_h5ai/client/images/preview/close.svg @@ -0,0 +1,19 @@ + + + + Gnome Symbolic Icon Theme + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + + + diff --git a/src/_h5ai/client/images/preview/crumb.png b/src/_h5ai/client/images/preview/crumb.png deleted file mode 100644 index 79ae88f6..00000000 Binary files a/src/_h5ai/client/images/preview/crumb.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/fullscreen.png b/src/_h5ai/client/images/preview/fullscreen.png deleted file mode 100644 index c12ae48a..00000000 Binary files a/src/_h5ai/client/images/preview/fullscreen.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/fullscreen.svg b/src/_h5ai/client/images/preview/fullscreen.svg new file mode 100644 index 00000000..539c3f5e --- /dev/null +++ b/src/_h5ai/client/images/preview/fullscreen.svg @@ -0,0 +1,26 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + diff --git a/src/_h5ai/client/images/preview/home.png b/src/_h5ai/client/images/preview/home.png deleted file mode 100644 index aaceee0d..00000000 Binary files a/src/_h5ai/client/images/preview/home.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/next.png b/src/_h5ai/client/images/preview/next.png deleted file mode 100644 index 7c48e145..00000000 Binary files a/src/_h5ai/client/images/preview/next.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/next.svg b/src/_h5ai/client/images/preview/next.svg new file mode 100644 index 00000000..cb16e28f --- /dev/null +++ b/src/_h5ai/client/images/preview/next.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/preview/no-fullscreen.png b/src/_h5ai/client/images/preview/no-fullscreen.png deleted file mode 100644 index 20da1355..00000000 Binary files a/src/_h5ai/client/images/preview/no-fullscreen.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/no-fullscreen.svg b/src/_h5ai/client/images/preview/no-fullscreen.svg new file mode 100644 index 00000000..03b7e73d --- /dev/null +++ b/src/_h5ai/client/images/preview/no-fullscreen.svg @@ -0,0 +1,25 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + diff --git a/src/_h5ai/client/images/preview/play.png b/src/_h5ai/client/images/preview/play.png deleted file mode 100644 index 79ae88f6..00000000 Binary files a/src/_h5ai/client/images/preview/play.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/prev.png b/src/_h5ai/client/images/preview/prev.png deleted file mode 100644 index 8c759e26..00000000 Binary files a/src/_h5ai/client/images/preview/prev.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/prev.svg b/src/_h5ai/client/images/preview/prev.svg new file mode 100644 index 00000000..9d982b94 --- /dev/null +++ b/src/_h5ai/client/images/preview/prev.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/preview/raw.png b/src/_h5ai/client/images/preview/raw.png deleted file mode 100644 index cde6412e..00000000 Binary files a/src/_h5ai/client/images/preview/raw.png and /dev/null differ diff --git a/src/_h5ai/client/images/preview/raw.svg b/src/_h5ai/client/images/preview/raw.svg new file mode 100644 index 00000000..22d5be55 --- /dev/null +++ b/src/_h5ai/client/images/preview/raw.svg @@ -0,0 +1,21 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + + + diff --git a/src/_h5ai/client/images/settings.svg b/src/_h5ai/client/images/settings.svg new file mode 100644 index 00000000..f606f30c --- /dev/null +++ b/src/_h5ai/client/images/settings.svg @@ -0,0 +1,17 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + diff --git a/src/_h5ai/client/images/spinner.svg b/src/_h5ai/client/images/spinner.svg new file mode 100644 index 00000000..ebe0d921 --- /dev/null +++ b/src/_h5ai/client/images/spinner.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/_h5ai/client/images/tree.png b/src/_h5ai/client/images/tree.png deleted file mode 100644 index 8e19959c..00000000 Binary files a/src/_h5ai/client/images/tree.png and /dev/null differ diff --git a/src/_h5ai/client/images/tree.svg b/src/_h5ai/client/images/tree.svg new file mode 100644 index 00000000..662db546 --- /dev/null +++ b/src/_h5ai/client/images/tree.svg @@ -0,0 +1,19 @@ + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + Gnome Symbolic Icon Theme + + + + + + diff --git a/src/_h5ai/client/images/view-details.png b/src/_h5ai/client/images/view-details.png deleted file mode 100644 index d5a6cd33..00000000 Binary files a/src/_h5ai/client/images/view-details.png and /dev/null differ diff --git a/src/_h5ai/client/images/view-details.svg b/src/_h5ai/client/images/view-details.svg new file mode 100644 index 00000000..bd48a609 --- /dev/null +++ b/src/_h5ai/client/images/view-details.svg @@ -0,0 +1,12 @@ + + + + + + + diff --git a/src/_h5ai/client/images/view-grid.png b/src/_h5ai/client/images/view-grid.png deleted file mode 100644 index a9cb1fe6..00000000 Binary files a/src/_h5ai/client/images/view-grid.png and /dev/null differ diff --git a/src/_h5ai/client/images/view-grid.svg b/src/_h5ai/client/images/view-grid.svg new file mode 100644 index 00000000..0e5c11be --- /dev/null +++ b/src/_h5ai/client/images/view-grid.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/src/_h5ai/client/images/view-icons.png b/src/_h5ai/client/images/view-icons.png deleted file mode 100644 index a9cb1fe6..00000000 Binary files a/src/_h5ai/client/images/view-icons.png and /dev/null differ diff --git a/src/_h5ai/client/images/view-icons.svg b/src/_h5ai/client/images/view-icons.svg new file mode 100644 index 00000000..dbea6106 --- /dev/null +++ b/src/_h5ai/client/images/view-icons.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/src/_h5ai/client/images/view-list.png b/src/_h5ai/client/images/view-list.png deleted file mode 100644 index d5a6cd33..00000000 Binary files a/src/_h5ai/client/images/view-list.png and /dev/null differ diff --git a/src/_h5ai/client/images/view-list.svg b/src/_h5ai/client/images/view-list.svg new file mode 100644 index 00000000..4079bd01 --- /dev/null +++ b/src/_h5ai/client/images/view-list.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/src/_h5ai/client/js/inc/core/entry.js b/src/_h5ai/client/js/inc/core/entry.js deleted file mode 100644 index 53431840..00000000 --- a/src/_h5ai/client/js/inc/core/entry.js +++ /dev/null @@ -1,48 +0,0 @@ - -modulejs.define('core/entry', ['_', '$', 'core/format', 'model/entry'], function (_, $, format, Entry) { - - var parseGenericJson = function (absHref, $container) { - - return JSON.parse($.trim($container.text()) || '{}').entries; - }, - - parseApacheTable = function (absHref, $table) { - - return _.compact(_.map($table.find('td').closest('tr'), function (tr) { - - var $tds = $(tr).find('td'), - $a = $tds.eq(1).find('a'); - - return $a.text() === 'Parent Directory' ? null : { - absHref: absHref + $a.attr('href'), - time: format.parseDate($tds.eq(2).text(), ['YYYY-MM-DD HH:mm', 'DD-MMM-YYYY HH:mm']), - size: format.parseSize($tds.eq(3).text()) - }; - })); - }, - - parse = function (absHref, $html) { - - var $generic = $html.find('#data-generic-json'), - $apache = $html.find('#data-apache-autoindex table'), - json = []; - - if ($generic.length) { - json = parseGenericJson(absHref, $generic); - } else if ($apache.length) { - json = parseApacheTable(absHref, $apache); - } - - return _.map(json, function (entry) { - - return Entry.get(entry.absHref, entry.time, entry.size, entry.status, entry.content); - }); - }, - - entry = Entry.get(); - - parse(entry.absHref, $('body')); - entry.status = '=h5ai='; - - return entry; -}); diff --git a/src/_h5ai/client/js/inc/core/event.js b/src/_h5ai/client/js/inc/core/event.js index 14fd0d61..1873a5ca 100644 --- a/src/_h5ai/client/js/inc/core/event.js +++ b/src/_h5ai/client/js/inc/core/event.js @@ -1,7 +1,8 @@ modulejs.define('core/event', ['_'], function (_) { - var subscriptions = {}, + var slice = Array.prototype.slice, + subscriptions = {}, sub = function (topic, callback) { @@ -24,12 +25,14 @@ modulejs.define('core/event', ['_'], function (_) { pub = function (topic, data) { - // console.log('EVENT PUB', topic, data); + var args = slice.call(arguments, 1); + + // console.log('EVENT PUB', topic, args); if (_.isString(topic) && subscriptions[topic]) { _.each(subscriptions[topic], function (callback) { - callback(data); + callback.apply(topic, args); }); } }; diff --git a/src/_h5ai/client/js/inc/core/format.js b/src/_h5ai/client/js/inc/core/format.js index edebc71d..9d6cc225 100644 --- a/src/_h5ai/client/js/inc/core/format.js +++ b/src/_h5ai/client/js/inc/core/format.js @@ -1,8 +1,7 @@ modulejs.define('core/format', ['_', 'moment'], function (_, moment) { - var reParseSize = /^\s*([\.\d]+)\s*([kmgt]?)b?\s*$/i, - decimalMetric = { + var decimalMetric = { t: 1000.0, k: 1000.0, u: ['B', 'KB', 'MB', 'GB', 'TB'] @@ -15,39 +14,9 @@ modulejs.define('core/format', ['_', 'moment'], function (_, moment) { defaultMetric = decimalMetric, defaultDateFormat = 'YYYY-MM-DD HH:mm', - parseSize = function (str) { + setDefaultMetric = function (useBinaryMetric) { - var match = reParseSize.exec(str), - kilo = decimalMetric.k, - val, unit; - - if (!match) { - return null; - } - - val = parseFloat(match[1]); - unit = match[2].toLowerCase(); - if (unit === 'k') { - val *= kilo; - } else if (unit === 'm') { - val *= kilo * kilo; - } else if (unit === 'g') { - val *= kilo * kilo * kilo; - } else if (unit === 't') { - val *= kilo * kilo * kilo * kilo; - } - return val; - }, - - setDefaultMetric = function (metric) { - - if (!metric) { - defaultMetric = decimalMetric; - } else if (metric === true) { - defaultMetric = binaryMetric; - } else { - defaultMetric = metric; - } + defaultMetric = useBinaryMetric ? binaryMetric : decimalMetric; }, formatSize = function (size, metric) { @@ -73,30 +42,15 @@ modulejs.define('core/format', ['_', 'moment'], function (_, moment) { defaultDateFormat = dateFormat; }, - parseDate = function (str, dateFormat) { + formatDate = function (millis) { - try { // problems with ie < 9 :( - return moment(str, dateFormat || defaultDateFormat).valueOf() || null; - } catch (err) {} - - return Date.parse(str).valueOf() || null; - }, - - formatDate = function (millis, dateFormat) { - - if (!_.isNumber(millis) || !millis) { - return ''; - } - - return moment(millis).format(dateFormat || defaultDateFormat); + return _.isNumber(millis) && millis ? moment(millis).format(defaultDateFormat) : ''; }; return { - parseSize: parseSize, setDefaultMetric: setDefaultMetric, formatSize: formatSize, setDefaultDateFormat: setDefaultDateFormat, - parseDate: parseDate, formatDate: formatDate }; }); diff --git a/src/_h5ai/client/js/inc/core/location.js b/src/_h5ai/client/js/inc/core/location.js index 0ebcb24e..0a62f8c7 100644 --- a/src/_h5ai/client/js/inc/core/location.js +++ b/src/_h5ai/client/js/inc/core/location.js @@ -1,7 +1,14 @@ -modulejs.define('core/location', ['$', 'core/event'], function ($, event) { +modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event', 'core/notify'], function (_, modernizr, allsettings, event, notify) { - var doc = document, + var settings = _.extend({ + smartBrowsing: true, + extInNewWindow: true + }, allsettings.view), + + doc = document, + + history = settings.smartBrowsing && modernizr.history ? window.history : null, forceEncoding = function (href) { @@ -17,36 +24,174 @@ modulejs.define('core/location', ['$', 'core/event'], function ($, event) { .replace(/\=/g, '%3D'); }, - absHref = (function () { + reUriToPathname = /^.*:\/\/[^\/]*|[^\/]*$/g, + uriToPathname = function (uri) { - var rePrePathname = /.*:\/\/[^\/]*/, - rePostPathname = /[^\/]*$/, + return uri.replace(reUriToPathname, ''); + }, - uriToPathname = function (uri) { + hrefsAreDecoded = (function () { - return uri.replace(rePrePathname, '').replace(rePostPathname, ''); - }, - - testpathname = '/a b', - a = doc.createElement('a'), - isDecoded, location; + var testpathname = '/a b', + a = doc.createElement('a'); a.href = testpathname; - isDecoded = uriToPathname(a.href) === testpathname; + return uriToPathname(a.href) === testpathname; + }()), - a.href = doc.location.href; + encodedHref = function (href) { + + var a = doc.createElement('a'), + location; + + a.href = href; location = uriToPathname(a.href); - if (isDecoded) { + if (hrefsAreDecoded) { location = encodeURIComponent(location).replace(/%2F/ig, '/'); } return forceEncoding(location); - }()); + }; + + + var absHref = null, + + getDomain = function () { + + return doc.domain; + }, + + getAbsHref = function () { + + return absHref; + }, + + getItem = function () { + + return modulejs.require('model/item').get(absHref); + }, + + load = function (callback) { + + modulejs.require('core/server').request({action: 'get', items: true, itemsHref: absHref, itemsWhat: 1}, function (json) { + + var Item = modulejs.require('model/item'), + item = Item.get(absHref); + + if (json) { + + var found = {}; + + _.each(json.items, function (jsonItem) { + + var e = Item.get(jsonItem.absHref, jsonItem.time, jsonItem.size, jsonItem.status, jsonItem.content); + found[e.absHref] = true; + }); + + _.each(item.content, function (e) { + + if (!found[e.absHref]) { + Item.remove(e.absHref); + } + }); + } + if (_.isFunction(callback)) { + callback(item); + } + }); + }, + + setLocation = function (newAbsHref, keepBrowserUrl) { + + event.pub('location.beforeChange'); + + newAbsHref = encodedHref(newAbsHref); + + if (absHref !== newAbsHref) { + absHref = newAbsHref; + + if (history) { + if (keepBrowserUrl) { + history.replaceState({absHref: absHref}, '', absHref); + } else { + history.pushState({absHref: absHref}, '', absHref); + } + } + } + + var item = getItem(); + if (item.isLoaded) { + event.pub('location.changed', item); + refresh(); + } else { + notify.set('loading...'); + load(function () { + item.isLoaded = true; + notify.set(); + event.pub('location.changed', item); + }); + } + }, + + refresh = function () { + + var item = getItem(), + oldItems = _.values(item.content); + + event.pub('location.beforeRefresh'); + + load(function () { + + var newItems = _.values(item.content), + added = _.difference(newItems, oldItems), + removed = _.difference(oldItems, newItems); + + event.pub('location.refreshed', item, added, removed); + }); + }, + + setLink = function ($el, item) { + + $el.attr('href', item.absHref); + + if (history && item.isFolder() && item.status === '=h5ai=') { + $el.on('click', function () { + + setLocation(item.absHref); + return false; + }); + } + + if (settings.extInNewWindow && item.status !== '=h5ai=') { + $el.attr('target', '_blank'); + } + }; + + + if (history) { + window.onpopstate = function (e) { + + if (e.state && e.state.absHref) { + setLocation(e.state.absHref, true); + } + }; + } + + + event.sub('ready', function () { + + setLocation(document.location.href, true); + }); + return { - domain: doc.domain, - absHref: absHref, - forceEncoding: forceEncoding + forceEncoding: forceEncoding, + getDomain: getDomain, + getAbsHref: getAbsHref, + getItem: getItem, + setLocation: setLocation, + refresh: refresh, + setLink: setLink }; }); diff --git a/src/_h5ai/client/js/inc/core/notify.js b/src/_h5ai/client/js/inc/core/notify.js new file mode 100644 index 00000000..a9aebbfe --- /dev/null +++ b/src/_h5ai/client/js/inc/core/notify.js @@ -0,0 +1,25 @@ + +modulejs.define('core/notify', ['$'], function ($) { + + var template = '
', + + set = function (content) { + + if (content) { + $('#notify').stop(true, true).html(content).fadeIn(400); + } else { + $('#notify').stop(true, true).fadeOut(400); + } + }, + + init = function () { + + $(template).hide().appendTo('body'); + }; + + init(); + + return { + set: set + }; +}); diff --git a/src/_h5ai/client/js/inc/core/refresh.js b/src/_h5ai/client/js/inc/core/refresh.js deleted file mode 100644 index 23d60b84..00000000 --- a/src/_h5ai/client/js/inc/core/refresh.js +++ /dev/null @@ -1,37 +0,0 @@ - -modulejs.define('core/refresh', ['_', 'core/server', 'model/entry'], function (_, server, Entry) { - - var parseJson = function (entry, json) { - - var found = {}; - - _.each(json.entries, function (jsonEntry) { - - var e = Entry.get(jsonEntry.absHref, jsonEntry.time, jsonEntry.size, jsonEntry.status, jsonEntry.content); - found[e.absHref] = true; - }); - - _.each(entry.content, function (e) { - if (!found[e.absHref]) { - Entry.remove(e.absHref); - } - }); - }, - - refresh = function (callback) { - - var entry = Entry.get(); - - server.request({action: 'get', entries: true, entriesHref: entry.absHref, entriesWhat: 1}, function (json) { - - if (json) { - parseJson(entry, json); - } - if (_.isFunction(callback)) { - callback(entry); - } - }); - }; - - return refresh; -}); diff --git a/src/_h5ai/client/js/inc/core/resource.js b/src/_h5ai/client/js/inc/core/resource.js index 1be1a4cc..db012abe 100644 --- a/src/_h5ai/client/js/inc/core/resource.js +++ b/src/_h5ai/client/js/inc/core/resource.js @@ -1,10 +1,11 @@ modulejs.define('core/resource', ['core/settings'], function (settings) { - var image = function (id, noPngExt) { + var image = function (id, customExt) { - return settings.h5aiAbsHref + 'client/images/' + id + (noPngExt ? '' : '.png'); + return settings.h5aiAbsHref + 'client/images/' + id + (customExt ? '' : '.svg'); }, + icon = function (id, big) { return settings.h5aiAbsHref + 'client/icons/' + (big ? '48x48' : '16x16') + '/' + id + '.png'; diff --git a/src/_h5ai/client/js/inc/core/server.js b/src/_h5ai/client/js/inc/core/server.js index 7870d219..3ca818f6 100644 --- a/src/_h5ai/client/js/inc/core/server.js +++ b/src/_h5ai/client/js/inc/core/server.js @@ -1,5 +1,5 @@ -modulejs.define('core/server', ['$', '_', 'config'], function ($, _, config) { +modulejs.define('core/server', ['$', '_', 'config', 'core/location'], function ($, _, config, location) { var server = _.extend({}, config.server, { @@ -7,7 +7,7 @@ modulejs.define('core/server', ['$', '_', 'config'], function ($, _, config) { if (server.api) { $.ajax({ - url: '.', + url: location.getAbsHref(), data: data, type: 'POST', dataType: 'json', @@ -20,8 +20,6 @@ modulejs.define('core/server', ['$', '_', 'config'], function ($, _, config) { callback(); } }); - } else if (server.backend === 'aai') { - return modulejs.require('core/server-request-mock-aai')(data, callback); } else { callback(); } @@ -30,121 +28,3 @@ modulejs.define('core/server', ['$', '_', 'config'], function ($, _, config) { return server; }); - - - -modulejs.define('core/server-request-mock-aai', ['$', '_', 'core/settings', 'core/format'], function ($, _, allsettings, format) { - - var loadText = function (href) { - - var deferred = $.Deferred(); - - $.ajax(href, {dataType: 'text'}).always(function (content) { - - content = content.replace ? content : null; - deferred.resolve(content); - }); - - return deferred; - }, - - loadJson = function (href) { - - var deferred = $.Deferred(); - - loadText(href).always(function (content) { - - var json = content.replace ? JSON.parse(content.replace(/\/\*[\s\S]*?\*\/|\/\/.*?(\n|$)/g, '')) : {}; - deferred.resolve(json); - }); - - return deferred; - }, - - parse = function (absHref, html) { - - html = '
' + html.replace(/^[\s\S]*|<\/body>[\s\S]*$/g, '') + '
'; - var $table = $(html).find('#data-apache-autoindex table'); - - return _.compact(_.map($table.find('td').closest('tr'), function (tr) { - - var $tds = $(tr).find('td'), - $a = $tds.eq(1).find('a'); - - return $a.text() === 'Parent Directory' ? null : { - absHref: absHref + $a.attr('href'), - time: format.parseDate($tds.eq(2).text(), ['YYYY-MM-DD HH:mm', 'DD-MMM-YYYY HH:mm']), - size: format.parseSize($tds.eq(3).text()) - }; - })); - }; - - return function (data, callback) { - - if (data.action === 'get' && data.l10n === true) { - - var isoCodes = data.l10nCodes.split(':'); - var isoCode = data.l10nCodes.split(':')[0]; - loadJson(allsettings.h5aiAbsHref + 'conf/l10n/' + isoCode + '.json').done(function (json) { - - var result = {code: 0, l10n: {}}; - - if (json) { - result.l10n[isoCode] = json; - } - callback(result); - }); - - } else if (data.action === 'get' && data.custom === true) { - - $.when( - loadText('_h5ai.header.html'), - loadText('_h5ai.footer.html') - ).done(function (header, footer) { - - callback({ - code: 0, - custom: { - header: header, - footer: footer - } - }); - }); - - } else if (data.action === 'get' && data.entries === true) { - - var absHref = data.entriesHref, - what = data.entriesWhat, - magicSequence = '=h5ai=', - reContentType = /^text\/html;h5ai=/; - - $.ajax({ - url: absHref, - type: what === 0 ? 'HEAD' : 'GET', - complete: function (xhr) { - - var entries = [], - status = xhr.status; - - if (status === 200 && reContentType.test(xhr.getResponseHeader('Content-Type'))) { - status = magicSequence; - } - - if (status === magicSequence && what > 0) { - entries = parse(absHref, xhr.responseText); - } - entries.push({absHref: absHref, status: status, content: what > 0}); - - callback({ - code: 0, - entries: entries - }); - } - }); - - } else { - - callback(); - } - }; -}); diff --git a/src/_h5ai/client/js/inc/core/settings.js b/src/_h5ai/client/js/inc/core/settings.js index 6afde834..03112e74 100644 --- a/src/_h5ai/client/js/inc/core/settings.js +++ b/src/_h5ai/client/js/inc/core/settings.js @@ -1,16 +1,17 @@ modulejs.define('core/settings', ['config', '_', '$'], function (config, _, $) { - var settings = _.extend({ - h5aiAbsHref: '/_h5ai/' - }, config.options), - - filename = 'client/js/scripts.js', + var filename = 'client/js/scripts.js', src = $('script[src$="' + filename + '"]').attr('src'), - appHref = src.substr(0, src.length - filename.length); + appHref = src.substr(0, src.length - filename.length), - settings.h5aiAbsHref = src.substr(0, src.length - filename.length).replace(/\/*$/, '/'); - settings.rootAbsHref = /^(.*\/)[^\/]+\/?$/.exec(settings.h5aiAbsHref)[1]; + h5aiAbsHref = src.substr(0, src.length - filename.length).replace(/\/*$/, '/'), + rootAbsHref = /^(.*\/)[^\/]+\/?$/.exec(h5aiAbsHref)[1], + + settings = _.extend({}, config.options, { + h5aiAbsHref: h5aiAbsHref, + rootAbsHref: rootAbsHref + }); return settings; }); diff --git a/src/_h5ai/client/js/inc/core/store.js b/src/_h5ai/client/js/inc/core/store.js index c7c2a7c3..e4a66222 100644 --- a/src/_h5ai/client/js/inc/core/store.js +++ b/src/_h5ai/client/js/inc/core/store.js @@ -1,25 +1,37 @@ -modulejs.define('core/store', ['_'], function (_) { +modulejs.define('core/store', ['modernizr'], function (modernizr) { - var store = window.localStorage, + var store = modernizr.localstorage ? window.localStorage : null, + + key = '_h5ai', + + load = function () { + + if (store) { + try { + return JSON.parse(store[key]); + } catch (e) {} + } + return {}; + }, + + save = function (obj) { + + if (store) { + store[key] = JSON.stringify(obj); + } + }, put = function (key, value) { - if (store && _.isString(key)) { - store[key] = JSON.stringify({data: value}); - } + var obj = load(); + obj[key] = value; + return save(obj); }, get = function (key) { - if (store && _.isString(key)) { - var json = store[key], - obj = {}; - - try { obj = JSON.parse(json); } catch (e) {} - - return obj.data; - } + return load()[key]; }; return { diff --git a/src/_h5ai/client/js/inc/ext/autorefresh.js b/src/_h5ai/client/js/inc/ext/autorefresh.js index 7faff453..dba4dcc4 100644 --- a/src/_h5ai/client/js/inc/ext/autorefresh.js +++ b/src/_h5ai/client/js/inc/ext/autorefresh.js @@ -1,15 +1,27 @@ -modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'core/refresh'], function (_, $, allsettings, event, refresh) { +modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'core/location'], function (_, $, allsettings, event, location) { var settings = _.extend({ enabled: false, interval: 5000 }, allsettings.autorefresh), + timeoutId = null, + heartbeat = function () { - refresh(); - setTimeout(heartbeat, settings.interval); + location.refresh(); + }, + + before = function () { + + clearTimeout(timeoutId); + }, + + after = function () { + + clearTimeout(timeoutId); + timeoutId = setTimeout(heartbeat, settings.interval); }, init = function () { @@ -20,10 +32,10 @@ modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'co settings.interval = Math.max(1000, settings.interval); - event.sub('ready', function () { - - setTimeout(heartbeat, settings.interval); - }); + event.sub('location.beforeChange', before); + event.sub('location.beforeRefresh', before); + event.sub('location.changed', after); + event.sub('location.refreshed', after); }; init(); diff --git a/src/_h5ai/client/js/inc/ext/crumb.js b/src/_h5ai/client/js/inc/ext/crumb.js index da128980..028a799b 100644 --- a/src/_h5ai/client/js/inc/ext/crumb.js +++ b/src/_h5ai/client/js/inc/ext/crumb.js @@ -1,5 +1,5 @@ -modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/entry'], function (_, $, allsettings, resource, event, entry) { +modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/location'], function (_, $, allsettings, resource, event, location) { var settings = _.extend({ enabled: false @@ -14,80 +14,86 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/ pageHintTemplate = 'has index page', statusHintTemplate = '', - // updates the crumb for this single entry - update = function (entry, force) { + update = function (item, force) { - if (!force && entry.$crumb && entry.$crumb.data('status') === entry.status) { - return entry.$crumb; + if (!force && item.$crumb) { + return item.$crumb; } var $html = $(template), $a = $html.find('a'); $html - .addClass(entry.isFolder() ? 'folder' : 'file') - .data('status', entry.status); + .addClass(item.isFolder() ? 'folder' : 'file') + .data('item', item); - $a - .attr('href', entry.absHref) - .find('span').text(entry.label).end(); + location.setLink($a, item); + $a.find('span').text(item.label).end(); - if (entry.isDomain()) { + if (item.isDomain()) { $html.addClass('domain'); $a.find('img').attr('src', resource.image('home')); } - if (entry.isRoot()) { + if (item.isRoot()) { $html.addClass('root'); $a.find('img').attr('src', resource.image('home')); } - if (entry.isCurrentFolder()) { + if (item.isCurrentFolder()) { $html.addClass('current'); } - if (_.isNumber(entry.status)) { - if (entry.status === 200) { + if (_.isNumber(item.status)) { + if (item.status === 200) { $a.append($(pageHintTemplate)); } else { - $a.append($(statusHintTemplate).text('(' + entry.status + ')')); + $a.append($(statusHintTemplate).text('(' + item.status + ')')); } } - if (entry.$crumb) { - entry.$crumb.replaceWith($html); + if (item.$crumb) { + item.$crumb.replaceWith($html); } - entry.$crumb = $html; + item.$crumb = $html; return $html; }, - onContentChanged = function (entry) { + onLocationChanged = function (item) { - if (entry.$crumb) { - update(entry, true); + var crumb = item.getCrumb(), + $ul = $('#navbar'), + found = false; + + $ul.find('.crumb').each(function () { + + var $html = $(this); + if ($html.data('item') === item) { + found = true; + $html.addClass('current'); + } else { + $html.removeClass('current'); + } + }); + + if (!found) { + $ul.find('.crumb').remove(); + _.each(crumb, function (e) { + + $ul.append(update(e, true)); + }); } }, - // creates the complete crumb from entry down to the root - init = function (entry) { + init = function () { if (!settings.enabled) { return; } - var crumb = entry.getCrumb(), - $ul = $('#navbar'); - - _.each(crumb, function (e) { - - $ul.append(update(e)); - }); - - // event.sub('entry.created', onContentChanged); - // event.sub('entry.removed', onContentChanged); - event.sub('entry.changed', onContentChanged); + event.sub('location.changed', onLocationChanged); }; - init(entry); + init(); }); diff --git a/src/_h5ai/client/js/inc/ext/custom.js b/src/_h5ai/client/js/inc/ext/custom.js index 5da2495b..e2cc27a2 100644 --- a/src/_h5ai/client/js/inc/ext/custom.js +++ b/src/_h5ai/client/js/inc/ext/custom.js @@ -1,29 +1,44 @@ -modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/server'], function (_, $, allsettings, server) { +modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/server', 'core/event'], function (_, $, allsettings, server, event) { var settings = _.extend({ - enabled: false, - header: '_h5ai.header.html', - footer: '_h5ai.footer.html' + enabled: false }, allsettings.custom), + onLocationChanged = function () { + + server.request({action: 'get', custom: true}, function (response) { + + var h, f; + if (response) { + if (response.custom.header) { + $('#content-header').html(response.custom.header).stop().slideDown(200); + h = true; + } + if (response.custom.footer) { + $('#content-footer').html(response.custom.footer).stop().slideDown(200); + f = true; + } + } + if (!h) { + $('#content-header').stop().slideUp(200); + } + if (!f) { + $('#content-footer').stop().slideUp(200); + } + }); + }, + init = function () { if (!settings.enabled) { return; } - server.request({action: 'get', custom: true}, function (response) { + $('
').hide().prependTo('#content'); + $('