File viewer fixes

This commit is contained in:
2019-08-10 14:15:54 +02:00
parent a2b3b265a6
commit 973f03fc70
8 changed files with 64 additions and 74 deletions

View File

@@ -1,37 +0,0 @@
/* global ListNavigator, Toolbar */
$(document).keydown(function(event){
if (event.ctrlKey || event.altKey) {
return // prevent custom shortcuts from interfering with system shortcuts
}
switch (event.which) {
case 65: // A or left arrow key go to previous file
case 37:
ListNavigator.previousItem();
break;
case 68: // D or right arrow key go to next file
case 39:
ListNavigator.nextItem();
break;
case 83:
if (event.shiftKey) {
Toolbar.downloadList(); // SHIFT + S downloads all files in list
} else {
Toolbar.download(); // S to download the current file
}
break;
case 82: // R to toggle list shuffle
ListNavigator.toggleShuffle();
break;
case 67: // C to copy to clipboard
Toolbar.copyUrl();
break;
case 73: // I to open the details window
DetailsWindow.toggle();
break;
case 81: // Q to close the window
window.close();
break;
}
});

View File

@@ -65,3 +65,40 @@ function escapeHTML(str) {
.replace(/>/g, '>')
.replace(/"/g, '"');
}
// Register keyboard shortcuts
document.addEventListener("keydown", function(event){
if (event.ctrlKey || event.altKey) {
return // prevent custom shortcuts from interfering with system shortcuts
}
switch (event.which) {
case 65: // A or left arrow key go to previous file
case 37:
ListNavigator.previousItem();
break;
case 68: // D or right arrow key go to next file
case 39:
ListNavigator.nextItem();
break;
case 83:
if (event.shiftKey) {
Toolbar.downloadList(); // SHIFT + S downloads all files in list
} else {
Toolbar.download(); // S to download the current file
}
break;
case 82: // R to toggle list shuffle
ListNavigator.toggleShuffle();
break;
case 67: // C to copy to clipboard
Toolbar.copyUrl();
break;
case 73: // I to open the details window
DetailsWindow.toggle();
break;
case 81: // Q to close the window
window.close();
break;
}
});

View File

@@ -65,7 +65,6 @@ var UploadProgressBar = /** @class */ (function () {
function handleUploads(files) {
if (uploader === null) {
uploader = new UploadManager();
queueDiv.style.height = "340px";
}
for (var i = 0; i < files.length; i++) {
uploader.uploadFile(new UploadProgressBar(files.item(i)));

View File

@@ -88,8 +88,8 @@ body{
min-width: 100px;
text-align: center;
vertical-align: middle;
transition: left 1s, top 1.5s;
overflow: auto;
transition: left 1s;
overflow: hidden;
}
/* Toolbars */
@@ -106,7 +106,7 @@ body{
padding: 0;
text-align: left;
box-shadow: 2px 2px 8px var(--shadow_color);
transition: left 1s, top 1.5s;
transition: left 1s;
}
.file_viewer > .file_viewer_window > .file_viewer_sharebar{
position: absolute;
@@ -122,7 +122,7 @@ body{
text-align: center;
z-index: 48;
overflow: hidden;
transition: left 1s, top 1.5s;
transition: left 1s;
}
/* =====================
@@ -130,10 +130,6 @@ body{
=====================*/
.image-container{
position: relative;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
height: 100%;
width: 100%;
text-align: center;
@@ -152,10 +148,8 @@ body{
background: #333 none;
position: relative;
text-align: left;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
padding: 5px 5px 5px 20px;
box-sizing: border-box;
}

View File

@@ -80,7 +80,6 @@ class UploadProgressBar implements FileUpload {
function handleUploads(files: FileList) {
if (uploader === null){
uploader = new UploadManager()
queueDiv.style.height = "340px"
}
for (var i = 0; i < files.length; i++) {