diff --git a/src/_h5ai/client/css/inc/sidebar.less b/src/_h5ai/client/css/inc/sidebar.less index de554303..60dcdf78 100644 --- a/src/_h5ai/client/css/inc/sidebar.less +++ b/src/_h5ai/client/css/inc/sidebar.less @@ -4,8 +4,6 @@ overflow: auto; flex: 0 0 auto; order: 0; - // width: 264px; - // border-right: 1px solid @col-border; border-right: 2px solid rgba(0, 0, 0, 0.06); background: #fafafa; z-index: 1; @@ -24,55 +22,42 @@ } } - 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; - outline: 0; - border-radius: 2px; - - &:hover { - opacity: 1.0; - background: rgba(0,0,0,0.03); - // box-shadow: inset 0 0 4px 0 rgba(0,0,0,0.4); - } - } - - .current { - a, span.element { - opacity: 1.0; - background: rgba(0,0,0,0.03); - box-shadow: inset 0 0 4px 0 rgba(0,0,0,0.4); - } - } - - img { - width: 24px; - height: 24px; - padding: 12px; - } - - .view { + .button { display: inline-block; margin: 4px; border-radius: 2px; + color: @col; + cursor: pointer; + // opacity: 0.7; + .transition(all 0.2s ease-in-out); + + &:hover { + // opacity: 1.0; + background: rgba(0,0,0,0.03); + // box-shadow: inset 0 0 4px 0 rgba(0,0,0,0.4); + } + + &.active { + // opacity: 1.0; + background: rgba(0,0,0,0.03); + box-shadow: inset 0 0 4px 0 rgba(0,0,0,0.4); + } + + img { + width: 24px; + height: 24px; + padding: 12px; + } } .select { background: transparent; - width: 175px; overflow: hidden; border-radius: 2px; outline: 0; - - &:hover { - background: rgba(0,0,0,0.03); - // box-shadow: inset 0 0 4px 0 rgba(0,0,0,0.4); - } + width: 142px; + margin: 4px; + line-height: 48px; } input, select { @@ -85,8 +70,8 @@ color: @col; background: transparent; width: 100%; - height: 30px; - line-height: 30px; + // height: 30px; + // line-height: 30px; border: 0 solid #000; cursor: pointer; outline: 0; @@ -98,16 +83,19 @@ } select { - width: 200px; - padding: 0 4px; + width: 172px; + padding: 0 8px; + line-height: 48px; } input[type='range'] { border-radius: 2px; width: 142px; margin: 4px; - padding: 9px; + padding: 8px; vertical-align: middle; + height: 30px; + line-height: 30px; } .range-track() { diff --git a/src/_h5ai/client/css/inc/topbar.less b/src/_h5ai/client/css/inc/topbar.less index d7e3b38c..3604623f 100644 --- a/src/_h5ai/client/css/inc/topbar.less +++ b/src/_h5ai/client/css/inc/topbar.less @@ -23,6 +23,9 @@ order: 99; text-align: center; padding: 6px 12px; + // max-width: 80px; + overflow: hidden; + height: 36px; .transition(all 0.2s ease-in-out); &, &:active, &:visited { @@ -32,6 +35,7 @@ } &:hover { color: @col-hover; + background: rgba(0,0,0,0.03); } &:focus { outline: 0; @@ -52,13 +56,13 @@ .tool { display: inline-block; cursor: pointer; - .transition(all 0.2s ease-in-out); img { display: inline-block; width: 24px; height: 24px; padding: 12px; + .transition(all 0.2s ease-in-out); } &:hover img { diff --git a/src/_h5ai/client/images/fallback/ar.svg b/src/_h5ai/client/images/fallback/ar.svg index e96fe183..00fd05e2 100644 --- a/src/_h5ai/client/images/fallback/ar.svg +++ b/src/_h5ai/client/images/fallback/ar.svg @@ -25,7 +25,7 @@ image/svg+xml - + @@ -44,13 +44,15 @@ inkscape:window-height="1056" id="namedview6" showgrid="true" - inkscape:zoom="19.666667" - inkscape:cx="8.0871817" - inkscape:cy="9.1262198" + inkscape:zoom="27.812867" + inkscape:cx="14.432271" + inkscape:cy="11.316291" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" - inkscape:current-layer="svg2"> + inkscape:current-layer="svg2" + showguides="true" + inkscape:guide-bbox="true"> diff --git a/src/_h5ai/client/images/fallback/aud.svg b/src/_h5ai/client/images/fallback/aud.svg index 7d4fc587..66abac39 100644 --- a/src/_h5ai/client/images/fallback/aud.svg +++ b/src/_h5ai/client/images/fallback/aud.svg @@ -22,7 +22,7 @@ image/svg+xml - + @@ -42,8 +42,8 @@ id="namedview6" showgrid="true" inkscape:zoom="39.333334" - inkscape:cx="10.6976" - inkscape:cy="11.929211" + inkscape:cx="4.4514337" + inkscape:cy="10.912262" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" @@ -58,6 +58,6 @@ diff --git a/src/_h5ai/client/images/fallback/bin.svg b/src/_h5ai/client/images/fallback/bin.svg index 3c839ce7..2ab90ceb 100644 --- a/src/_h5ai/client/images/fallback/bin.svg +++ b/src/_h5ai/client/images/fallback/bin.svg @@ -45,7 +45,7 @@ id="namedview6" showgrid="true" inkscape:zoom="19.666667" - inkscape:cx="8.0363342" + inkscape:cx="1.9854868" inkscape:cy="9.1262198" inkscape:window-x="49" inkscape:window-y="24" @@ -61,7 +61,7 @@ + sodipodi:docname="file.svg" + inkscape:export-filename="/home/lars/env/workspace/web/h5ai/src/_h5ai/client/images/fallback/file.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"> @@ -22,6 +25,7 @@ image/svg+xml + @@ -41,8 +45,8 @@ id="namedview6" showgrid="true" inkscape:zoom="19.666667" - inkscape:cx="17.036334" - inkscape:cy="9.1262198" + inkscape:cx="8.5956562" + inkscape:cy="8.6177452" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" @@ -57,6 +61,14 @@ + d="m -22.98305,1.8983051 c -1.108,0 -2,0.892 -2,2 l 0,15.9999999 c 0,1.108 0.892,2 2,2 l 12,0 c 1.1079996,0 1.9999996,-0.892 1.9999996,-2 l 0,-15.9999999 c 0,-1.108 -0.892,-2 -1.9999996,-2 z" + id="rect2989" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssssss" /> + diff --git a/src/_h5ai/client/images/fallback/img.svg b/src/_h5ai/client/images/fallback/img.svg index fe2994c6..0ead3263 100644 --- a/src/_h5ai/client/images/fallback/img.svg +++ b/src/_h5ai/client/images/fallback/img.svg @@ -41,9 +41,9 @@ inkscape:window-height="1056" id="namedview6" showgrid="true" - inkscape:zoom="39.333334" - inkscape:cx="12.511288" - inkscape:cy="10.758352" + inkscape:zoom="27.812867" + inkscape:cx="10.001398" + inkscape:cy="11.191821" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" @@ -58,6 +58,8 @@ + d="M 4,4 C 2.892,4 2,4.892 2,6 l 0,12 c 0,1.108 0.892,2 2,2 l 16,0 c 1.108,0 2,-0.892 2,-2 L 22,6 C 22,4.892 21.108,4 20,4 z m 5,6 4,5 3,-2 3,4 -14,0 z" + id="rect2989" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ssssssssscccccc" /> diff --git a/src/_h5ai/client/images/fallback/txt.svg b/src/_h5ai/client/images/fallback/txt.svg index ef8348e7..03db4a13 100644 --- a/src/_h5ai/client/images/fallback/txt.svg +++ b/src/_h5ai/client/images/fallback/txt.svg @@ -13,7 +13,7 @@ version="1.1" id="svg2" inkscape:version="0.48.4 r9939" - sodipodi:docname="txt.svg" + sodipodi:docname="file.svg" inkscape:export-filename="/home/lars/env/workspace/web/h5ai/src/_h5ai/client/images/fallback/file.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> @@ -25,7 +25,7 @@ image/svg+xml - + @@ -45,8 +45,8 @@ id="namedview6" showgrid="true" inkscape:zoom="19.666667" - inkscape:cx="8.0871817" - inkscape:cy="9.1262198" + inkscape:cx="8.5956562" + inkscape:cy="8.6177452" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" @@ -61,28 +61,13 @@ - - - + d="m -22.98305,1.8983051 c -1.108,0 -2,0.892 -2,2 l 0,15.9999999 c 0,1.108 0.892,2 2,2 l 12,0 c 1.1079996,0 1.9999996,-0.892 1.9999996,-2 l 0,-15.9999999 c 0,-1.108 -0.892,-2 -1.9999996,-2 z" + id="rect2989" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssssss" /> + diff --git a/src/_h5ai/client/images/fallback/txt1.svg b/src/_h5ai/client/images/fallback/txt1.svg new file mode 100644 index 00000000..e27bf89d --- /dev/null +++ b/src/_h5ai/client/images/fallback/txt1.svg @@ -0,0 +1,68 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/src/_h5ai/client/images/fallback/vid.svg b/src/_h5ai/client/images/fallback/vid.svg index 20bc0152..310801de 100644 --- a/src/_h5ai/client/images/fallback/vid.svg +++ b/src/_h5ai/client/images/fallback/vid.svg @@ -22,7 +22,7 @@ image/svg+xml - + @@ -42,7 +42,7 @@ id="namedview6" showgrid="true" inkscape:zoom="39.333334" - inkscape:cx="12.511288" + inkscape:cx="11.031068" inkscape:cy="11.775301" inkscape:window-x="49" inkscape:window-y="24" @@ -58,6 +58,8 @@ + d="M 4,4 C 2.892,4 2,4.892 2,6 l 0,12 c 0,1.108 0.892,2 2,2 l 16,0 c 1.108,0 2,-0.892 2,-2 L 22,6 C 22,4.892 21.108,4 20,4 z M 3,7 5,7 5,8 3,8 z m 16,0 2,0 0,1 -2,0 z m -16,3 2,0 0,1 -2,0 z m 6.03125,0 4,5 3,-2 L 17,14.28125 17,17 7,17 7,13.5625 z M 19,10 l 2,0 0,1 -2,0 z m -16,3 2,0 0,1 -2,0 z m 16,0 2,0 0,1 -2,0 z m -16,3 2,0 0,1 -2,0 z m 16,0 2,0 0,1 -2,0 z" + id="rect2989" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ssssssssscccccccccccccccccccccccccccccccccccccccccccccccc" /> diff --git a/src/_h5ai/client/images/settings.svg b/src/_h5ai/client/images/settings.svg index 7ccdaf00..de2f0f93 100644 --- a/src/_h5ai/client/images/settings.svg +++ b/src/_h5ai/client/images/settings.svg @@ -39,14 +39,22 @@ inkscape:window-width="1871" inkscape:window-height="1056" id="namedview8" - showgrid="false" - inkscape:zoom="9.8333333" - inkscape:cx="-5.8983051" - inkscape:cy="12" + showgrid="true" + inkscape:zoom="27.812867" + inkscape:cx="13.030903" + inkscape:cy="10.827333" inkscape:window-x="49" inkscape:window-y="24" inkscape:window-maximized="1" - inkscape:current-layer="svg2" /> + inkscape:current-layer="svg2"> + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/_h5ai/client/js/inc/ext/tree.js b/src/_h5ai/client/js/inc/ext/tree.js index 33ebd867..773ebd00 100644 --- a/src/_h5ai/client/js/inc/ext/tree.js +++ b/src/_h5ai/client/js/inc/ext/tree.js @@ -1,4 +1,4 @@ -modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/location'], function (_, $, allsettings, resource, event, location) { +modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/event', 'core/location'], function (_, $, allsettings, resource, store, event, location) { var settings = _.extend({ enabled: false, @@ -14,6 +14,14 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e '' + '' + ''; + var settingsTemplate = + '
' + + '

