Improves filter. Still problems with filter and preview.

This commit is contained in:
Lars Jung 2012-09-14 23:24:22 +02:00
parent 27c598d96e
commit 842bca74f9
5 changed files with 32 additions and 6 deletions

View file

@ -49,6 +49,8 @@ Run `makejs -t` to list all possible targets.
* adds drag'n'drop upload (PHP) * adds drag'n'drop upload (PHP)
* adds file deletion (PHP) * adds file deletion (PHP)
* PHP ignore patterns might include paths now * PHP ignore patterns might include paths now
* adds optional binary prefixes for file sizes
* improves filter: autofocus on keypress, clear on `ESC`
* temp download packages are now stored in the `_h5ai/cache` and deleted as soon as possible * temp download packages are now stored in the `_h5ai/cache` and deleted as soon as possible
* localization now in separate files * localization now in separate files
* updates translations * updates translations

View file

@ -121,6 +121,23 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], func
checkState(false); checkState(false);
}) })
.on('keyup', update); .on('keyup', update);
$(document)
.on('keydown', function (event) {
if (event.which === 27) {
$input.attr('value','').blur();
checkState(false);
}
})
.on('keypress', function (event) {
$input.focus();
})
.on('keyup', function (event) {
checkState(false);
});
}; };
init(); init();

View file

@ -198,6 +198,9 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
} else if (key === 70) { // f } else if (key === 70) { // f
onFullscreen(); onFullscreen();
} }
event.stopImmediatePropagation();
return false;
}, },
initEntry = function (entry) { initEntry = function (entry) {
@ -234,7 +237,6 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
$('#pv-img-bar-next, #pv-img-next').on('click', onNext); $('#pv-img-bar-next, #pv-img-next').on('click', onNext);
$('#pv-img-bar-close, #pv-img-close').on('click', onExit); $('#pv-img-bar-close, #pv-img-close').on('click', onExit);
$('#pv-img-bar-fullscreen').on('click', onFullscreen); $('#pv-img-bar-fullscreen').on('click', onFullscreen);
$('#pv-img-overlay').on('keydown', onKeydown);
$('#pv-img-prev') $('#pv-img-prev')
.on('mouseenter', function () { .on('mouseenter', function () {
@ -260,11 +262,12 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
$('#pv-img-bar-close').removeClass('hover'); $('#pv-img-bar-close').removeClass('hover');
}); });
$('#pv-img-overlay') $('#pv-img-overlay')
.on('keydown', onKeydown)
.on('click mousedown mousemove keydown keypress', function (event) { .on('click mousedown mousemove keydown keypress', function (event) {
event.stopPropagation(); event.stopImmediatePropagation();
return false;
}) })
.on('mousemove', function (event) { .on('mousemove', function (event) {

View file

@ -205,6 +205,9 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource',
} else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right } else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right
onNext(); onNext();
} }
event.stopImmediatePropagation();
return false;
}, },
initEntry = function (entry) { initEntry = function (entry) {
@ -240,7 +243,6 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource',
$('#pv-txt-bar-prev').on('click', onPrevious); $('#pv-txt-bar-prev').on('click', onPrevious);
$('#pv-txt-bar-next').on('click', onNext); $('#pv-txt-bar-next').on('click', onNext);
$('#pv-txt-bar-close, #pv-txt-close').on('click', onExit); $('#pv-txt-bar-close, #pv-txt-close').on('click', onExit);
$('#pv-txt-overlay').on('keydown', onKeydown);
$('#pv-txt-close') $('#pv-txt-close')
.on('mouseenter', function () { .on('mouseenter', function () {
@ -252,9 +254,11 @@ modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource',
$('#pv-txt-overlay') $('#pv-txt-overlay')
.on('keydown', onKeydown)
.on('click mousedown mousemove keydown keypress', function (event) { .on('click mousedown mousemove keydown keypress', function (event) {
event.stopPropagation(); event.stopImmediatePropagation();
return false;
}); });
event.sub('entry.created', function (entry) { event.sub('entry.created', function (entry) {

View file

@ -104,7 +104,7 @@ modulejs.define('view/extended', ['_', '$', 'core/settings', 'core/resource', 'c
$ul = $(listTemplate), $ul = $(listTemplate),
$emtpy = $(emptyTemplate); $emtpy = $(emptyTemplate);
format.setDefaultMetric(settings.binaryUnits); format.setDefaultMetric(settings.binaryPrefix);
if (entry.parent) { if (entry.parent) {
$ul.append(update(entry.parent)); $ul.append(update(entry.parent));