Skip to content

Commit

Permalink
Feature/navigate to first or last image (#18)
Browse files Browse the repository at this point in the history
* Added keys Page up (first image) and Page down (last image)

Also added information in README.md which keyboard commands that are
supported.

* Bumped to version 1.0.1.x
  • Loading branch information
midstar committed Nov 30, 2019
1 parent 65cc218 commit 33e43bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ View your images and play your videos:

![viewer](testmedia/screenshot_viewer.jpg)

Swipe (mouse or mobile touch) to switch between images/videos:
Swipe (mouse or mobile touch) to switch between images/videos. It is also possible to use keyboard; left arrow key (previous image), right (next image), page up (first image) and page down (last image):

![viewer](testmedia/screenshot_viewer_swipe.jpg)

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ platform: x64
# Do not build on tags (GitHub and BitBucket)
skip_tags: true

version: 1.0.0.{build}
version: 1.0.1.{build}

stack: go 1.11

Expand Down
13 changes: 12 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,18 @@
if (e.keyCode == '27') {
// escape
closeMediaViewer();
} else if (e.keyCode == '37') {
}
else if (e.keyCode == '33') {
// page up = first image
closeMediaViewer();
openMediaViewer(0);
}
else if (e.keyCode == '34') {
// page up = last image
closeMediaViewer();
openMediaViewer(mediaFiles.length - 1);
}
else if (e.keyCode == '37') {
// left arrow
prevMedia();
}
Expand Down

0 comments on commit 33e43bf

Please sign in to comment.