From 9163996ac2387b87db04d6c32efe04f096519070 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 27 Oct 2012 02:02:10 +0200 Subject: [PATCH] Minor style changes. --- src/_h5ai/client/css/inc/delete.less | 20 --- src/_h5ai/client/css/inc/download.less | 20 --- .../client/css/inc/extended-details.less | 16 +- src/_h5ai/client/css/inc/extended-grid.less | 2 +- src/_h5ai/client/css/inc/extended-icons.less | 2 +- src/_h5ai/client/css/inc/extended-list.less | 17 ++- src/_h5ai/client/css/inc/extended.less | 19 ++- src/_h5ai/client/css/inc/filter.less | 2 +- src/_h5ai/client/css/inc/general.less | 6 +- src/_h5ai/client/css/inc/h5ai-info.less | 2 +- src/_h5ai/client/css/inc/preview-txt.less | 6 +- src/_h5ai/client/css/inc/responsive.less | 1 - src/_h5ai/client/js/inc/ext/dropbox.js | 141 ++++++++++-------- src/_h5ai/conf/options.json | 4 +- 14 files changed, 132 insertions(+), 126 deletions(-) diff --git a/src/_h5ai/client/css/inc/delete.less b/src/_h5ai/client/css/inc/delete.less index 6008c9d4..1942ce80 100644 --- a/src/_h5ai/client/css/inc/delete.less +++ b/src/_h5ai/client/css/inc/delete.less @@ -8,23 +8,3 @@ background-color: rgba(255,0,0,0.5); } } - -#delete-auth { - display: none; - position: fixed; - z-index: 5; - left: 0; - top: 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border: 1px solid rgb(210,210,210); - - input { - display: block; - margin: 4px 6px; - border: 1px solid rgb(210,210,210); - font-family: Ubuntu, sans-serif; - color: #555; - background-color: rgba(255,255,255,1); - width: 100px; - } -} diff --git a/src/_h5ai/client/css/inc/download.less b/src/_h5ai/client/css/inc/download.less index d56119ec..502b70bf 100644 --- a/src/_h5ai/client/css/inc/download.less +++ b/src/_h5ai/client/css/inc/download.less @@ -8,23 +8,3 @@ background-color: rgba(255,0,0,0.5); } } - -#download-auth { - display: none; - position: fixed; - z-index: 5; - left: 0; - top: 0; - .vert-gradient(rgb(241,241,241), rgb(228,228,228)); - border: 1px solid rgb(210,210,210); - - input { - display: block; - margin: 4px 6px; - border: 1px solid rgb(210,210,210); - font-family: Ubuntu, sans-serif; - color: #555; - background-color: rgba(255,255,255,1); - width: 100px; - } -} diff --git a/src/_h5ai/client/css/inc/extended-details.less b/src/_h5ai/client/css/inc/extended-details.less index 7c30e340..74de0518 100644 --- a/src/_h5ai/client/css/inc/extended-details.less +++ b/src/_h5ai/client/css/inc/extended-details.less @@ -10,12 +10,24 @@ &.entry { a, a:active, a:visited { - border-bottom: 1px solid #e8e8e8; + border-top: 1px solid @item-border-col-sep; + border-bottom: 1px solid @item-border-col-sep; + + &:hover, &.hover { + border-color: @item-border-col-hover; + } } // needs to be here, to not conflict with header fields .icon, .label, .date, .size { - padding: 6px; + padding: 8px 6px; + } + } + + &.entry + .entry { + + a, a:active, a:visited { + border-top: none; } } diff --git a/src/_h5ai/client/css/inc/extended-grid.less b/src/_h5ai/client/css/inc/extended-grid.less index b652c7ca..fceadced 100644 --- a/src/_h5ai/client/css/inc/extended-grid.less +++ b/src/_h5ai/client/css/inc/extended-grid.less @@ -15,7 +15,7 @@ border: 1px solid rgba(0,0,0,0); &:hover, &.hover { - border-color: #e8e8e8; + border-color: @item-border-col-hover; } } } diff --git a/src/_h5ai/client/css/inc/extended-icons.less b/src/_h5ai/client/css/inc/extended-icons.less index 740e358f..5581b284 100644 --- a/src/_h5ai/client/css/inc/extended-icons.less +++ b/src/_h5ai/client/css/inc/extended-icons.less @@ -16,7 +16,7 @@ border: 1px solid rgba(0,0,0,0); &:hover, &.hover { - border-color: #e8e8e8; + border-color: @item-border-col-hover; } } } diff --git a/src/_h5ai/client/css/inc/extended-list.less b/src/_h5ai/client/css/inc/extended-list.less index f32e3e86..d71492c5 100644 --- a/src/_h5ai/client/css/inc/extended-list.less +++ b/src/_h5ai/client/css/inc/extended-list.less @@ -7,7 +7,20 @@ a, a:active, a:visited { height: 56px; - border-bottom: 1px solid #e8e8e8; + padding: 4px 0; + border-top: 1px solid @item-border-col-sep; + border-bottom: 1px solid @item-border-col-sep; + + &:hover, &.hover { + border-color: @item-border-col-hover; + } + } + } + + &.entry + .entry { + + a, a:active, a:visited { + border-top: none; } } @@ -19,7 +32,7 @@ display: inline-block; position: absolute; left: 0; - top: -2px; + top: 2px; width: 100px; } diff --git a/src/_h5ai/client/css/inc/extended.less b/src/_h5ai/client/css/inc/extended.less index e767d296..2bc1edba 100644 --- a/src/_h5ai/client/css/inc/extended.less +++ b/src/_h5ai/client/css/inc/extended.less @@ -9,6 +9,13 @@ background-color: rgba(240,100,0,0.2); } +@item-border-col-sep: #f2f2f2; +// @item-border-col-sep: #e8e8e8; +@item-background-col-hover: #f6f6f6; +@item-border-col-hover: #f0f0f0; +@item-background-col-sel: rgba(240,100,0,0.2); +@item-border-col-sel: rgba(240,100,0,0.2); + #extended { display: none; margin: 0 auto; @@ -67,8 +74,8 @@ &:hover, &.hover { color: #e80; - background-color: #f6f6f6; - border-color: #e8e8e8; + background-color: @item-background-col-hover; + border-color: @item-border-col-hover; } } @@ -76,12 +83,12 @@ a, a:active, a:visited { color: #000; - border-color: rgba(240,100,0,0.2); - background-color: rgba(240,100,0,0.2); + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; &:hover, &.hover { - border-color: rgba(240,100,0,0.2); - background-color: rgba(240,100,0,0.2); + background-color: @item-background-col-sel; + border-color: @item-border-col-sel; } } } diff --git a/src/_h5ai/client/css/inc/filter.less b/src/_h5ai/client/css/inc/filter.less index 8ae0ae6d..b93f590d 100644 --- a/src/_h5ai/client/css/inc/filter.less +++ b/src/_h5ai/client/css/inc/filter.less @@ -5,7 +5,7 @@ input { display: none; border: none; - font-family: Ubuntu, sans-serif; + font-family: @font-family; color: #555; background-color: rgba(0,0,0,0); width: 100px; diff --git a/src/_h5ai/client/css/inc/general.less b/src/_h5ai/client/css/inc/general.less index 4546397d..bd6c3a16 100644 --- a/src/_h5ai/client/css/inc/general.less +++ b/src/_h5ai/client/css/inc/general.less @@ -1,10 +1,14 @@ +@font-family: Ubuntu, sans-serif; +@font-family-mono: "Ubuntu Mono", monospace; + + html { overflow-y: auto; } ::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; } ::selection { background: #68A9FF; color: #fff; text-shadow: none; } body { - font-family: Ubuntu, sans-serif; + font-family: @font-family; font-size: 13px; color: #555; background-color: #fff; diff --git a/src/_h5ai/client/css/inc/h5ai-info.less b/src/_h5ai/client/css/inc/h5ai-info.less index 1a7cb7a1..48f2b8ac 100644 --- a/src/_h5ai/client/css/inc/h5ai-info.less +++ b/src/_h5ai/client/css/inc/h5ai-info.less @@ -1,6 +1,6 @@ body#h5ai-info { - font-family: Ubuntu, Arial, sans; + font-family: @font-family; margin: 2em auto 4em auto; font-size: 20px; color: #555; diff --git a/src/_h5ai/client/css/inc/preview-txt.less b/src/_h5ai/client/css/inc/preview-txt.less index 8c6c8f7a..cef9f981 100644 --- a/src/_h5ai/client/css/inc/preview-txt.less +++ b/src/_h5ai/client/css/inc/preview-txt.less @@ -40,7 +40,7 @@ td { vertical-align: top; - font-family: "Ubuntu Mono"; + font-family: @font-family-mono; font-size: 16px; line-height: 1.2em; color: #999; @@ -57,7 +57,7 @@ } code { - font-family: "Ubuntu Mono"; + font-family: @font-family-mono; font-size: 16px; line-height: 1.2em; } @@ -132,7 +132,7 @@ } pre, code { - font-family: "Ubuntu Mono", monospace; + font-family: @font-family-mono; } code { color: #008200; diff --git a/src/_h5ai/client/css/inc/responsive.less b/src/_h5ai/client/css/inc/responsive.less index 0cd32318..4acb1a7f 100644 --- a/src/_h5ai/client/css/inc/responsive.less +++ b/src/_h5ai/client/css/inc/responsive.less @@ -25,7 +25,6 @@ body { #extended.view-icons { padding: 0; border: none; - // margin: 0 -14px; } #bottombar { .center { diff --git a/src/_h5ai/client/js/inc/ext/dropbox.js b/src/_h5ai/client/js/inc/ext/dropbox.js index e8a8b78f..ee11f236 100644 --- a/src/_h5ai/client/js/inc/ext/dropbox.js +++ b/src/_h5ai/client/js/inc/ext/dropbox.js @@ -1,5 +1,5 @@ -modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/location', 'core/server'], function (_, $, allsettings, location, server) { +modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/location', 'core/server', 'core/event'], function (_, $, allsettings, location, server, event) { var settings = _.extend({ enabled: false, @@ -21,7 +21,8 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/location', 'cor return; } - var $content = $('#content').append(template); + var $content = $('#content').append(template), + data = {}; var uploads = {}, afterUpload = function (err, file) { @@ -41,73 +42,83 @@ modulejs.define('ext/dropbox', ['_', '$', 'core/settings', 'core/location', 'cor } }; - $content.filedrop({ + event.sub('ready', function () { - paramname: 'userfile', + $content.filedrop({ - maxfiles: settings.maxfiles, - maxfilesize: settings.maxfilesize, - url: server.api, - data: { + paramname: 'userfile', + + maxfiles: settings.maxfiles, + maxfilesize: settings.maxfilesize, + url: location.getAbsHref(), + data: data, + + docEnter: function () { + + $content.addClass('hint'); + }, + + docLeave: function () { + + $content.removeClass('hint'); + }, + + dragOver: function () { + + $content.addClass('match'); + }, + + dragLeave: function () { + + $content.removeClass('match'); + }, + + drop: function () { + + $content.removeClass('hint match'); + }, + + + beforeEach: function (file) { + + uploads[file.name] = $(uploadTemplate).appendTo('#uploads') + .find('.name').text(file.name).end() + .find('.size').text(file.size).end() + .find('.progress .bar').css('width', 0).end(); + }, + + progressUpdated: function (i, file, progress) { + + uploads[file.name].find('.progress .bar').css('width', '' + progress + '%'); + }, + + uploadFinished: function (i, file, response) { + + afterUpload(response.code && response.msg, file); + }, + + afterAll: function () { + + location.refresh(); + }, + + error: function (err, file) { + + afterUpload(err, file); + } + }); + }); + + event.sub('location.changed', function (item) { + + $('#uploads').empty(); + data = { action: 'upload', - href: location.getAbsHref() - }, - - docEnter: function () { - - $content.addClass('hint'); - }, - - docLeave: function () { - - $content.removeClass('hint'); - }, - - dragOver: function () { - - $content.addClass('match'); - }, - - dragLeave: function () { - - $content.removeClass('match'); - }, - - drop: function () { - - $content.removeClass('hint match'); - }, - - - beforeEach: function (file) { - - uploads[file.name] = $(uploadTemplate).appendTo('#uploads') - .find('.name').text(file.name).end() - .find('.size').text(file.size).end() - .find('.progress .bar').css('width', 0).end(); - }, - - progressUpdated: function (i, file, progress) { - - uploads[file.name].find('.progress .bar').css('width', '' + progress + '%'); - }, - - uploadFinished: function (i, file, response) { - - afterUpload(response.code && response.msg, file); - }, - - afterAll: function () { - - location.refresh(); - }, - - error: function (err, file) { - - afterUpload(err, file); - } + href: item.absHref + }; }); }; - init(); + // disabled while broken + // init(); }); diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index eb13f916..bbf9498f 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -80,7 +80,7 @@ Options Allow file deletion. */ "delete": { - "enabled": false + "enabled": true }, /* [EXPERIMENTAL] @@ -91,7 +91,7 @@ Options - maxfilesize: number, file size is in MB */ "dropbox": { - "enabled": false, + "enabled": true, "maxfiles": 10, "maxfilesize": 1000 },