mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 10:50:08 +00:00
more refactoring and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6a4ebcb0c8
commit
03dea124d1
21
ui/TODO.otl
21
ui/TODO.otl
@ -58,21 +58,18 @@ Priority work
|
|||||||
[X] one (with zooming)
|
[X] one (with zooming)
|
||||||
[X] single image mode with zooming
|
[X] single image mode with zooming
|
||||||
| ribbons are hidden
|
| ribbons are hidden
|
||||||
[_] 30% UI
|
[_] 33% UI
|
||||||
[X] fix single image mode
|
[X] fix single image mode
|
||||||
| need to center the image correctly...
|
| need to center the image correctly...
|
||||||
[_] 46% add screen buttons for all actions...
|
[X] 100% add screen buttons for all actions...
|
||||||
[X] navigation
|
[X] navigation
|
||||||
[X] actions
|
[X] actions
|
||||||
[_] zooming
|
[X] zooming
|
||||||
[_] 33% zoom presets
|
[X] 100% zoom presets
|
||||||
[_] single
|
[X] single
|
||||||
[_] three
|
[X] three
|
||||||
[X] wide
|
[X] wide
|
||||||
| toggle...
|
| toggle...
|
||||||
[_] return to current image / home (after drag)
|
|
||||||
[_] tap image to return from large magnification
|
|
||||||
[_] pinch to zoom
|
|
||||||
[_] stretch viewer to screen
|
[_] stretch viewer to screen
|
||||||
[_] 0% layout
|
[_] 0% layout
|
||||||
[_] tablet
|
[_] tablet
|
||||||
@ -89,6 +86,11 @@ Priority work
|
|||||||
| @media screen {}
|
| @media screen {}
|
||||||
[_] web
|
[_] web
|
||||||
| is this is the same as the above two? (with auto-select)
|
| is this is the same as the above two? (with auto-select)
|
||||||
|
[_] 0% return to current image / home (after drag)
|
||||||
|
[_] button
|
||||||
|
[_] keyboard
|
||||||
|
[_] tap image to return from large magnification
|
||||||
|
[_] pinch to zoom
|
||||||
[_] 0% setting screen
|
[_] 0% setting screen
|
||||||
[_] basic screen
|
[_] basic screen
|
||||||
[_] keyboard config (low priority)
|
[_] keyboard config (low priority)
|
||||||
@ -134,6 +136,7 @@ Priority work
|
|||||||
[_] cleanup legacy workarounds
|
[_] cleanup legacy workarounds
|
||||||
[_] ui.js, gallery-prototype.js either merge or revise split logic
|
[_] ui.js, gallery-prototype.js either merge or revise split logic
|
||||||
[_] 0% Preview III
|
[_] 0% Preview III
|
||||||
|
[_] revise controls...
|
||||||
[_] dynamic image/preview swap for zooming
|
[_] dynamic image/preview swap for zooming
|
||||||
| important to make 1:1 previews for all main views and zoom levels...
|
| important to make 1:1 previews for all main views and zoom levels...
|
||||||
| also need to make this as device-neutral as possible...
|
| also need to make this as device-neutral as possible...
|
||||||
|
|||||||
@ -17,23 +17,31 @@ Control scheme:
|
|||||||
general
|
general
|
||||||
focus image
|
focus image
|
||||||
-- tap/click - -
|
-- tap/click - -
|
||||||
|
|
||||||
left image
|
left image
|
||||||
left swipe right + -
|
left,bksp,<,p swipe right + -
|
||||||
right image
|
right image
|
||||||
right swipe left + -
|
right,space,>,n swipe left + -
|
||||||
up image
|
up image
|
||||||
up -- (via focus image) ?? -
|
up - (via focus image) ?? -
|
||||||
down image
|
down image
|
||||||
down -- (via focus image) ?? -
|
down - (via focus image) ?? -
|
||||||
|
|
||||||
|
skip 10 left
|
||||||
|
?? - - -
|
||||||
|
skip 10 right
|
||||||
|
?? - - -
|
||||||
|
|
||||||
first image
|
first image
|
||||||
home -- ?? -
|
home - ?? -
|
||||||
last image
|
last image
|
||||||
end -- ?? -
|
end - ?? -
|
||||||
|
|
||||||
shift up
|
shift up
|
||||||
s-up swipe up + -
|
s-up swipe up + -
|
||||||
shift down
|
shift down
|
||||||
s-down swipe down + -
|
s-down swipe down + -
|
||||||
|
|
||||||
shift up, new ribbon
|
shift up, new ribbon
|
||||||
c-s-up ?? ?? ??
|
c-s-up ?? ?? ??
|
||||||
shift down, new ribbon
|
shift down, new ribbon
|
||||||
@ -42,36 +50,38 @@ Control scheme:
|
|||||||
drag view
|
drag view
|
||||||
-- tap-drag - -
|
-- tap-drag - -
|
||||||
move view left
|
move view left
|
||||||
?? ?? ?? ??
|
h - - -
|
||||||
move view right
|
move view right
|
||||||
?? ?? ?? ??
|
l - - -
|
||||||
move view up
|
move view up
|
||||||
?? ?? ?? ??
|
k - - -
|
||||||
move view down
|
move view down
|
||||||
?? ?? ?? ??
|
j - - -
|
||||||
|
|
||||||
center current image
|
center current image
|
||||||
?? ?? ?? ??
|
?? ?? ?? ??
|
||||||
|
|
||||||
zoom in
|
zoom in
|
||||||
+ pinch spread - -
|
+ pinch spread + -
|
||||||
zoom out
|
zoom out
|
||||||
- pinch closeup - -
|
- pinch closeup + -
|
||||||
fit one
|
fit one
|
||||||
1 tap current image - -
|
1 tap current image - -
|
||||||
|
|
||||||
toggle single image mode
|
toggle single image mode
|
||||||
?? ?? - -
|
Enter ?? + -
|
||||||
toggle slideshow mode
|
toggle slideshow mode
|
||||||
?? ?? - -
|
?? ?? - -
|
||||||
|
|
||||||
keyboard help
|
keyboard help
|
||||||
|
?? ?? - -
|
||||||
settings
|
settings
|
||||||
|
?? ?? - -
|
||||||
ribbon-specific
|
ribbon-specific
|
||||||
fit three
|
fit three
|
||||||
3 ?? - -
|
3 ?? + -
|
||||||
broad view
|
broad view
|
||||||
?? ?? - -
|
?? ?? + -
|
||||||
single-specific
|
single-specific
|
||||||
|
|
||||||
.
|
.
|
||||||
|
|||||||
@ -37,12 +37,20 @@ function setupControlElements(){
|
|||||||
$(".image").click(setCurrentImage)
|
$(".image").click(setCurrentImage)
|
||||||
|
|
||||||
// buttons...
|
// buttons...
|
||||||
$('.next-image').click(nextImage)
|
$('.screen-button.next-image').click(nextImage)
|
||||||
$('.prev-image').click(prevImage)
|
$('.screen-button.prev-image').click(prevImage)
|
||||||
$('.demote').click(shiftImageUp)
|
$('.screen-button.demote').click(shiftImageUp)
|
||||||
$('.promote').click(shiftImageDown)
|
$('.screen-button.promote').click(shiftImageDown)
|
||||||
$('.toggle-wide').click(toggleWideView)
|
|
||||||
$('.toggle-single').click(toggleSingleImageMode)
|
$('.screen-button.zoom-in').click(function(){scaleContainerBy(ZOOM_FACTOR)})
|
||||||
|
$('.screen-button.zoom-out').click(function(){scaleContainerBy(1/ZOOM_FACTOR)})
|
||||||
|
|
||||||
|
$('.screen-button.toggle-wide').click(toggleWideView)
|
||||||
|
$('.screen-button.toggle-single').click(toggleSingleImageMode)
|
||||||
|
|
||||||
|
$('.screen-button.fit-three').click(fitThreeImages)
|
||||||
|
|
||||||
|
$('.screen-button.settings').click(function(){alert('not implemented yet...')})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +119,7 @@ var ZOOM_FACTOR = 2
|
|||||||
// XXX need to make this handle modifiers gracefully...
|
// XXX need to make this handle modifiers gracefully...
|
||||||
var keys = {
|
var keys = {
|
||||||
toggleHelp: [72],
|
toggleHelp: [72],
|
||||||
toggleSingleImageMode: [70],
|
toggleSingleImageMode: [70, 13], // ???, Enter
|
||||||
close: [27, 88, 67],
|
close: [27, 88, 67],
|
||||||
|
|
||||||
// zooming...
|
// zooming...
|
||||||
@ -256,9 +264,10 @@ function toggleSingleImageMode(){
|
|||||||
// wide view mode toggle...
|
// wide view mode toggle...
|
||||||
function toggleWideView(){
|
function toggleWideView(){
|
||||||
if($('.wide-view-mode').length > 0){
|
if($('.wide-view-mode').length > 0){
|
||||||
setContainerScale(1)
|
setContainerScale(ORIGINAL_FIELD_SCALE)
|
||||||
$('.viewer').removeClass('wide-view-mode')
|
$('.viewer').removeClass('wide-view-mode')
|
||||||
} else {
|
} else {
|
||||||
|
ORIGINAL_FIELD_SCALE = getElementScale($('.field'))
|
||||||
setContainerScale(0.1)
|
setContainerScale(0.1)
|
||||||
$('.viewer').addClass('wide-view-mode')
|
$('.viewer').addClass('wide-view-mode')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,12 +65,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.promote, .next-image, .prev-image, .demote, .toggle-wide, .toggle-single {
|
.screen-button {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 150px;
|
height: 125px;
|
||||||
|
|
||||||
|
/* coloring is temporary... */
|
||||||
background: gray;
|
background: gray;
|
||||||
|
color: silver;
|
||||||
|
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
@ -80,15 +83,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.next-image, .prev-image, .toggle-wide, .toggle-single {
|
.next-image, .prev-image, .toggle-wide, .toggle-single, .zoom-in, .settings, .toggle-wide {
|
||||||
|
/* coloring is temporary... */
|
||||||
background: silver;
|
background: silver;
|
||||||
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.toggle-wide, .toggle-single {
|
.toggle-single, .fit-three, .zoom-in, .zoom-out {
|
||||||
height:50px
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings, .toggle-wide {
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
.promote {
|
.promote {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,6 @@
|
|||||||
<script src="jquery-ui-1.8.22.custom.min.js"></script>
|
<script src="jquery-ui-1.8.22.custom.min.js"></script>
|
||||||
|
|
||||||
<script src="jquery.touchSwipe.js"></script>
|
<script src="jquery.touchSwipe.js"></script>
|
||||||
<!-- script src="jquery.wipetouch.js"></script-->
|
|
||||||
<!-- XXX this does not work on android... -->
|
|
||||||
<!-- script src="jquery.gestures.js"></script-->
|
|
||||||
<!-- XXX need to figure out how to disable all the bling -->
|
|
||||||
<!-- script src="jquery.mobile.js"></script-->
|
|
||||||
|
|
||||||
<!-- XXX STUB -->
|
<!-- XXX STUB -->
|
||||||
<script src="images.js"></script>
|
<script src="images.js"></script>
|
||||||
@ -68,10 +63,12 @@ $(document).ready(setup);
|
|||||||
|
|
||||||
<div class="viewer">
|
<div class="viewer">
|
||||||
<div class="controller">
|
<div class="controller">
|
||||||
<div class="demote">^</div>
|
<div class="screen-button demote">^</div>
|
||||||
<div class="prev-image"><</div>
|
<div class="screen-button prev-image"><</div>
|
||||||
<div class="promote">v</div>
|
<div class="screen-button promote">v</div>
|
||||||
<div class="toggle-single">[ ]</div>
|
<div class="screen-button toggle-single">[ ]</div>
|
||||||
|
<div class="screen-button fit-three">ooo</div>
|
||||||
|
<div class="screen-button settings">settings</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -85,10 +82,12 @@ $(document).ready(setup);
|
|||||||
<div class="v-marker"></div>
|
<div class="v-marker"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controller">
|
<div class="controller">
|
||||||
<div class="demote">^</div>
|
<div class="screen-button demote">^</div>
|
||||||
<div class="next-image">></div>
|
<div class="screen-button next-image">></div>
|
||||||
<div class="promote">v</div>
|
<div class="screen-button promote">v</div>
|
||||||
<div class="toggle-wide">+/-</div>
|
<div class="screen-button zoom-in">+</div>
|
||||||
|
<div class="screen-button zoom-out">-</div>
|
||||||
|
<div class="screen-button toggle-wide">...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
2
ui/ui.js
2
ui/ui.js
@ -67,8 +67,6 @@ function getCurrentHorizontalOffset(image){
|
|||||||
image = $('.image.current')
|
image = $('.image.current')
|
||||||
}
|
}
|
||||||
|
|
||||||
var scale = getElementScale($('.field'))
|
|
||||||
|
|
||||||
var ribbon = image.parents('.ribbon')
|
var ribbon = image.parents('.ribbon')
|
||||||
var images = ribbon.children('.image')
|
var images = ribbon.children('.image')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user