Tree

' + + '
' + + 'view-tree' + + '
' + + '
'; + var storekey = 'ext/tree'; function update(item) { @@ -50,18 +58,6 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e } } - // is it the domain? - if (item.isDomain()) { - $html.addClass('domain'); - // $img.attr('src', resource.image('home')); - } - - // is it the root? - if (item.isRoot()) { - $html.addClass('root'); - // $img.attr('src', resource.image('home')); - } - // is it the current folder? if (item.isCurrentFolder()) { $html.addClass('current'); @@ -91,7 +87,6 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e } } - if (item.$tree) { item.$tree.replaceWith($html); } @@ -157,13 +152,23 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e }); } + function updateSettings() { + + if (store.get(storekey)) { + $('#view-tree').addClass('active'); + $('#tree').show(); + } else { + $('#view-tree').removeClass('active'); + $('#tree').hide(); + } + } + function onLocationChanged(item) { fetchTree(item, function (root) { - $('#tree') - .append(update(root)) - .show(); + $('#tree').append(update(root)); + updateSettings(); }); } @@ -177,6 +182,20 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e .appendTo('#main-row') .on('click', '.indicator', createOnIndicatorClick()); + $(settingsTemplate) + .appendTo('#settings') + .find('#view-tree') + .on('click', function (ev) { + + store.put(storekey, !store.get(storekey)); + updateSettings(); + ev.preventDefault(); + }); + + // ensure stored value is boolean, default to true + store.put(storekey, store.get(storekey) !== false); + updateSettings(); + event.sub('location.changed', onLocationChanged); } diff --git a/src/_h5ai/client/js/inc/view/viewmode.js b/src/_h5ai/client/js/inc/view/viewmode.js index 6d8b5bff..dddf701d 100644 --- a/src/_h5ai/client/js/inc/view/viewmode.js +++ b/src/_h5ai/client/js/inc/view/viewmode.js @@ -7,10 +7,8 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c }, allsettings.view); var storekey = 'viewmode'; var modeTemplate = - '
' + - '' + - 'view-[MODE]' + - '' + + '
' + + 'view-[MODE]' + '
'; var sizeTemplate = ''; @@ -82,10 +80,10 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c _.each(modes, function (m) { if (m === mode) { - $('#view-' + m).addClass('current'); + $('#view-' + m).addClass('active'); $view.addClass('view-' + m).show(); } else { - $('#view-' + m).removeClass('current'); + $('#view-' + m).removeClass('active'); $view.removeClass('view-' + m); } }); @@ -112,7 +110,7 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c if (_.contains(settings.modes, mode)) { $(modeTemplate.replace(/\[MODE\]/g, mode)) .appendTo($viewBlock) - .on('click', 'a', function (ev) { + .on('click', function (ev) { update(mode); ev.preventDefault();