diff --git a/makefile.js b/makefile.js index 49040689..34a0c968 100644 --- a/makefile.js +++ b/makefile.js @@ -4,163 +4,163 @@ module.exports = function (make) { - var path = require('path'), + var path = require('path'), - pkg = require('./package.json'), + pkg = require('./package.json'), - root = path.resolve(__dirname), - src = path.join(root, 'src'), - build = path.join(root, 'build'), + root = path.resolve(__dirname), + src = path.join(root, 'src'), + build = path.join(root, 'build'), - $ = make.fQuery, - mapSrc = $.map.p(src, build).s('.less', '.css').s('.jade', ''), - mapRoot = $.map.p(root, path.join(build, '_h5ai')); + $ = make.fQuery, + mapSrc = $.map.p(src, build).s('.less', '.css').s('.jade', ''), + mapRoot = $.map.p(root, path.join(build, '_h5ai')); - make.version('>=0.10.0'); - make.defaults('build'); + make.version('>=0.10.0'); + make.defaults('build'); - make.before(function () { + make.before(function () { - var moment = make.moment(); + var moment = make.moment(); - make.env = { - pkg: pkg, - stamp: moment.format('YYYY-MM-DD HH:mm:ss') - }; + make.env = { + pkg: pkg, + stamp: moment.format('YYYY-MM-DD HH:mm:ss') + }; - $.info({ method: 'before', message: pkg.version + ' ' + make.env.stamp }); - }); + $.info({ method: 'before', message: pkg.version + ' ' + make.env.stamp }); + }); - make.target('check-version', [], 'add git info to dev builds').async(function (done, fail) { + make.target('check-version', [], 'add git info to dev builds').async(function (done, fail) { - if (!pkg.develop) { - done(); - return; - } + if (!pkg.develop) { + done(); + return; + } - $.git(root, function (err, result) { + $.git(root, function (err, result) { - pkg.version += '+' + result.buildSuffix; - $.info({ method: 'check-version', message: 'version set to ' + pkg.version }); - done(); - }); - }); + pkg.version += '+' + result.buildSuffix; + $.info({ method: 'check-version', message: 'version set to ' + pkg.version }); + done(); + }); + }); - make.target('clean', [], 'delete build folder').sync(function () { + make.target('clean', [], 'delete build folder').sync(function () { - $.DELETE(build); - }); + $.DELETE(build); + }); - make.target('lint', [], 'lint all JavaScript files with JSHint').sync(function () { + make.target('lint', [], 'lint all JavaScript files with JSHint').sync(function () { - var jshint = { - // Enforcing Options - bitwise: true, - curly: true, - eqeqeq: true, - forin: true, - latedef: true, - newcap: true, - noempty: true, - plusplus: true, - trailing: true, - undef: true, + var jshint = { + // Enforcing Options + bitwise: true, + curly: true, + eqeqeq: true, + forin: true, + latedef: true, + newcap: true, + noempty: true, + plusplus: true, + trailing: true, + undef: true, - // Environments - browser: true - }, - globals = { - 'modulejs': true - }; + // Environments + browser: true + }, + globals = { + 'modulejs': true + }; - $(src + '/_h5ai/client/js: **/*.js, ! lib/**') - .jshint(jshint, globals); - }); + $(src + '/_h5ai/client/js: **/*.js, ! lib/**') + .jshint(jshint, globals); + }); - make.target('build', ['check-version'], 'build all updated files').sync(function () { + make.target('build', ['check-version'], 'build all updated files').sync(function () { - var header = '/* ' + pkg.name + ' ' + pkg.version + ' - ' + pkg.url + ' */'; + var header = '/* ' + pkg.name + ' ' + pkg.version + ' - ' + pkg.url + ' */'; - $(src + ': _h5ai/client/js/*.js') - .newerThan(mapSrc, $(src + ': _h5ai/client/js/**')) - .includify() - .uglifyjs({header: header}) - .WRITE(mapSrc); + $(src + ': _h5ai/client/js/*.js') + .newerThan(mapSrc, $(src + ': _h5ai/client/js/**')) + .includify() + .uglifyjs({header: header}) + .WRITE(mapSrc); - $(src + ': _h5ai/client/css/*.less') - .newerThan(mapSrc, $(src + ': _h5ai/client/css/**')) - .less() - .cssmin({header: header}) - .WRITE(mapSrc); + $(src + ': _h5ai/client/css/*.less') + .newerThan(mapSrc, $(src + ': _h5ai/client/css/**')) + .less() + .cssmin({header: header}) + .WRITE(mapSrc); - $(src + ': **/*.jade') - .newerThan(mapSrc) - .handlebars(make.env) - .jade() - .WRITE(mapSrc); + $(src + ': **/*.jade') + .newerThan(mapSrc) + .handlebars(make.env) + .jade() + .WRITE(mapSrc); - $(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade') - .newerThan(mapSrc) - .handlebars(make.env) - .WRITE(mapSrc); + $(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade') + .newerThan(mapSrc) + .handlebars(make.env) + .WRITE(mapSrc); - $(src + ': _h5ai/client/css/fonts/**') - .newerThan(mapSrc) - .WRITE(mapSrc); + $(src + ': _h5ai/client/css/fonts/**') + .newerThan(mapSrc) + .WRITE(mapSrc); - $(root + ': *.md') - .newerThan(mapRoot) - .WRITE(mapRoot); - }); + $(root + ': *.md') + .newerThan(mapRoot) + .WRITE(mapRoot); + }); - make.target('build-uncompressed', ['check-version'], 'build all updated files without compression').sync(function () { + make.target('build-uncompressed', ['check-version'], 'build all updated files without compression').sync(function () { - $(src + ': _h5ai/client/js/*.js') - .newerThan(mapSrc, $(src + ': _h5ai/client/js/**')) - .includify() - // .uglifyjs() - .WRITE(mapSrc); + $(src + ': _h5ai/client/js/*.js') + .newerThan(mapSrc, $(src + ': _h5ai/client/js/**')) + .includify() + // .uglifyjs() + .WRITE(mapSrc); - $(src + ': _h5ai/client/css/*.less') - .newerThan(mapSrc, $(src + ': _h5ai/client/css/**')) - .less() - // .cssmin() - .WRITE(mapSrc); + $(src + ': _h5ai/client/css/*.less') + .newerThan(mapSrc, $(src + ': _h5ai/client/css/**')) + .less() + // .cssmin() + .WRITE(mapSrc); - $(src + ': **/*.jade') - .newerThan(mapSrc) - .handlebars(make.env) - .jade() - .WRITE(mapSrc); + $(src + ': **/*.jade') + .newerThan(mapSrc) + .handlebars(make.env) + .jade() + .WRITE(mapSrc); - $(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade') - .newerThan(mapSrc) - .handlebars(make.env) - .WRITE(mapSrc); + $(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade') + .newerThan(mapSrc) + .handlebars(make.env) + .WRITE(mapSrc); - $(src + ': _h5ai/client/css/fonts/**') - .newerThan(mapSrc) - .WRITE(mapSrc); + $(src + ': _h5ai/client/css/fonts/**') + .newerThan(mapSrc) + .WRITE(mapSrc); - $(root + ': *.md') - .newerThan(mapRoot) - .WRITE(mapRoot); - }); + $(root + ': *.md') + .newerThan(mapRoot) + .WRITE(mapRoot); + }); - make.target('release', ['clean', 'build'], 'create a zipball').async(function (done, fail) { + make.target('release', ['clean', 'build'], 'create a zipball').async(function (done, fail) { - $(build + ': **').shzip({ - target: path.join(build, pkg.name + '-' + pkg.version + '.zip'), - dir: build, - callback: done - }); - }); + $(build + ': **').shzip({ + target: path.join(build, pkg.name + '-' + pkg.version + '.zip'), + dir: build, + callback: done + }); + }); }; diff --git a/src/_h5ai/.htaccess b/src/_h5ai/.htaccess index d9ff56e5..d76324e7 100644 --- a/src/_h5ai/.htaccess +++ b/src/_h5ai/.htaccess @@ -68,31 +68,31 @@ AddDefaultCharset utf-8 ExpiresActive on ExpiresDefault "access plus 1 month" - # CSS + # CSS ExpiresByType text/css "access plus 1 week" - # Data interchange + # 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!) + # Favicon (cannot be renamed!) ExpiresByType image/x-icon "access plus 1 week" - # HTML components (HTCs) + # HTML components (HTCs) ExpiresByType text/x-component "access plus 1 month" - # HTML + # HTML ExpiresByType text/html "access plus 0 seconds" - # JavaScript + # JavaScript ExpiresByType application/javascript "access plus 1 week" - # Manifest files + # Manifest files ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" ExpiresByType text/cache-manifest "access plus 0 seconds" - # Media + # Media ExpiresByType audio/ogg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" @@ -101,11 +101,11 @@ AddDefaultCharset utf-8 ExpiresByType video/ogg "access plus 1 month" ExpiresByType video/webm "access plus 1 month" - # Web feeds + # Web feeds ExpiresByType application/atom+xml "access plus 1 hour" ExpiresByType application/rss+xml "access plus 1 hour" - # Web fonts + # 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" diff --git a/src/_h5ai/client/css/fonts/README.txt b/src/_h5ai/client/css/fonts/README.txt index 292d4ade..1ee00a60 100644 --- a/src/_h5ai/client/css/fonts/README.txt +++ b/src/_h5ai/client/css/fonts/README.txt @@ -1,6 +1,6 @@ - ---------------------- - Ubuntu Font Family - ====================== +---------------------- +Ubuntu Font Family +====================== The Ubuntu Font Family are a set of matching new libre/open fonts in development during 2010--2011. The development is being funded by @@ -12,4 +12,4 @@ Both the final font Truetype/OpenType files and the design files used to produce the font family are distributed under an open licence and you are expressly encouraged to experiment, modify, share and improve. - http://font.ubuntu.com/ +http://font.ubuntu.com/ diff --git a/src/_h5ai/client/css/inc/bottombar.less b/src/_h5ai/client/css/inc/bottombar.less index 53ca8340..a1c46b3f 100644 --- a/src/_h5ai/client/css/inc/bottombar.less +++ b/src/_h5ai/client/css/inc/bottombar.less @@ -1,73 +1,73 @@ #bottombar { - position: fixed; - z-index: 5; - width: 100%; - height: 18px; - left: 0; - bottom: 0; - padding: 6px 0 8px 0; - background-color: @col-widget-back; - border-top: @border-widget; + position: fixed; + z-index: 5; + width: 100%; + height: 18px; + left: 0; + bottom: 0; + padding: 6px 0 8px 0; + background-color: @col-widget-back; + border-top: @border-widget; - color: #999; - text-align: center; + color: #999; + text-align: center; - a, a:active, a:visited { - color: #555; - text-decoration: none; - .transition(all 0.2s ease-in-out); - opacity: 0.7; + a, a:active, a:visited { + color: #555; + text-decoration: none; + .transition(all 0.2s ease-in-out); + opacity: 0.7; - &:hover { - color: @col-hover; - opacity: 1; - } - } - .left { - position: absolute; - left: 0; - display: block; - padding: 0 8px; - } - .center { - display: block; - } - .right { - position: absolute; - right: 0; - display: block; - padding: 0 8px; - } - .noJsMsg { - color: @col-error; - margin-left: 16px; - } - .noBrowserMsg { - color: @col-error; - margin-left: 16px; - a, a:active, a:visited { - color: @col-error; - text-decoration: underline; - opacity: 1; - &:hover { - color: @col-hover; - } - } - } - .status { - .sep { - display: inline-block; - padding: 0 6px; + &:hover { + color: @col-hover; + opacity: 1; + } + } + .left { + position: absolute; + left: 0; + display: block; + padding: 0 8px; + } + .center { + display: block; + } + .right { + position: absolute; + right: 0; + display: block; + padding: 0 8px; + } + .noJsMsg { + color: @col-error; + margin-left: 16px; + } + .noBrowserMsg { + color: @col-error; + margin-left: 16px; + a, a:active, a:visited { + color: @col-error; + text-decoration: underline; + opacity: 1; + &:hover { + color: @col-hover; + } + } + } + .status { + .sep { + display: inline-block; + padding: 0 6px; - &:before { - content: '·' - } - } - &.default { - } - &.dynamic { - display: none; - } - } + &:before { + content: '·' + } + } + &.default { + } + &.dynamic { + display: none; + } + } } diff --git a/src/_h5ai/client/css/inc/content.less b/src/_h5ai/client/css/inc/content.less index 75abee3a..0446ab08 100644 --- a/src/_h5ai/client/css/inc/content.less +++ b/src/_h5ai/client/css/inc/content.less @@ -1,34 +1,34 @@ #content { - max-width: 960px; - margin: 50px auto; - font-size: 15px; + max-width: 960px; + margin: 50px auto; + font-size: 15px; } #content-header, #content-footer { - color: #333; + color: #333; - a, a:active, a:visited { - color: @col-link; - text-decoration: none; - cursor: pointer; + a, a:active, a:visited { + color: @col-link; + text-decoration: none; + cursor: pointer; - &:hover { - color: #555; - } - } + &:hover { + color: #555; + } + } - pre, code { - font-family: @font-family-mono; - } + pre, code { + font-family: @font-family-mono; + } } #content-header { - padding-bottom: 12px; - margin-bottom: 32px; + padding-bottom: 12px; + margin-bottom: 32px; } #content-footer { - padding-top: 12px; - margin-top: 32px; + padding-top: 12px; + margin-top: 32px; } diff --git a/src/_h5ai/client/css/inc/context-menu.less b/src/_h5ai/client/css/inc/context-menu.less index 3135941b..4b9d33e3 100644 --- a/src/_h5ai/client/css/inc/context-menu.less +++ b/src/_h5ai/client/css/inc/context-menu.less @@ -1,32 +1,32 @@ #view .context-menu { - display: block; - position: absolute; - right: 0; - top: 0; - background-color: @col-widget-back; - border: @border-widget; - color: #999; - z-index: 10; - font-size: 0.9em; + display: block; + position: absolute; + right: 0; + top: 0; + background-color: @col-widget-back; + border: @border-widget; + color: #999; + z-index: 10; + font-size: 0.9em; - ul { - margin: 0; - padding: 0; - list-style: none; - text-align: left; + ul { + margin: 0; + padding: 0; + list-style: none; + text-align: left; - li { - padding: 8px 12px 10px 12px; - white-space: nowrap; - border-top: @border-widget-sep; - .transition(all 0.2s ease-in-out); + li { + padding: 8px 12px 10px 12px; + white-space: nowrap; + border-top: @border-widget-sep; + .transition(all 0.2s ease-in-out); - &:hover { - color: @col-hover; - background-color: @col-widget-back-hover; - } - } - } + &:hover { + color: @col-hover; + background-color: @col-widget-back-hover; + } + } + } } diff --git a/src/_h5ai/client/css/inc/download.less b/src/_h5ai/client/css/inc/download.less index 502b70bf..59b6f576 100644 --- a/src/_h5ai/client/css/inc/download.less +++ b/src/_h5ai/client/css/inc/download.less @@ -1,10 +1,10 @@ #download { - display: none; - .topbar-right; - .transition(all 0.2s ease-in-out); + display: none; + .topbar-right; + .transition(all 0.2s ease-in-out); - &.failed { - background-color: rgba(255,0,0,0.5); - } + &.failed { + background-color: rgba(255,0,0,0.5); + } } diff --git a/src/_h5ai/client/css/inc/fallback.less b/src/_h5ai/client/css/inc/fallback.less index bb6f4e29..b75bb6ae 100644 --- a/src/_h5ai/client/css/inc/fallback.less +++ b/src/_h5ai/client/css/inc/fallback.less @@ -1,71 +1,71 @@ #fallback { - display: none; - max-width: 960px; - margin: 80px auto; + display: none; + max-width: 960px; + margin: 80px auto; - table { - display: block; - width: 100%; - border-collapse: collapse; + table { + display: block; + width: 100%; + border-collapse: collapse; - th, td { - padding: 6px; - text-align: left; - border: none; - } - th { - padding-bottom: 18px; - color: #555; - font-weight: normal; - opacity: 0.4; - } - td { - border-bottom: 1px solid @col-border; - overflow: hidden; - white-space: nowrap; - font-size: 15px; + th, td { + padding: 6px; + text-align: left; + border: none; + } + th { + padding-bottom: 18px; + color: #555; + font-weight: normal; + opacity: 0.4; + } + td { + border-bottom: 1px solid @col-border; + overflow: hidden; + white-space: nowrap; + font-size: 15px; - a, a:active, a:visited { - display: block; - color: #555; - text-decoration: none; - cursor: pointer; + a, a:active, a:visited { + display: block; + color: #555; + text-decoration: none; + cursor: pointer; - &:hover { - color: @col-hover; - } - } - } - .fb-i { - width: 24px; + &:hover { + color: @col-hover; + } + } + } + .fb-i { + width: 24px; - img { - width: 24px; - height: 24px; - } - } - .fb-n { - width: 682px; - max-width: 682px; - } - .fb-d { - text-align: right; - width: 160px; - min-width: 160px; - } - .fb-s { - text-align: right; - width: 70px; - min-width: 70px; - } - } + img { + width: 24px; + height: 24px; + } + } + .fb-n { + width: 682px; + max-width: 682px; + } + .fb-d { + text-align: right; + width: 160px; + min-width: 160px; + } + .fb-s { + text-align: right; + width: 70px; + min-width: 70px; + } + } } html.no-js, html.no-browser { - #fallback { - display: block; - } + #fallback { + display: block; + } } diff --git a/src/_h5ai/client/css/inc/filter.less b/src/_h5ai/client/css/inc/filter.less index ebc23619..9909d2e8 100644 --- a/src/_h5ai/client/css/inc/filter.less +++ b/src/_h5ai/client/css/inc/filter.less @@ -1,19 +1,19 @@ #filter { - .topbar-right; + .topbar-right; - input { - border: none; - font-family: @font-family; - color: @col; - background-color: rgba(0,0,0,0); - width: 30px; - outline: none; - } + input { + border: none; + font-family: @font-family; + color: @col; + background-color: rgba(0,0,0,0); + width: 30px; + outline: none; + } - &.current { - input { - width: 150px; - } - } + &.current { + input { + width: 150px; + } + } } diff --git a/src/_h5ai/client/css/inc/fonts.less b/src/_h5ai/client/css/inc/fonts.less index 737e3cb0..d0fa84f5 100644 --- a/src/_h5ai/client/css/inc/fonts.less +++ b/src/_h5ai/client/css/inc/fonts.less @@ -1,56 +1,56 @@ @font-face { - font-family: 'Ubuntu'; - font-style: normal; - font-weight: 300; - src: local('Ubuntu Light'), local('Ubuntu-Light'), url(fonts/Ubuntu-L.woff) format('woff'); + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 300; + src: local('Ubuntu Light'), local('Ubuntu-Light'), url(fonts/Ubuntu-L.woff) format('woff'); } @font-face { - font-family: 'Ubuntu'; - font-style: normal; - font-weight: 700; - src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url(fonts/Ubuntu-B.woff) format('woff'); + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 700; + src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url(fonts/Ubuntu-B.woff) format('woff'); } @font-face { - font-family: 'Ubuntu'; - font-style: italic; - font-weight: 300; - src: local('Ubuntu Light Italic'), local('Ubuntu-LightItalic'), url(fonts/Ubuntu-LI.woff) format('woff'); + font-family: 'Ubuntu'; + font-style: italic; + font-weight: 300; + src: local('Ubuntu Light Italic'), local('Ubuntu-LightItalic'), url(fonts/Ubuntu-LI.woff) format('woff'); } @font-face { - font-family: 'Ubuntu'; - font-style: italic; - font-weight: 700; - src: local('Ubuntu Bold Italic'), local('Ubuntu-BoldItalic'), url(fonts/Ubuntu-BI.woff) format('woff'); + font-family: 'Ubuntu'; + font-style: italic; + font-weight: 700; + src: local('Ubuntu Bold Italic'), local('Ubuntu-BoldItalic'), url(fonts/Ubuntu-BI.woff) format('woff'); } @font-face { - font-family: 'Ubuntu Mono'; - font-style: normal; - font-weight: 400; - src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(fonts/UbuntuMono-R.woff) format('woff'); + font-family: 'Ubuntu Mono'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(fonts/UbuntuMono-R.woff) format('woff'); } @font-face { - font-family: 'Ubuntu Mono'; - font-style: normal; - font-weight: 700; - src: local('Ubuntu Mono Bold'), local('UbuntuMono-Bold'), url(fonts/UbuntuMono-B.woff) format('woff'); + font-family: 'Ubuntu Mono'; + font-style: normal; + font-weight: 700; + src: local('Ubuntu Mono Bold'), local('UbuntuMono-Bold'), url(fonts/UbuntuMono-B.woff) format('woff'); } @font-face { - font-family: 'Ubuntu Mono'; - font-style: italic; - font-weight: 400; - src: local('Ubuntu Mono Italic'), local('UbuntuMono-Italic'), url(fonts/UbuntuMono-RI.woff) format('woff'); + font-family: 'Ubuntu Mono'; + font-style: italic; + font-weight: 400; + src: local('Ubuntu Mono Italic'), local('UbuntuMono-Italic'), url(fonts/UbuntuMono-RI.woff) format('woff'); } @font-face { - font-family: 'Ubuntu Mono'; - font-style: italic; - font-weight: 700; - src: local('Ubuntu Mono Bold Italic'), local('UbuntuMono-BoldItalic'), url(fonts/Ubuntu-BI.woff) format('woff'); + font-family: 'Ubuntu Mono'; + font-style: italic; + font-weight: 700; + src: local('Ubuntu Mono Bold Italic'), local('UbuntuMono-BoldItalic'), url(fonts/Ubuntu-BI.woff) format('woff'); } diff --git a/src/_h5ai/client/css/inc/general.less b/src/_h5ai/client/css/inc/general.less index 00a4e0a4..a96cb995 100644 --- a/src/_h5ai/client/css/inc/general.less +++ b/src/_h5ai/client/css/inc/general.less @@ -36,35 +36,35 @@ ::selection { background: #68A9FF; color: #fff; text-shadow: none; } .transition (@transition) { - -webkit-transition: @transition; - transition: @transition; + -webkit-transition: @transition; + transition: @transition; } .transform (@transform) { - -webkit-transform: @transform; - -ms-transform: @transform; - transform: @transform; - zoom: 1; + -webkit-transform: @transform; + -ms-transform: @transform; + transform: @transform; + zoom: 1; } html { - min-height: 100%; - overflow: auto; - overflow-y: scroll; + min-height: 100%; + overflow: auto; + overflow-y: scroll; - &.js .noJsMsg { - display: none; - } - &.browser .noBrowserMsg { - display: none; - } + &.js .noJsMsg { + display: none; + } + &.browser .noBrowserMsg { + display: none; + } } body { - font-family: @font-family; - font-size: 13px; - font-weight: @font-weight; - color: @col; - background-color: @col-back; - margin: 30px; + font-family: @font-family; + font-size: 13px; + font-weight: @font-weight; + color: @col; + background-color: @col-back; + margin: 30px; } diff --git a/src/_h5ai/client/css/inc/h5ai-info.less b/src/_h5ai/client/css/inc/h5ai-info.less index 8ea650da..496d2121 100644 --- a/src/_h5ai/client/css/inc/h5ai-info.less +++ b/src/_h5ai/client/css/inc/h5ai-info.less @@ -1,147 +1,147 @@ body#h5ai-info { - font-family: @font-family; - margin: 2em auto 4em auto; - font-size: 20px; - color: @col; - max-width: 600px; - text-align: center; + font-family: @font-family; + margin: 2em auto 4em auto; + font-size: 20px; + 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); + a, a:active, a:visited { + color: @col; + text-decoration: none; + .transition(all 0.2s ease-in-out); - &:hover { - color: @col-hover; - } - } - code { - margin: 0 0.2em; - 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; - } - h2 { - font-size: 1.15em; - margin: 2.6em 0 0 0; - } + &:hover { + color: @col-hover; + } + } + code { + margin: 0 0.2em; + 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; + } + h2 { + font-size: 1.15em; + margin: 2.6em 0 0 0; + } - #support { - margin: 12px auto 24px auto; - padding: 6px 18px; - width: 164px; - font-size: 12px; - background: @col-widget-back; - border: @border-widget; - border-radius: 4px; + #support { + margin: 12px auto 24px auto; + padding: 6px 18px; + width: 164px; + font-size: 12px; + background: @col-widget-back; + border: @border-widget; + border-radius: 4px; - .paypal { - margin: 6px 0 0 0; - } - } + .paypal { + margin: 6px 0 0 0; + } + } - #login-wrapper { - font-size: 14px; - } + #login-wrapper { + font-size: 14px; + } - #pass { - -moz-appearance: none; - -ms-appearance: none; - -webkit-appearance: none; - font-family: @font-family; - font-weight: @font-weight; - color: @col; - background: @col-widget-back-highlight; - border: @border-widget; - outline: none; - display: inline-block; - width: 200px; - height: 27px; - padding: 0 6px; - margin: 8px; - } + #pass { + -moz-appearance: none; + -ms-appearance: none; + -webkit-appearance: none; + font-family: @font-family; + font-weight: @font-weight; + color: @col; + background: @col-widget-back-highlight; + border: @border-widget; + outline: none; + display: inline-block; + width: 200px; + height: 27px; + padding: 0 6px; + margin: 8px; + } - #login, #logout { - display: inline-block; - padding: 4px 16px; - margin: 8px; - background-color: @col-widget-back; - border: @border-widget; - cursor: pointer; + #login, #logout { + display: inline-block; + padding: 4px 16px; + margin: 8px; + background-color: @col-widget-back; + border: @border-widget; + cursor: pointer; - color: @col; - cursor: pointer; - text-decoration: none; - .transition(all 0.2s ease-in-out); + color: @col; + cursor: pointer; + text-decoration: none; + .transition(all 0.2s ease-in-out); - &:hover, &.hover { - background-color: @col-widget-back-highlight; - color: @col-hover; - } - } + &:hover, &.hover { + background-color: @col-widget-back-highlight; + color: @col-hover; + } + } - #hint { - margin: 12px auto; - width: 360px; - color: @col; - font-size: 12px; - } + #hint { + margin: 12px auto; + width: 360px; + color: @col; + font-size: 12px; + } - #tests-wrapper { - margin: 96px 0; - } + #tests-wrapper { + margin: 96px 0; + } - #tests { - display: inline-block; - list-style-type: none; - text-align: left; - margin: 0; - padding: 0; + #tests { + display: inline-block; + list-style-type: none; + text-align: left; + margin: 0; + padding: 0; - .test { - margin: 12px 0 0 0; - padding: 6px; + .test { + margin: 12px 0 0 0; + padding: 6px; - .label { - display: inline-block; - width: 250px; - } - .result { - display: inline-block; - width: 250px; - text-align: right; - font-weight: bold; + .label { + display: inline-block; + width: 250px; + } + .result { + display: inline-block; + width: 250px; + text-align: right; + font-weight: bold; - &.passed { - color: #5a5; - } - &.failed { - color: #a55; - } - } - .info { - margin: 4px 0 12px 12px; - font-size: 0.7em; - color: #aaa; - width: 460px; - line-height: 1.2em; - } - } - } + &.passed { + color: #5a5; + } + &.failed { + color: #a55; + } + } + .info { + margin: 4px 0 12px 12px; + font-size: 0.7em; + color: #aaa; + width: 460px; + line-height: 1.2em; + } + } + } - #bottombar { - font-size: 13px; - } + #bottombar { + font-size: 13px; + } } diff --git a/src/_h5ai/client/css/inc/notify.less b/src/_h5ai/client/css/inc/notify.less index 8c1b7867..9416e156 100644 --- a/src/_h5ai/client/css/inc/notify.less +++ b/src/_h5ai/client/css/inc/notify.less @@ -1,14 +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; + 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-aud.less b/src/_h5ai/client/css/inc/preview-aud.less index 223c2c62..fb6478c6 100644 --- a/src/_h5ai/client/css/inc/preview-aud.less +++ b/src/_h5ai/client/css/inc/preview-aud.less @@ -1,9 +1,9 @@ #pv-aud-audio { - position: absolute; + position: absolute; - max-width: 100%; - max-height: 100%; + max-width: 100%; + max-height: 100%; - box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); } diff --git a/src/_h5ai/client/css/inc/preview-img.less b/src/_h5ai/client/css/inc/preview-img.less index 4a1fe130..f104c786 100644 --- a/src/_h5ai/client/css/inc/preview-img.less +++ b/src/_h5ai/client/css/inc/preview-img.less @@ -2,17 +2,17 @@ @check-white: #f8f8f8; @check-black: #e8e8e8; #pv-img-image { - position: absolute; + position: absolute; - max-width: 100%; - max-height: 100%; + max-width: 100%; + max-height: 100%; - background-color: @check-white; - background-image: - -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black), - -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black); - background-size: 60px 60px; - background-position: 0 0, 30px 30px; + background-color: @check-white; + background-image: + -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black), + -webkit-linear-gradient(45deg, @check-black 25%, transparent 25%, transparent 75%, @check-black 75%, @check-black); + background-size: 60px 60px; + background-position: 0 0, 30px 30px; - box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); } diff --git a/src/_h5ai/client/css/inc/preview-txt.less b/src/_h5ai/client/css/inc/preview-txt.less index fc384ade..07ef0853 100644 --- a/src/_h5ai/client/css/inc/preview-txt.less +++ b/src/_h5ai/client/css/inc/preview-txt.less @@ -1,174 +1,174 @@ #pv-txt-text { - max-width: 960px; - text-align: left; - background-color: #fff; - margin: 0 auto; - padding: 8px; - overflow: auto; + max-width: 960px; + text-align: left; + background-color: #fff; + margin: 0 auto; + padding: 8px; + overflow: auto; - box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); - &.highlighted { - // word-break: break-all; + &.highlighted { + // word-break: break-all; - code { - font-family: @font-family-mono; - font-size: 16px; - line-height: 1.2em; - } + code { + font-family: @font-family-mono; + font-size: 16px; + line-height: 1.2em; + } - a, a:active, a:visited { - color: #2080FF; - text-decoration: none; - cursor: pointer; + a, a:active, a:visited { + color: #2080FF; + text-decoration: none; + cursor: pointer; - &:hover { - color: #68A9FF; - } - } + &:hover { + color: #68A9FF; + } + } - .token.comment, - .token.prolog, - .token.doctype, - .token.cdata { - color: #aaa; - } + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #aaa; + } - .token.punctuation { - color: #999; - } + .token.punctuation { + color: #999; + } - .namespace { - opacity: .7; - } + .namespace { + opacity: .7; + } - .token.property, - .token.tag, - .token.boolean, - .token.number, - .token.constant, - .token.symbol { - color: #905; - } + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.constant, + .token.symbol { + color: #905; + } - .token.selector, - .token.attr-name, - .token.string, - .token.builtin { - color: #690; - } + .token.selector, + .token.attr-name, + .token.string, + .token.builtin { + color: #690; + } - .token.operator, - .token.entity, - .token.url, - .language-css .token.string, - .style .token.string, - .token.variable { - color: #a67f59; - background: hsla(0,0%,100%,.5); - } + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: #a67f59; + background: hsla(0,0%,100%,.5); + } - .token.atrule, - .token.attr-value, - .token.keyword { - color: #07a; - } + .token.atrule, + .token.attr-value, + .token.keyword { + color: #07a; + } - .token.function { - color: #DD4A68; - } + .token.function { + color: #DD4A68; + } - .token.regex, - .token.important { - color: #e90; - } + .token.regex, + .token.important { + color: #e90; + } - .token.important { - font-weight: bold; - } + .token.important { + font-weight: bold; + } - .token.entity { - cursor: help; - } + .token.entity { + cursor: help; + } - // pre.line-numbers { - // position: relative; - // padding-left: 3.8em; - // counter-reset: linenumber; - // } - // pre.line-numbers > code { - // position: relative; - // } - // .line-numbers .line-numbers-rows { - // position: absolute; - // pointer-events: none; - // top: 0; - // font-size: 100%; - // left: -3.8em; - // width: 3em; /* works for line-numbers below 1000 lines */ - // letter-spacing: -1px; - // border-right: 1px solid #999; + // pre.line-numbers { + // position: relative; + // padding-left: 3.8em; + // counter-reset: linenumber; + // } + // pre.line-numbers > code { + // position: relative; + // } + // .line-numbers .line-numbers-rows { + // position: absolute; + // pointer-events: none; + // top: 0; + // font-size: 100%; + // left: -3.8em; + // width: 3em; /* works for line-numbers below 1000 lines */ + // letter-spacing: -1px; + // border-right: 1px solid #999; - // -webkit-user-select: none; - // -moz-user-select: none; - // -ms-user-select: none; - // user-select: none; + // -webkit-user-select: none; + // -moz-user-select: none; + // -ms-user-select: none; + // user-select: none; - // } - // .line-numbers-rows > span { - // pointer-events: none; - // display: block; - // counter-increment: linenumber; - // } - // .line-numbers-rows > span:before { - // content: counter(linenumber); - // color: #999; - // display: block; - // padding-right: 0.8em; - // text-align: right; - // } + // } + // .line-numbers-rows > span { + // pointer-events: none; + // display: block; + // counter-increment: linenumber; + // } + // .line-numbers-rows > span:before { + // content: counter(linenumber); + // color: #999; + // display: block; + // padding-right: 0.8em; + // text-align: right; + // } - // .token.tab:not(:empty):before, - // .token.cr:before, - // .token.lf:before { - // color: hsl(24, 20%, 85%); - // } - // .token.tab:not(:empty):before { - // content: '▸'; - // } - // .token.cr:before { - // content: '␍'; - // } - // .token.lf:before { - // // content: '␊'; - // content: '¶'; - // } - // .token a { - // color: inherit; - // } - } + // .token.tab:not(:empty):before, + // .token.cr:before, + // .token.lf:before { + // color: hsl(24, 20%, 85%); + // } + // .token.tab:not(:empty):before { + // content: '▸'; + // } + // .token.cr:before { + // content: '␍'; + // } + // .token.lf:before { + // // content: '␊'; + // content: '¶'; + // } + // .token a { + // color: inherit; + // } + } - &.markdown { - font-size: 16px; - padding: 8px 24px; + &.markdown { + font-size: 16px; + padding: 8px 24px; - a, a:active, a:visited { - color: #2080FF; - text-decoration: none; - cursor: pointer; + a, a:active, a:visited { + color: #2080FF; + text-decoration: none; + cursor: pointer; - &:hover { - color: #68A9FF; - } - } + &:hover { + color: #68A9FF; + } + } - pre, code { - font-family: @font-family-mono; - } - code { - color: #008200; - } - } + pre, code { + font-family: @font-family-mono; + } + code { + color: #008200; + } + } } diff --git a/src/_h5ai/client/css/inc/preview-vid.less b/src/_h5ai/client/css/inc/preview-vid.less index a0c292ce..4d5ad0b9 100644 --- a/src/_h5ai/client/css/inc/preview-vid.less +++ b/src/_h5ai/client/css/inc/preview-vid.less @@ -1,14 +1,14 @@ #pv-vid-video { - position: absolute; + position: absolute; - max-width: 100%; - max-height: 100%; + max-width: 100%; + max-height: 100%; - box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3); } #pv-vid-video:-webkit-full-screen { - top: auto !important; - left: auto !important; + top: auto !important; + left: auto !important; } diff --git a/src/_h5ai/client/css/inc/preview.less b/src/_h5ai/client/css/inc/preview.less index 2a50b9de..f1b9957e 100644 --- a/src/_h5ai/client/css/inc/preview.less +++ b/src/_h5ai/client/css/inc/preview.less @@ -1,154 +1,154 @@ #pv-overlay { - display: none; - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; - z-index: 100; + display: none; + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 100; - background-color: rgba(0,0,0,0.5); - .transition(background-color 0.3s ease-in-out); + background-color: rgba(0,0,0,0.5); + .transition(background-color 0.3s ease-in-out); - text-align: center; + text-align: center; } #pv-overlay.fullscreen { - background-color: #111; + background-color: #111; } #pv-content { - position: absolute; + position: absolute; } #pv-spinner { - position: absolute; + position: absolute; - img { - width: 100px; - height: 100px; - margin: -50px -50px; - } + img { + width: 100px; + height: 100px; + margin: -50px -50px; + } } #pv-prev-area, #pv-next-area { - position: absolute; - top: 50%; - cursor: pointer; + position: absolute; + top: 50%; + cursor: pointer; - img { - width: 48px; - height: 48px; - margin: -36px 0; - padding: 12px; - opacity: 0.5; - } + img { + width: 48px; + height: 48px; + margin: -36px 0; + padding: 12px; + opacity: 0.5; + } - &:hover, &.hover { - img { - background-color: rgba(27,27,27,0.8); - opacity: 1; - } - } + &:hover, &.hover { + img { + background-color: rgba(27,27,27,0.8); + opacity: 1; + } + } } #pv-prev-area { - left: 0; - img { - border-top-right-radius: 8px; - border-bottom-right-radius: 8px; - padding-left: 48px; - } + left: 0; + img { + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + padding-left: 48px; + } } #pv-next-area { - right: 0; - img { - border-top-left-radius: 8px; - border-bottom-left-radius: 8px; - padding-right: 48px; - } + right: 0; + img { + border-top-left-radius: 8px; + border-bottom-left-radius: 8px; + padding-right: 48px; + } } #pv-buttons { - list-style: none; - list-style-image: none; - margin: 0; - padding: 0; + list-style: none; + list-style-image: none; + margin: 0; + padding: 0; - img { - position: relative; - top: -2px; - width: 16px; - height: 16px; - } - img + span, img + input { - margin-left: 6px; - } - input { - background-color: rgba(255,255,255,0.1); - border: none; - color: #ccc; - } + img { + position: relative; + top: -2px; + width: 16px; + height: 16px; + } + img + span, img + input { + margin-left: 6px; + } + input { + background-color: rgba(255,255,255,0.1); + border: none; + color: #ccc; + } - .bar-label { - display: block; - color: #ccc; - height: 30px; - line-height: 30px; - padding: 0 10px; - opacity: 0.7; - .transition(all 0.2s ease-in-out); - } + .bar-label { + display: block; + color: #ccc; + height: 30px; + line-height: 30px; + padding: 0 10px; + opacity: 0.7; + .transition(all 0.2s ease-in-out); + } - .bar-highlight { - background-color: rgba(255,255,255,0.1); - opacity: 1.0; - } + .bar-highlight { + background-color: rgba(255,255,255,0.1); + opacity: 1.0; + } - @bar-sep-border: 1px solid rgba(255,255,255,0.08); + @bar-sep-border: 1px solid rgba(255,255,255,0.08); - .bar-button { - .bar-label; - cursor: pointer; - &:hover, &.hover { - .bar-highlight; - } - } + .bar-button { + .bar-label; + cursor: pointer; + &:hover, &.hover { + .bar-highlight; + } + } - .bar-left { - float: left; - border-right: @bar-sep-border; - } + .bar-left { + float: left; + border-right: @bar-sep-border; + } - .bar-right { - float: right; - border-left: @bar-sep-border; - } + .bar-right { + float: right; + border-left: @bar-sep-border; + } } #pv-bottombar { - position: fixed; - z-index: 5; - width: 100%; - height: 32px; - left: 0; - bottom: 0; - background-color: rgb(27,27,27); - border-top: 1px solid rgb(45,45,45); + position: fixed; + z-index: 5; + width: 100%; + height: 32px; + left: 0; + bottom: 0; + background-color: rgb(27,27,27); + border-top: 1px solid rgb(45,45,45); } #pv-overlay.fullscreen { - #pv-bottombar { - opacity: 0.5; - } + #pv-bottombar { + opacity: 0.5; + } } @media only screen and (max-width: 700px) { #pv-prev-area, #pv-next-area, #pv-close-area { - display: none !important; + display: none !important; } } diff --git a/src/_h5ai/client/css/inc/qrcode.less b/src/_h5ai/client/css/inc/qrcode.less index 616e087b..fe7311b9 100644 --- a/src/_h5ai/client/css/inc/qrcode.less +++ b/src/_h5ai/client/css/inc/qrcode.less @@ -1,16 +1,16 @@ #qrcode { - display: none; - position: fixed; - right: 16px; - bottom: 50px; - z-index: 10; + display: none; + position: fixed; + right: 16px; + bottom: 50px; + z-index: 10; - background-color: @col-widget-back; - border: @border-widget; - padding: 8px; + background-color: @col-widget-back; + border: @border-widget; + padding: 8px; - canvas { - display: block; - } + canvas { + display: block; + } } diff --git a/src/_h5ai/client/css/inc/responsive.less b/src/_h5ai/client/css/inc/responsive.less index 2855c6d5..36fa0f4f 100644 --- a/src/_h5ai/client/css/inc/responsive.less +++ b/src/_h5ai/client/css/inc/responsive.less @@ -1,56 +1,56 @@ @media only screen and (max-width: 700px) { #topbar { - .crumb { - display: none; - } - .current { - display: block; - } + .crumb { + display: none; + } + .current { + display: block; + } } #view.view-details { - .header .label, .item .label { - margin-right: 80px !important; - } - .header .date, .item .date { - display: none; - } + .header .label, .item .label { + margin-right: 80px !important; + } + .header .date, .item .date { + display: none; + } } #view.view-icons { - padding: 0; + padding: 0; } #bottombar { - .center { - display: none; - } + .center { + display: none; + } } } @media only screen and (max-width: 500px) { body { - margin: 8px; + margin: 8px; } #tree { - display: none !important; + display: none !important; } } @media print { a[href]:after { - content: ""; + content: ""; } #topbar { - position: static; - margin-bottom: 2em; - .view, #download { - display: none; - } + position: static; + margin-bottom: 2em; + .view, #download { + display: none; + } } #bottombar { - position: static; - margin-top: 2em; + position: static; + margin-top: 2em; } #tree, #sidebar { - display: none !important; + display: none !important; } } diff --git a/src/_h5ai/client/css/inc/sidebar.less b/src/_h5ai/client/css/inc/sidebar.less index b8803dcd..d7290691 100644 --- a/src/_h5ai/client/css/inc/sidebar.less +++ b/src/_h5ai/client/css/inc/sidebar.less @@ -1,125 +1,125 @@ #sidebar { - position: fixed; - right: -220px; - width: 200px; - top: 31px; - height: 100%; - z-index: 3; - overflow: auto; - padding: 8px; - background-color: @col-widget-back; - border-left: @border-widget; + position: fixed; + right: -220px; + width: 200px; + top: 31px; + height: 100%; + z-index: 3; + overflow: auto; + padding: 8px; + background-color: @col-widget-back; + border-left: @border-widget; } #settings { - .block { - display: block; - margin: 12px 0; - } + .block { + display: block; + margin: 12px 0; + } - a, a:active, a:visited, span.element { - color: @col; - cursor: pointer; - text-decoration: none; - opacity: 0.7; - .transition(all 0.2s ease-in-out); + a, a:active, a:visited, span.element { + color: @col; + cursor: pointer; + text-decoration: none; + opacity: 0.7; + .transition(all 0.2s ease-in-out); - display: block; - height: 30px; - line-height: 30px; - padding: 0 10px; + display: block; + height: 30px; + line-height: 30px; + padding: 0 10px; - &:hover, &.hover { - opacity: 1.0; - background: @col-widget-back-highlight; - } - } + &:hover, &.hover { + opacity: 1.0; + background: @col-widget-back-highlight; + } + } - .current { - a, span.element { - opacity: 1.0; - background: @col-widget-back-highlight; - } - } + .current { + a, span.element { + opacity: 1.0; + background: @col-widget-back-highlight; + } + } - img { - position: relative; - top: -2px; - width: 16px; - height: 16px; - } + img { + position: relative; + top: -2px; + width: 16px; + height: 16px; + } - .view { - display: inline-block; - margin: 0 4px 0 0; - } + .view { + display: inline-block; + margin: 0 4px 0 0; + } - .select { - background-color: @col-widget-back-highlight; - width: 175px; - overflow: hidden; - } + .select { + background-color: @col-widget-back-highlight; + width: 175px; + overflow: hidden; + } - input, select { - -moz-appearance: none; - -ms-appearance: none; - -webkit-appearance: none; - font-family: @font-family; - font-size: 13px; - font-weight: @font-weight; - color: @col; - background: @col-widget-back; - width: 100%; - height: 30px; - line-height: 30px; - border: 0 solid #000; - outline: none; - cursor: pointer; - } + input, select { + -moz-appearance: none; + -ms-appearance: none; + -webkit-appearance: none; + font-family: @font-family; + font-size: 13px; + font-weight: @font-weight; + color: @col; + background: @col-widget-back; + width: 100%; + height: 30px; + line-height: 30px; + border: 0 solid #000; + outline: none; + cursor: pointer; + } - select { - width: 200px; - padding: 0 4px; - } + select { + width: 200px; + padding: 0 4px; + } - input[type='range'] { - border-radius: 2px; - width: 64px; - margin: 0 0 4px 12px; - padding: 0 2px; - vertical-align: middle; - } + input[type='range'] { + border-radius: 2px; + width: 64px; + margin: 0 0 4px 12px; + padding: 0 2px; + vertical-align: middle; + } - .range-track() { - -moz-appearance: none; - -ms-appearance: none; - -webkit-appearance: none; - border-width: 0; - border-radius: 2px; - background: @col-range-back; - height: 2px; - } + .range-track() { + -moz-appearance: none; + -ms-appearance: none; + -webkit-appearance: none; + border-width: 0; + border-radius: 2px; + background: @col-range-back; + height: 2px; + } - .range-thumb() { - -moz-appearance: none; - -ms-appearance: none; - -webkit-appearance: none; - border-width: 0; - border-radius: 2px; - background: @col-range-thumb; - width: 12px; - height: 12px; - } + .range-thumb() { + -moz-appearance: none; + -ms-appearance: none; + -webkit-appearance: none; + border-width: 0; + border-radius: 2px; + background: @col-range-thumb; + width: 12px; + height: 12px; + } - input[type='range']::-webkit-slider-runnable-track { .range-track; } - input[type='range']::-moz-range-track { .range-track; } - input[type='range']::-ms-track { .range-track; } - input[type='range']::-ms-fill-lower { .range-track; } - input[type='range']::-ms-fill-upper { .range-track; } + input[type='range']::-webkit-slider-runnable-track { .range-track; } + input[type='range']::-moz-range-track { .range-track; } + input[type='range']::-ms-track { .range-track; } + input[type='range']::-ms-fill-lower { .range-track; } + input[type='range']::-ms-fill-upper { .range-track; } - input[type='range']::-webkit-slider-thumb { .range-thumb; margin-top: -5px; } - input[type='range']::-moz-range-thumb { .range-thumb; } - input[type='range']::-ms-thumb { .range-thumb; } + input[type='range']::-webkit-slider-thumb { .range-thumb; margin-top: -5px; } + input[type='range']::-moz-range-thumb { .range-thumb; } + input[type='range']::-ms-thumb { .range-thumb; } } diff --git a/src/_h5ai/client/css/inc/topbar.less b/src/_h5ai/client/css/inc/topbar.less index e0da03c6..4bf0a2d7 100644 --- a/src/_h5ai/client/css/inc/topbar.less +++ b/src/_h5ai/client/css/inc/topbar.less @@ -1,87 +1,87 @@ #topbar { - position: fixed; - z-index: 5; - width: 100%; - min-height: 30px; - left: 0; - top: 0; - background-color: @col-widget-back; - border-bottom: @border-widget; + position: fixed; + z-index: 5; + width: 100%; + min-height: 30px; + left: 0; + top: 0; + background-color: @col-widget-back; + border-bottom: @border-widget; } .topbar-highlight { - background-color: @col-widget-back-highlight; - opacity: 1.0; + background-color: @col-widget-back-highlight; + opacity: 1.0; } .topbar-hover { - .topbar-highlight; - color: @col-hover; + .topbar-highlight; + color: @col-hover; } .topbar-left { - float: left; - border-right: @border-widget-sep; + float: left; + border-right: @border-widget-sep; } .topbar-right { - float: right; - border-left: @border-widget-sep; + float: right; + border-left: @border-widget-sep; } #navbar { - list-style: none; - list-style-image: none; - margin: 0; - padding: 0; + list-style: none; + list-style-image: none; + margin: 0; + padding: 0; - a, a:active, a:visited, span.element { - color: @col; - cursor: pointer; - text-decoration: none; - opacity: 0.7; - .transition(all 0.2s ease-in-out); + a, a:active, a:visited, span.element { + color: @col; + cursor: pointer; + text-decoration: none; + opacity: 0.7; + .transition(all 0.2s ease-in-out); - display: block; - height: 30px; - line-height: 30px; - padding: 0 10px; + display: block; + height: 30px; + line-height: 30px; + padding: 0 10px; - &:hover, &.hover { - .topbar-hover; - } - } - .current { - a, span.element { - .topbar-highlight; - } - } - img { - position: relative; - top: -2px; - width: 16px; - height: 16px; - } - img + span, img + input { - margin-left: 6px; - } - .crumb { - .topbar-left; - .hint { - margin-left: 8px; - font-style: italic; - color: #999; - } - img.hint { - opacity: 0.8; - width: 12px; - height: 12px; - } - } - .view { - .topbar-right; - } + &:hover, &.hover { + .topbar-hover; + } + } + .current { + a, span.element { + .topbar-highlight; + } + } + img { + position: relative; + top: -2px; + width: 16px; + height: 16px; + } + img + span, img + input { + margin-left: 6px; + } + .crumb { + .topbar-left; + .hint { + margin-left: 8px; + font-style: italic; + color: #999; + } + img.hint { + opacity: 0.8; + width: 12px; + height: 12px; + } + } + .view { + .topbar-right; + } } diff --git a/src/_h5ai/client/css/inc/tree.less b/src/_h5ai/client/css/inc/tree.less index 6508bf61..09c712cc 100644 --- a/src/_h5ai/client/css/inc/tree.less +++ b/src/_h5ai/client/css/inc/tree.less @@ -1,116 +1,116 @@ #tree { - display: none; - position: fixed; - left: 0; - top: 31px; - height: 100%; - z-index: 3; - overflow: auto; - padding: 8px; - background-color: @col-widget-back; - border-right: @border-widget; + display: none; + position: fixed; + left: 0; + top: 31px; + height: 100%; + z-index: 3; + overflow: auto; + padding: 8px; + background-color: @col-widget-back; + border-right: @border-widget; - .sp-scrollbar { - width: 6px; - background-color: @col-sb-back; - cursor: pointer; + .sp-scrollbar { + width: 6px; + background-color: @col-sb-back; + cursor: pointer; - .sp-thumb { - background-color: @col-sb-thumb; - } - &.active .sp-thumb { - background-color: @col-sb-thumb-active; - } - } + .sp-thumb { + background-color: @col-sb-thumb; + } + &.active .sp-thumb { + background-color: @col-sb-thumb-active; + } + } - .indicator { - position: relative; - top: 2px; - display: inline-block; - width: 16px; - height: 22px; - float: left; - opacity: 0.7; - cursor: pointer; + .indicator { + position: relative; + top: 2px; + display: inline-block; + width: 16px; + height: 22px; + float: left; + opacity: 0.7; + cursor: pointer; - img { - width: 12px; - height: 12px; - .transition(all 0.2s ease-in-out); - } - &.open { - img { - .transform(rotate(90deg)); - } - } - &.unknown { - opacity: 0.3; - } - &.none { - opacity: 0; - cursor: inherit; - } - } - a, a:active, a.visited { - display: block; - height: 1.231em; - line-height: 1.231em; - margin-left: 14px; - padding: 4px 6px; - color: #555; - border: 1px solid rgba(0,0,0,0); - border-radius: 3px; - text-decoration: none; - opacity: 0.7; + img { + width: 12px; + height: 12px; + .transition(all 0.2s ease-in-out); + } + &.open { + img { + .transform(rotate(90deg)); + } + } + &.unknown { + opacity: 0.3; + } + &.none { + opacity: 0; + cursor: inherit; + } + } + a, a:active, a.visited { + display: block; + height: 1.231em; + line-height: 1.231em; + margin-left: 14px; + padding: 4px 6px; + color: #555; + border: 1px solid rgba(0,0,0,0); + border-radius: 3px; + text-decoration: none; + opacity: 0.7; - &:hover, &.hover { - color: @col-hover; - background-color: @col-widget-back-hover; - opacity: 1; - } - } - .icon { - position: relative; - top: -2px; - margin-right: 6px; + &:hover, &.hover { + color: @col-hover; + background-color: @col-widget-back-hover; + opacity: 1; + } + } + .icon { + position: relative; + top: -2px; + margin-right: 6px; - img { - width: 16px; - height: 16px; - } - } - .hint { - margin-left: 6px; - font-size: 0.9em; - color: #ccc; - } - .content { - list-style: none; - margin: 0; - padding: 0 0 0 24px; - } - .summary { - margin: 0 0 0 24px; - color: #999; - font-style: italic; - } - .current { - > a, > a:active, > a:visited { - background-color: @col-widget-back-sel; - border-color: @col-widget-sep; - opacity: 1; - } - } - .error { - > a, > a:active, > a:visited { - color: #999; - &:hover, &.hover { - color: @col-hover; - } - } - .hint { - color: #c55; - } - } + img { + width: 16px; + height: 16px; + } + } + .hint { + margin-left: 6px; + font-size: 0.9em; + color: #ccc; + } + .content { + list-style: none; + margin: 0; + padding: 0 0 0 24px; + } + .summary { + margin: 0 0 0 24px; + color: #999; + font-style: italic; + } + .current { + > a, > a:active, > a:visited { + background-color: @col-widget-back-sel; + border-color: @col-widget-sep; + opacity: 1; + } + } + .error { + > a, > a:active, > a:visited { + color: #999; + &:hover, &.hover { + color: @col-hover; + } + } + .hint { + color: #c55; + } + } } diff --git a/src/_h5ai/client/css/inc/view-details.less b/src/_h5ai/client/css/inc/view-details.less index 2568d96c..4c141e44 100644 --- a/src/_h5ai/client/css/inc/view-details.less +++ b/src/_h5ai/client/css/inc/view-details.less @@ -1,122 +1,122 @@ .view-details-sized(@size) { - li { + li { - &.item { + &.item { - a, a:active, a:visited { - height: @size + 6px; - } + a, a:active, a:visited { + height: @size + 6px; + } - .label, .date, .size { - padding: ((@size - 16px)/2) 8px; - } - } + .label, .date, .size { + padding: ((@size - 16px)/2) 8px; + } + } - .icon.square { - width: @size; + .icon.square { + width: @size; - img { - width: @size; - height: @size; - } - } + img { + width: @size; + height: @size; + } + } - .label { - margin: 0 230px 0 (@size + 16px); - } - } + .label { + margin: 0 230px 0 (@size + 16px); + } + } } #view.view-details { - li { + li { - &.header { - display: list-item; - } + &.header { + display: list-item; + } - &.item { + &.item { - a, a:active, a:visited { - border-bottom: 1px solid @item-border-col-sep; + a, a:active, a:visited { + border-bottom: 1px solid @item-border-col-sep; - &:hover, &.hover { - border-color: @item-border-col-hover; - } - } + &:hover, &.hover { + border-color: @item-border-col-hover; + } + } - // needs to be here, to not conflict with header fields - .icon { - padding: 8px; - } - } + // needs to be here, to not conflict with header fields + .icon { + padding: 8px; + } + } - .icon.square { - display: inline-block; - position: absolute; - left: 0; - top: -4px; - } + .icon.square { + display: inline-block; + position: absolute; + left: 0; + top: -4px; + } - .date { - position: absolute; - right: 100px; - top: 0; - } + .date { + position: absolute; + right: 100px; + top: 0; + } - .size { - position: absolute; - right: 0; - top: 0; - } + .size { + position: absolute; + right: 0; + top: 0; + } - .selector { - margin-top: -1px; - } - } + .selector { + margin-top: -1px; + } + } - .view-details-sized(@icon-size); + .view-details-sized(@icon-size); - &.size-16 { - .view-details-sized(16px) - } + &.size-16 { + .view-details-sized(16px) + } - &.size-24 { - .view-details-sized(24px) - } + &.size-24 { + .view-details-sized(24px) + } - &.size-32 { - .view-details-sized(32px) - } + &.size-32 { + .view-details-sized(32px) + } - &.size-48 { - .view-details-sized(48px) - } + &.size-48 { + .view-details-sized(48px) + } - &.size-64 { - .view-details-sized(64px) - } + &.size-64 { + .view-details-sized(64px) + } - &.size-96 { - .view-details-sized(96px) - } + &.size-96 { + .view-details-sized(96px) + } - &.size-128 { - .view-details-sized(128px) - } + &.size-128 { + .view-details-sized(128px) + } - &.size-192 { - .view-details-sized(192px) - } + &.size-192 { + .view-details-sized(192px) + } - &.size-256 { - .view-details-sized(256px) - } + &.size-256 { + .view-details-sized(256px) + } - &.size-384 { - .view-details-sized(384px) - } + &.size-384 { + .view-details-sized(384px) + } } diff --git a/src/_h5ai/client/css/inc/view-grid.less b/src/_h5ai/client/css/inc/view-grid.less index e4437cf0..c5adebbf 100644 --- a/src/_h5ai/client/css/inc/view-grid.less +++ b/src/_h5ai/client/css/inc/view-grid.less @@ -1,113 +1,113 @@ .view-grid-sized(@size) { - li { + li { - &.item { + &.item { - a, a:active, a:visited { - width: @size + 182px; - height: @size + 6px; - } + a, a:active, a:visited { + width: @size + 182px; + height: @size + 6px; + } - .label, .date, .size { - padding: ((@size - 16px)/2) 8px; - } - } + .label, .date, .size { + padding: ((@size - 16px)/2) 8px; + } + } - .icon.square { - width: @size; + .icon.square { + width: @size; - img { - width: @size; - height: @size; - } - } + img { + width: @size; + height: @size; + } + } - .label { - margin: 0 0 0 (@size + 8px); - } - } + .label { + margin: 0 0 0 (@size + 8px); + } + } } #view.view-grid { - li { + li { - &.item { - float: left; - margin: 2px; + &.item { + float: left; + margin: 2px; - a, a:active, a:visited { - border: 1px solid rgba(0,0,0,0); + a, a:active, a:visited { + border: 1px solid rgba(0,0,0,0); - &:hover, &.hover { - border-color: @item-border-col-hover; - } - } + &:hover, &.hover { + border-color: @item-border-col-hover; + } + } - // needs to be here, to not conflict with header fields - .icon { - padding: 8px; - } - } + // needs to be here, to not conflict with header fields + .icon { + padding: 8px; + } + } - .icon.square { - display: inline-block; - position: absolute; - left: 0; - top: -4px; - } + .icon.square { + display: inline-block; + position: absolute; + left: 0; + top: -4px; + } - .label { - display: block; - } + .label { + display: block; + } - .date, .size { - display: none; - } - } + .date, .size { + display: none; + } + } - .view-grid-sized(@icon-size); + .view-grid-sized(@icon-size); - &.size-16 { - .view-grid-sized(16px) - } + &.size-16 { + .view-grid-sized(16px) + } - &.size-24 { - .view-grid-sized(24px) - } + &.size-24 { + .view-grid-sized(24px) + } - &.size-32 { - .view-grid-sized(32px) - } + &.size-32 { + .view-grid-sized(32px) + } - &.size-48 { - .view-grid-sized(48px) - } + &.size-48 { + .view-grid-sized(48px) + } - &.size-64 { - .view-grid-sized(64px) - } + &.size-64 { + .view-grid-sized(64px) + } - &.size-96 { - .view-grid-sized(96px) - } + &.size-96 { + .view-grid-sized(96px) + } - &.size-128 { - .view-grid-sized(128px) - } + &.size-128 { + .view-grid-sized(128px) + } - &.size-192 { - .view-grid-sized(192px) - } + &.size-192 { + .view-grid-sized(192px) + } - &.size-256 { - .view-grid-sized(256px) - } + &.size-256 { + .view-grid-sized(256px) + } - &.size-384 { - .view-grid-sized(384px) - } + &.size-384 { + .view-grid-sized(384px) + } } diff --git a/src/_h5ai/client/css/inc/view-icons.less b/src/_h5ai/client/css/inc/view-icons.less index d01dda80..2420acbd 100644 --- a/src/_h5ai/client/css/inc/view-icons.less +++ b/src/_h5ai/client/css/inc/view-icons.less @@ -1,115 +1,115 @@ .view-icons-sized(@size) { - li { + li { - &.item { + &.item { - a, a:active, a:visited { - width: @size * 2; - height: @size + 72px; - } - } + a, a:active, a:visited { + width: @size * 2; + height: @size + 72px; + } + } - .icon.rational { - height: @size; + .icon.rational { + height: @size; - img { - width: @size; - height: @size; - } - img.thumb { - width: auto; - height: auto; - max-width: @size * 2; - max-height: @size; - } - } - } + img { + width: @size; + height: @size; + } + img.thumb { + width: auto; + height: auto; + max-width: @size * 2; + max-height: @size; + } + } + } } #view.view-icons { - li { - text-align: center; + li { + text-align: center; - &.item { - float: left; - margin: 8px; + &.item { + float: left; + margin: 8px; - a, a:active, a:visited { - padding: 8px; - min-width: 96px; - border: 1px solid rgba(0,0,0,0); + a, a:active, a:visited { + padding: 8px; + min-width: 96px; + border: 1px solid rgba(0,0,0,0); - &:hover, &.hover { - border-color: @item-border-col-hover; - } - } - } + &:hover, &.hover { + border-color: @item-border-col-hover; + } + } + } - .icon.rational { - display: block; - margin-bottom: 6px; - } + .icon.rational { + display: block; + margin-bottom: 6px; + } - .label { - text-align: center; - word-wrap: break-word; - white-space: normal; - } + .label { + text-align: center; + word-wrap: break-word; + white-space: normal; + } - .date, .size { - display: none; - } - } + .date, .size { + display: none; + } + } - .empty, .no-match { - margin: 0 120px; - padding: 16px; - height: 120px; - } + .empty, .no-match { + margin: 0 120px; + padding: 16px; + height: 120px; + } - .view-icons-sized(@icon-size); + .view-icons-sized(@icon-size); - &.size-16 { - .view-icons-sized(16px); - } + &.size-16 { + .view-icons-sized(16px); + } - &.size-24 { - .view-icons-sized(24px); - } + &.size-24 { + .view-icons-sized(24px); + } - &.size-32 { - .view-icons-sized(32px); - } + &.size-32 { + .view-icons-sized(32px); + } - &.size-48 { - .view-icons-sized(48px); - } + &.size-48 { + .view-icons-sized(48px); + } - &.size-64 { - .view-icons-sized(64px); - } + &.size-64 { + .view-icons-sized(64px); + } - &.size-96 { - .view-icons-sized(96px); - } + &.size-96 { + .view-icons-sized(96px); + } - &.size-128 { - .view-icons-sized(128px); - } + &.size-128 { + .view-icons-sized(128px); + } - &.size-192 { - .view-icons-sized(192px); - } + &.size-192 { + .view-icons-sized(192px); + } - &.size-256 { - .view-icons-sized(256px); - } + &.size-256 { + .view-icons-sized(256px); + } - &.size-384 { - .view-icons-sized(384px); - } + &.size-384 { + .view-icons-sized(384px); + } } diff --git a/src/_h5ai/client/css/inc/view.less b/src/_h5ai/client/css/inc/view.less index 8c84742e..be92f4fa 100644 --- a/src/_h5ai/client/css/inc/view.less +++ b/src/_h5ai/client/css/inc/view.less @@ -12,186 +12,186 @@ #selection-rect { - display: none; - position: absolute; - left: 0; - top: 0; - z-index: 2; - border: 1px dashed @col-border-strong; - background-color: rgba(0,0,0,0.01); + display: none; + position: absolute; + left: 0; + top: 0; + z-index: 2; + border: 1px dashed @col-border-strong; + background-color: rgba(0,0,0,0.01); } #view { - display: none; - margin: 0 auto; + display: none; + margin: 0 auto; - a, a:active, a:visited { - color: #333; - cursor: pointer; - text-decoration: none; - } + a, a:active, a:visited { + color: #333; + cursor: pointer; + text-decoration: none; + } - ul { - margin: 0; - padding: 0; - list-style: none; - } + ul { + margin: 0; + padding: 0; + list-style: none; + } - li { - position: relative; - white-space: nowrap; + li { + position: relative; + white-space: nowrap; - &.header { - display: none; - font-size: 13px; + &.header { + display: none; + font-size: 13px; - a, a:active, a:visited { - padding: 6px 6px 18px 6px; - opacity: 0.4; - .transition(all 0.2s ease-in-out); + a, a:active, a:visited { + padding: 6px 6px 18px 6px; + opacity: 0.4; + .transition(all 0.2s ease-in-out); - img { - display: none; - position: relative; - top: -2px; - width: 12px; - height: 12px; - padding: 0 8px; - } - &:hover { - color: #555; - opacity: 0.9; - } - &.ascending img.ascending { - display: inline; - } - &.descending img.descending { - display: inline; - } - } - } + img { + display: none; + position: relative; + top: -2px; + width: 12px; + height: 12px; + padding: 0 8px; + } + &:hover { + color: #555; + opacity: 0.9; + } + &.ascending img.ascending { + display: inline; + } + &.descending img.descending { + display: inline; + } + } + } - &.item { - font-size: 15px; + &.item { + font-size: 15px; - a, a:active, a:visited { - display: block; - overflow: hidden; + a, a:active, a:visited { + display: block; + overflow: hidden; - &:hover, &.hover { - color: @col-hover; - background-color: @item-background-col-hover; - border-color: @item-border-col-hover; - } + &:hover, &.hover { + color: @col-hover; + background-color: @item-background-col-hover; + border-color: @item-border-col-hover; + } - &:hover { - .selector { - display: block; - } - } - } + &:hover { + .selector { + display: block; + } + } + } - &.selected:not(.selecting), &.selecting:not(.selected) { + &.selected:not(.selecting), &.selecting:not(.selected) { - a, a:active, a:visited { - background-color: @item-background-col-sel; - border-color: @item-border-col-sel; + a, a:active, a:visited { + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; - &:hover, &.hover { - background-color: @item-background-col-sel; - border-color: @item-border-col-sel; - } - } + &:hover, &.hover { + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; + } + } - .selector { - display: block; - // border-color: @col-border-stronger; + .selector { + display: block; + // border-color: @col-border-stronger; - img { - display: block; - } - } - } - } + img { + display: block; + } + } + } + } - &.folder-parent { + &.folder-parent { - .date, .size { - display: none; - } - } + .date, .size { + display: none; + } + } - .icon { - display: none; - text-align: center; + .icon { + display: none; + text-align: center; - img { - vertical-align: top; - } + img { + vertical-align: top; + } - .thumb { - box-shadow: 0 0 0 1px rgba(0,0,0,0.12); - } + .thumb { + box-shadow: 0 0 0 1px rgba(0,0,0,0.12); + } - &.rational { - .thumb { - padding: 2px; - border-radius: 3px; - } - } - } + &.rational { + .thumb { + padding: 2px; + border-radius: 3px; + } + } + } - .label { - display: block; - overflow: hidden; - text-align: left; - text-overflow: ellipsis; - } + .label { + display: block; + overflow: hidden; + text-align: left; + text-overflow: ellipsis; + } - .date { - text-align: right; - width: 130px; - } + .date { + text-align: right; + width: 130px; + } - .size { - text-align: right; - width: 80px; - } + .size { + text-align: right; + width: 80px; + } - .selector { - display: none; - position: absolute; - left: 0; - top: 0; - width: 18px; - height: 18px; - background-color: #fff; - border: 1px solid @col-border-strong; - cursor: pointer; - .transition(all 0.2s ease-in-out); + .selector { + display: none; + position: absolute; + left: 0; + top: 0; + width: 18px; + height: 18px; + background-color: #fff; + border: 1px solid @col-border-strong; + cursor: pointer; + .transition(all 0.2s ease-in-out); - &:hover { - border-color: @col-border-stronger; - } + &:hover { + border-color: @col-border-stronger; + } - img { - display: none; - width: 100%; - height: 100%; - } - } - } + img { + display: none; + width: 100%; + height: 100%; + } + } + } - .empty, .no-match { - margin: 50px 0; - text-align: center; - color: #ddd; - font-size: 5em; - font-weight: bold; - } + .empty, .no-match { + margin: 50px 0; + text-align: center; + color: #ddd; + font-size: 5em; + font-weight: bold; + } - .no-match { - display: none; - } + .no-match { + display: none; + } } diff --git a/src/_h5ai/client/js/inc/core/event.js b/src/_h5ai/client/js/inc/core/event.js index 1873a5ca..c3ffdf0e 100644 --- a/src/_h5ai/client/js/inc/core/event.js +++ b/src/_h5ai/client/js/inc/core/event.js @@ -1,45 +1,45 @@ modulejs.define('core/event', ['_'], function (_) { - var slice = Array.prototype.slice, - subscriptions = {}, + var slice = Array.prototype.slice, + subscriptions = {}, - sub = function (topic, callback) { + sub = function (topic, callback) { - if (_.isString(topic) && _.isFunction(callback)) { + if (_.isString(topic) && _.isFunction(callback)) { - if (!subscriptions[topic]) { - subscriptions[topic] = []; - } - subscriptions[topic].push(callback); - } - }, + if (!subscriptions[topic]) { + subscriptions[topic] = []; + } + subscriptions[topic].push(callback); + } + }, - unsub = function (topic, callback) { + unsub = function (topic, callback) { - if (_.isString(topic) && _.isFunction(callback) && subscriptions[topic]) { + if (_.isString(topic) && _.isFunction(callback) && subscriptions[topic]) { - subscriptions[topic] = _.without(subscriptions[topic], callback); - } - }, + subscriptions[topic] = _.without(subscriptions[topic], callback); + } + }, - pub = function (topic, data) { + pub = function (topic, data) { - var args = slice.call(arguments, 1); + var args = slice.call(arguments, 1); - // console.log('EVENT PUB', topic, args); - if (_.isString(topic) && subscriptions[topic]) { + // console.log('EVENT PUB', topic, args); + if (_.isString(topic) && subscriptions[topic]) { - _.each(subscriptions[topic], function (callback) { + _.each(subscriptions[topic], function (callback) { - callback.apply(topic, args); - }); - } - }; + callback.apply(topic, args); + }); + } + }; - return { - sub: sub, - unsub: unsub, - pub: pub - }; + return { + sub: sub, + unsub: unsub, + pub: pub + }; }); diff --git a/src/_h5ai/client/js/inc/core/format.js b/src/_h5ai/client/js/inc/core/format.js index 7991328f..ca745876 100644 --- a/src/_h5ai/client/js/inc/core/format.js +++ b/src/_h5ai/client/js/inc/core/format.js @@ -1,56 +1,56 @@ modulejs.define('core/format', ['_', 'moment'], function (_, moment) { - var decimalMetric = { - t: 1000.0, - k: 1000.0, - u: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] - }, - binaryMetric = { - t: 1024.0, - k: 1024.0, - u: ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'] - }, - defaultMetric = decimalMetric, - defaultDateFormat = 'YYYY-MM-DD HH:mm', + var decimalMetric = { + t: 1000.0, + k: 1000.0, + u: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] + }, + binaryMetric = { + t: 1024.0, + k: 1024.0, + u: ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'] + }, + defaultMetric = decimalMetric, + defaultDateFormat = 'YYYY-MM-DD HH:mm', - setDefaultMetric = function (useBinaryMetric) { + setDefaultMetric = function (useBinaryMetric) { - defaultMetric = useBinaryMetric ? binaryMetric : decimalMetric; - }, + defaultMetric = useBinaryMetric ? binaryMetric : decimalMetric; + }, - formatSize = function (size, metric) { + formatSize = function (size, metric) { - metric = metric || defaultMetric; + metric = metric || defaultMetric; - if (!_.isNumber(size) || size < 0) { - return ''; - } + if (!_.isNumber(size) || size < 0) { + return ''; + } - var i = 0, - maxI = metric.u.length - 1; + var i = 0, + maxI = metric.u.length - 1; - while (size >= metric.t && i < maxI) { - size /= metric.k; - i += 1; - } - return (i <= 1 ? Math.round(size) : size.toFixed(1)).toString() + ' ' + metric.u[i]; - }, + while (size >= metric.t && i < maxI) { + size /= metric.k; + i += 1; + } + return (i <= 1 ? Math.round(size) : size.toFixed(1)).toString() + ' ' + metric.u[i]; + }, - setDefaultDateFormat = function (dateFormat) { + setDefaultDateFormat = function (dateFormat) { - defaultDateFormat = dateFormat; - }, + defaultDateFormat = dateFormat; + }, - formatDate = function (millis) { + formatDate = function (millis) { - return _.isNumber(millis) && millis ? moment(millis).format(defaultDateFormat) : ''; - }; + return _.isNumber(millis) && millis ? moment(millis).format(defaultDateFormat) : ''; + }; - return { - setDefaultMetric: setDefaultMetric, - formatSize: formatSize, - setDefaultDateFormat: setDefaultDateFormat, - formatDate: formatDate - }; + return { + setDefaultMetric: setDefaultMetric, + formatSize: formatSize, + setDefaultDateFormat: setDefaultDateFormat, + formatDate: formatDate + }; }); diff --git a/src/_h5ai/client/js/inc/core/langs.js b/src/_h5ai/client/js/inc/core/langs.js index 9a7f1555..7555d5c1 100644 --- a/src/_h5ai/client/js/inc/core/langs.js +++ b/src/_h5ai/client/js/inc/core/langs.js @@ -1,5 +1,5 @@ modulejs.define('core/langs', ['config', '_'], function (config, _) { - return _.extend({}, config.langs); + return _.extend({}, config.langs); }); diff --git a/src/_h5ai/client/js/inc/core/location.js b/src/_h5ai/client/js/inc/core/location.js index 7dc133ed..b2252879 100644 --- a/src/_h5ai/client/js/inc/core/location.js +++ b/src/_h5ai/client/js/inc/core/location.js @@ -1,209 +1,209 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event', 'core/notify'], function (_, modernizr, allsettings, event, notify) { - var settings = _.extend({ - smartBrowsing: true, - unmanagedInNewWindow: true - }, allsettings.view), + var settings = _.extend({ + smartBrowsing: true, + unmanagedInNewWindow: true + }, allsettings.view), - doc = document, + doc = document, - history = settings.smartBrowsing && modernizr.history ? window.history : null, + history = settings.smartBrowsing && modernizr.history ? window.history : null, - forceEncoding = function (href) { + forceEncoding = function (href) { - return href - .replace(/\/+/g, '/') + return href + .replace(/\/+/g, '/') - .replace(/ /g, '%20') - .replace(/!/g, '%21') - .replace(/#/g, '%23') - .replace(/\$/g, '%24') - .replace(/&/g, '%26') - .replace(/'/g, '%27') - .replace(/\(/g, '%28') - .replace(/\)/g, '%29') - .replace(/\*/g, '%2A') - .replace(/\+/g, '%2B') - .replace(/\,/g, '%2C') - // .replace(/\//g, '%2F') - .replace(/:/g, '%3A') - .replace(/;/g, '%3B') - .replace(/=/g, '%3D') - .replace(/\?/g, '%3F') - .replace(/@/g, '%40') - .replace(/\[/g, '%5B') - .replace(/\]/g, '%5D'); - }, + .replace(/ /g, '%20') + .replace(/!/g, '%21') + .replace(/#/g, '%23') + .replace(/\$/g, '%24') + .replace(/&/g, '%26') + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29') + .replace(/\*/g, '%2A') + .replace(/\+/g, '%2B') + .replace(/\,/g, '%2C') + // .replace(/\//g, '%2F') + .replace(/:/g, '%3A') + .replace(/;/g, '%3B') + .replace(/=/g, '%3D') + .replace(/\?/g, '%3F') + .replace(/@/g, '%40') + .replace(/\[/g, '%5B') + .replace(/\]/g, '%5D'); + }, - reUriToPathname = /^.*:\/\/[^\/]*|[^\/]*$/g, - uriToPathname = function (uri) { + reUriToPathname = /^.*:\/\/[^\/]*|[^\/]*$/g, + uriToPathname = function (uri) { - return uri.replace(reUriToPathname, ''); - }, + return uri.replace(reUriToPathname, ''); + }, - hrefsAreDecoded = (function () { + hrefsAreDecoded = (function () { - var testpathname = '/a b', - a = doc.createElement('a'); + var testpathname = '/a b', + a = doc.createElement('a'); - a.href = testpathname; - return uriToPathname(a.href) === testpathname; - }()), + a.href = testpathname; + return uriToPathname(a.href) === testpathname; + }()), - encodedHref = function (href) { + encodedHref = function (href) { - var a = doc.createElement('a'), - location; + var a = doc.createElement('a'), + location; - a.href = href; - location = uriToPathname(a.href); + a.href = href; + location = uriToPathname(a.href); - if (hrefsAreDecoded) { - location = encodeURIComponent(location).replace(/%2F/ig, '/'); - } + if (hrefsAreDecoded) { + location = encodeURIComponent(location).replace(/%2F/ig, '/'); + } - return forceEncoding(location); - }; + return forceEncoding(location); + }; - var absHref = null, + var absHref = null, - getDomain = function () { + getDomain = function () { - return doc.domain; - }, + return doc.domain; + }, - getAbsHref = function () { + getAbsHref = function () { - return absHref; - }, + return absHref; + }, - getItem = function () { + getItem = function () { - return modulejs.require('model/item').get(absHref); - }, + return modulejs.require('model/item').get(absHref); + }, - load = function (callback) { + load = function (callback) { - modulejs.require('core/server').request({action: 'get', items: true, itemsHref: absHref, itemsWhat: 1}, function (json) { + 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); + var Item = modulejs.require('model/item'), + item = Item.get(absHref); - if (json) { + if (json) { - var found = {}; + var found = {}; - _.each(json.items, function (jsonItem) { + _.each(json.items, function (jsonItem) { - var e = Item.get(jsonItem.absHref, jsonItem.time, jsonItem.size, jsonItem.is_managed, jsonItem.content, jsonItem.md5, jsonItem.sha1); - found[e.absHref] = true; - }); + var e = Item.get(jsonItem.absHref, jsonItem.time, jsonItem.size, jsonItem.is_managed, jsonItem.content, jsonItem.md5, jsonItem.sha1); + found[e.absHref] = true; + }); - _.each(item.content, function (e) { + _.each(item.content, function (e) { - if (!found[e.absHref]) { - Item.remove(e.absHref); - } - }); - } - if (_.isFunction(callback)) { - callback(item); - } - }); - }, + if (!found[e.absHref]) { + Item.remove(e.absHref); + } + }); + } + if (_.isFunction(callback)) { + callback(item); + } + }); + }, - setLocation = function (newAbsHref, keepBrowserUrl) { + setLocation = function (newAbsHref, keepBrowserUrl) { - event.pub('location.beforeChange'); + event.pub('location.beforeChange'); - newAbsHref = encodedHref(newAbsHref); + newAbsHref = encodedHref(newAbsHref); - if (absHref !== newAbsHref) { - absHref = newAbsHref; + if (absHref !== newAbsHref) { + absHref = newAbsHref; - if (history) { - if (keepBrowserUrl) { - history.replaceState({absHref: absHref}, '', absHref); - } else { - history.pushState({absHref: absHref}, '', absHref); - } - } - } + 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); - }); - } - }, + 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 () { + refresh = function () { - var item = getItem(), - oldItems = _.values(item.content); + var item = getItem(), + oldItems = _.values(item.content); - event.pub('location.beforeRefresh'); + event.pub('location.beforeRefresh'); - load(function () { + load(function () { - var newItems = _.values(item.content), - added = _.difference(newItems, oldItems), - removed = _.difference(oldItems, newItems); + var newItems = _.values(item.content), + added = _.difference(newItems, oldItems), + removed = _.difference(oldItems, newItems); - event.pub('location.refreshed', item, added, removed); - }); - }, + event.pub('location.refreshed', item, added, removed); + }); + }, - setLink = function ($el, item) { + setLink = function ($el, item) { - $el.attr('href', item.absHref); + $el.attr('href', item.absHref); - if (history && item.isFolder() && item.isManaged) { - $el.on('click', function () { + if (history && item.isFolder() && item.isManaged) { + $el.on('click', function () { - setLocation(item.absHref); - return false; - }); - } + setLocation(item.absHref); + return false; + }); + } - if (settings.unmanagedInNewWindow && !item.isManaged) { - $el.attr('target', '_blank'); - } - }; + if (settings.unmanagedInNewWindow && !item.isManaged) { + $el.attr('target', '_blank'); + } + }; - if (history) { - window.onpopstate = function (e) { + if (history) { + window.onpopstate = function (e) { - if (e.state && e.state.absHref) { - setLocation(e.state.absHref, true); - } - }; - } + if (e.state && e.state.absHref) { + setLocation(e.state.absHref, true); + } + }; + } - event.sub('ready', function () { + event.sub('ready', function () { - setLocation(document.location.href, true); - }); + setLocation(document.location.href, true); + }); - return { - forceEncoding: forceEncoding, - getDomain: getDomain, - getAbsHref: getAbsHref, - getItem: getItem, - setLocation: setLocation, - refresh: refresh, - setLink: setLink - }; + return { + 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 index a9aebbfe..cbdb71a7 100644 --- a/src/_h5ai/client/js/inc/core/notify.js +++ b/src/_h5ai/client/js/inc/core/notify.js @@ -1,25 +1,25 @@ modulejs.define('core/notify', ['$'], function ($) { - var template = '
', + var template = '
', - set = function (content) { + set = function (content) { - if (content) { - $('#notify').stop(true, true).html(content).fadeIn(400); - } else { - $('#notify').stop(true, true).fadeOut(400); - } - }, + if (content) { + $('#notify').stop(true, true).html(content).fadeIn(400); + } else { + $('#notify').stop(true, true).fadeOut(400); + } + }, - init = function () { + init = function () { - $(template).hide().appendTo('body'); - }; + $(template).hide().appendTo('body'); + }; - init(); + init(); - return { - set: set - }; + return { + set: set + }; }); diff --git a/src/_h5ai/client/js/inc/core/resource.js b/src/_h5ai/client/js/inc/core/resource.js index b8bb0150..0b44a904 100644 --- a/src/_h5ai/client/js/inc/core/resource.js +++ b/src/_h5ai/client/js/inc/core/resource.js @@ -1,42 +1,42 @@ modulejs.define('core/resource', ['_', '$', 'config', 'core/settings'], function (_, $, config, settings) { - var win = window, - appHref = settings.appHref, - imagesHref = appHref + 'client/images/', - fallbackHref = appHref + 'client/images/fallback/', - themesHref = appHref + 'client/themes/', - scriptsHref = appHref + 'client/js/', - fallbacks = ['file', 'folder', 'folder-page', 'folder-parent', 'ar', 'aud', 'bin', 'img', 'txt', 'vid'], + var win = window, + appHref = settings.appHref, + imagesHref = appHref + 'client/images/', + fallbackHref = appHref + 'client/images/fallback/', + themesHref = appHref + 'client/themes/', + scriptsHref = appHref + 'client/js/', + fallbacks = ['file', 'folder', 'folder-page', 'folder-parent', 'ar', 'aud', 'bin', 'img', 'txt', 'vid'], - image = function (id) { + image = function (id) { - return imagesHref + id + '.svg'; - }, + return imagesHref + id + '.svg'; + }, - icon = function (id) { + icon = function (id) { - var baseId = id.split('-')[0], - href = config.theme[id] || config.theme[baseId]; + var baseId = id.split('-')[0], + href = config.theme[id] || config.theme[baseId]; - if (href) { - return themesHref + href; - } + if (href) { + return themesHref + href; + } - if (_.indexOf(fallbacks, id) >= 0) { - return fallbackHref + id + '.svg'; - } + if (_.indexOf(fallbacks, id) >= 0) { + return fallbackHref + id + '.svg'; + } - if (_.indexOf(fallbacks, baseId) >= 0) { - return fallbackHref + baseId + '.svg'; - } + if (_.indexOf(fallbacks, baseId) >= 0) { + return fallbackHref + baseId + '.svg'; + } - return fallbackHref + 'file.svg'; - }; + return fallbackHref + 'file.svg'; + }; - return { - image: image, - icon: icon - }; + return { + image: image, + icon: icon + }; }); diff --git a/src/_h5ai/client/js/inc/core/server.js b/src/_h5ai/client/js/inc/core/server.js index becc9b96..7c16a3e5 100644 --- a/src/_h5ai/client/js/inc/core/server.js +++ b/src/_h5ai/client/js/inc/core/server.js @@ -1,53 +1,53 @@ modulejs.define('core/server', ['$', '_', 'config', 'core/location'], function ($, _, config, location) { - var server = { + var server = { - backend: config.setup.BACKEND, - api: config.setup.API === true, - name: config.setup.SERVER_NAME, - version: config.setup.SERVER_VERSION, + backend: config.setup.BACKEND, + api: config.setup.API === true, + name: config.setup.SERVER_NAME, + version: config.setup.SERVER_VERSION, - request: function (data, callback) { + request: function (data, callback) { - if (server.api) { - $.ajax({ - url: location.getAbsHref(), - data: data, - type: 'POST', - dataType: 'json' - }) - .done(function (json) { + if (server.api) { + $.ajax({ + url: location.getAbsHref(), + data: data, + type: 'POST', + dataType: 'json' + }) + .done(function (json) { - callback(json); - }) - .fail(function () { + callback(json); + }) + .fail(function () { - callback(); - }); - } else { - callback(); - } - }, + callback(); + }); + } else { + callback(); + } + }, - formRequest: function (data) { + formRequest: function (data) { - if (server.api) { - var $form = $('
') - .attr('action', location.getAbsHref()); + if (server.api) { + var $form = $('') + .attr('action', location.getAbsHref()); - _.each(data, function (val, key) { + _.each(data, function (val, key) { - $('') - .attr('name', key) - .attr('value', val) - .appendTo($form); - }); + $('') + .attr('name', key) + .attr('value', val) + .appendTo($form); + }); - $form.appendTo('body').submit().remove(); - } - } - }; + $form.appendTo('body').submit().remove(); + } + } + }; - return server; + return server; }); diff --git a/src/_h5ai/client/js/inc/core/settings.js b/src/_h5ai/client/js/inc/core/settings.js index 59b9f4b1..4abaec47 100644 --- a/src/_h5ai/client/js/inc/core/settings.js +++ b/src/_h5ai/client/js/inc/core/settings.js @@ -1,9 +1,9 @@ modulejs.define('core/settings', ['config', '_'], function (config, _) { - return _.extend({}, config.options, { - appHref: config.setup.APP_HREF, - rootHref: config.setup.ROOT_HREF, - currentHref: config.setup.CURRENT_HREF - }); + return _.extend({}, config.options, { + appHref: config.setup.APP_HREF, + rootHref: config.setup.ROOT_HREF, + currentHref: config.setup.CURRENT_HREF + }); }); diff --git a/src/_h5ai/client/js/inc/core/store.js b/src/_h5ai/client/js/inc/core/store.js index e4a66222..728bfce4 100644 --- a/src/_h5ai/client/js/inc/core/store.js +++ b/src/_h5ai/client/js/inc/core/store.js @@ -1,41 +1,41 @@ modulejs.define('core/store', ['modernizr'], function (modernizr) { - var store = modernizr.localstorage ? window.localStorage : null, + var store = modernizr.localstorage ? window.localStorage : null, - key = '_h5ai', + key = '_h5ai', - load = function () { + load = function () { - if (store) { - try { - return JSON.parse(store[key]); - } catch (e) {} - } - return {}; - }, + if (store) { + try { + return JSON.parse(store[key]); + } catch (e) {} + } + return {}; + }, - save = function (obj) { + save = function (obj) { - if (store) { - store[key] = JSON.stringify(obj); - } - }, + if (store) { + store[key] = JSON.stringify(obj); + } + }, - put = function (key, value) { + put = function (key, value) { - var obj = load(); - obj[key] = value; - return save(obj); - }, + var obj = load(); + obj[key] = value; + return save(obj); + }, - get = function (key) { + get = function (key) { - return load()[key]; - }; + return load()[key]; + }; - return { - put: put, - get: get - }; + return { + put: put, + get: get + }; }); diff --git a/src/_h5ai/client/js/inc/core/types.js b/src/_h5ai/client/js/inc/core/types.js index eb86704b..84430f03 100644 --- a/src/_h5ai/client/js/inc/core/types.js +++ b/src/_h5ai/client/js/inc/core/types.js @@ -1,47 +1,47 @@ modulejs.define('core/types', ['config', '_'], function (config, _) { - var reEndsWithSlash = /\/$/, - regexps = {}, + var reEndsWithSlash = /\/$/, + regexps = {}, - escapeRegExp = function (sequence) { + escapeRegExp = function (sequence) { - return sequence.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$]/g, "\\$&"); - // return sequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - }, + return sequence.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$]/g, "\\$&"); + // return sequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, - parse = function (types) { + parse = function (types) { - _.each(types, function (patterns, type) { + _.each(types, function (patterns, type) { - var pattern = '^(' + _.map(patterns, function (p) { return '(' + escapeRegExp(p).replace(/\*/g, '.*') + ')'; }).join('|') + ')$'; - regexps[type] = new RegExp(pattern, 'i'); - }); - }, + var pattern = '^(' + _.map(patterns, function (p) { return '(' + escapeRegExp(p).replace(/\*/g, '.*') + ')'; }).join('|') + ')$'; + regexps[type] = new RegExp(pattern, 'i'); + }); + }, - getType = function (sequence) { + getType = function (sequence) { - if (reEndsWithSlash.test(sequence)) { - return 'folder'; - } + if (reEndsWithSlash.test(sequence)) { + return 'folder'; + } - var slashidx = sequence.lastIndexOf('/'), - name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence; + var slashidx = sequence.lastIndexOf('/'), + name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence; - for (var type in regexps) { - if (regexps.hasOwnProperty(type)) { - if (regexps[type].test(name)) { - return type; - } - } - } + for (var type in regexps) { + if (regexps.hasOwnProperty(type)) { + if (regexps[type].test(name)) { + return type; + } + } + } - return 'file'; - }; + return 'file'; + }; - parse(_.extend({}, config.types)); + parse(_.extend({}, config.types)); - return { - getType: getType - }; + return { + getType: getType + }; }); diff --git a/src/_h5ai/client/js/inc/ext/autorefresh.js b/src/_h5ai/client/js/inc/ext/autorefresh.js index dba4dcc4..cc0b6d77 100644 --- a/src/_h5ai/client/js/inc/ext/autorefresh.js +++ b/src/_h5ai/client/js/inc/ext/autorefresh.js @@ -1,42 +1,42 @@ modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'core/location'], function (_, $, allsettings, event, location) { - var settings = _.extend({ - enabled: false, - interval: 5000 - }, allsettings.autorefresh), + var settings = _.extend({ + enabled: false, + interval: 5000 + }, allsettings.autorefresh), - timeoutId = null, + timeoutId = null, - heartbeat = function () { + heartbeat = function () { - location.refresh(); - }, + location.refresh(); + }, - before = function () { + before = function () { - clearTimeout(timeoutId); - }, + clearTimeout(timeoutId); + }, - after = function () { + after = function () { - clearTimeout(timeoutId); - timeoutId = setTimeout(heartbeat, settings.interval); - }, + clearTimeout(timeoutId); + timeoutId = setTimeout(heartbeat, settings.interval); + }, - init = function () { + init = function () { - if (!settings.enabled) { - return; - } + if (!settings.enabled) { + return; + } - settings.interval = Math.max(1000, settings.interval); + settings.interval = Math.max(1000, settings.interval); - event.sub('location.beforeChange', before); - event.sub('location.beforeRefresh', before); - event.sub('location.changed', after); - event.sub('location.refreshed', after); - }; + event.sub('location.beforeChange', before); + event.sub('location.beforeRefresh', before); + event.sub('location.changed', after); + event.sub('location.refreshed', after); + }; - init(); + init(); }); diff --git a/src/_h5ai/client/js/inc/ext/crumb.js b/src/_h5ai/client/js/inc/ext/crumb.js index 86f0ef5a..065a2e6b 100644 --- a/src/_h5ai/client/js/inc/ext/crumb.js +++ b/src/_h5ai/client/js/inc/ext/crumb.js @@ -1,95 +1,96 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/location'], function (_, $, allsettings, resource, event, location) { - var settings = _.extend({ - enabled: false - }, allsettings.crumb), + var settings = _.extend({ + enabled: false + }, allsettings.crumb), - template = '
  • ' + - '' + - '>' + - '' + - '' + - '
  • ', - pageHintTemplate = 'has index page', - statusHintTemplate = '', + template = + '
  • ' + + '' + + '>' + + '' + + '' + + '
  • ', + pageHintTemplate = 'has index page', + statusHintTemplate = '', - update = function (item, force) { + update = function (item, force) { - if (!force && item.$crumb) { - return item.$crumb; - } + if (!force && item.$crumb) { + return item.$crumb; + } - var $html = $(template), - $a = $html.find('a'); + var $html = $(template), + $a = $html.find('a'); - $html - .addClass(item.isFolder() ? 'folder' : 'file') - .data('item', item); + $html + .addClass(item.isFolder() ? 'folder' : 'file') + .data('item', item); - location.setLink($a, item); - $a.find('span').text(item.label).end(); + location.setLink($a, item); + $a.find('span').text(item.label).end(); - if (item.isDomain()) { - $html.addClass('domain'); - $a.find('img').attr('src', resource.image('home')); - } + if (item.isDomain()) { + $html.addClass('domain'); + $a.find('img').attr('src', resource.image('home')); + } - if (item.isRoot()) { - $html.addClass('root'); - $a.find('img').attr('src', resource.image('home')); - } + if (item.isRoot()) { + $html.addClass('root'); + $a.find('img').attr('src', resource.image('home')); + } - if (item.isCurrentFolder()) { - $html.addClass('current'); - } + if (item.isCurrentFolder()) { + $html.addClass('current'); + } - if (!item.isManaged) { - $a.append($(pageHintTemplate)); - } + if (!item.isManaged) { + $a.append($(pageHintTemplate)); + } - if (item.$crumb) { - item.$crumb.replaceWith($html); - } - item.$crumb = $html; + if (item.$crumb) { + item.$crumb.replaceWith($html); + } + item.$crumb = $html; - return $html; - }, + return $html; + }, - onLocationChanged = function (item) { + onLocationChanged = function (item) { - var crumb = item.getCrumb(), - $ul = $('#navbar'), - found = false; + var crumb = item.getCrumb(), + $ul = $('#navbar'), + found = false; - $ul.find('.crumb').each(function () { + $ul.find('.crumb').each(function () { - var $html = $(this); - if ($html.data('item') === item) { - found = true; - $html.addClass('current'); - } else { - $html.removeClass('current'); - } - }); + 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) { + if (!found) { + $ul.find('.crumb').remove(); + _.each(crumb, function (e) { - $ul.append(update(e, true)); - }); - } - }, + $ul.append(update(e, true)); + }); + } + }, - init = function () { + init = function () { - if (!settings.enabled) { - return; - } + if (!settings.enabled) { + return; + } - event.sub('location.changed', onLocationChanged); - }; + event.sub('location.changed', onLocationChanged); + }; - init(); + init(); }); diff --git a/src/_h5ai/client/js/inc/ext/custom.js b/src/_h5ai/client/js/inc/ext/custom.js index 4f4fc8ec..3b6e166e 100644 --- a/src/_h5ai/client/js/inc/ext/custom.js +++ b/src/_h5ai/client/js/inc/ext/custom.js @@ -1,61 +1,61 @@ modulejs.define('ext/custom', ['_', '$', 'marked', 'core/settings', 'core/server', 'core/event', 'core/resource'], function (_, $, marked, allsettings, server, event, resource) { - var settings = _.extend({ - enabled: false - }, allsettings.custom), + var settings = _.extend({ + enabled: false + }, allsettings.custom), - $header, $footer, - duration = 200, + $header, $footer, + duration = 200, - onLocationChanged = function (item) { + onLocationChanged = function (item) { - server.request({action: 'get', custom: true, customHref: item.absHref}, function (response) { + server.request({action: 'get', custom: true, customHref: item.absHref}, function (response) { - var has_header, has_footer, data, content; + var has_header, has_footer, data, content; - if (response) { - data = response.custom; + if (response) { + data = response.custom; - if (data.header) { - content = data.header; - if (data.header_type === 'md') { - content = marked(content); - } - $header.html(content).stop().slideDown(duration); - has_header = true; - } + if (data.header) { + content = data.header; + if (data.header_type === 'md') { + content = marked(content); + } + $header.html(content).stop().slideDown(duration); + has_header = true; + } - if (data.footer) { - content = data.footer; - if (data.footer_type === 'md') { - content = marked(content); - } - $footer.html(content).stop().slideDown(duration); - has_footer = true; - } - } + if (data.footer) { + content = data.footer; + if (data.footer_type === 'md') { + content = marked(content); + } + $footer.html(content).stop().slideDown(duration); + has_footer = true; + } + } - if (!has_header) { - $header.stop().slideUp(duration); - } - if (!has_footer) { - $footer.stop().slideUp(duration); - } - }); - }, + if (!has_header) { + $header.stop().slideUp(duration); + } + if (!has_footer) { + $footer.stop().slideUp(duration); + } + }); + }, - init = function () { + init = function () { - if (!settings.enabled) { - return; - } + if (!settings.enabled) { + return; + } - $header = $('
    ').hide().prependTo('#content'); - $footer = $('