This commit uses a different approach than before. Now we prevent the
selection and display an error to the user to explain him whats going
on. Thus, we do no longer need to check in contextMenu whether a mixture
of photos and albums has been selected.
This fixes the open bug in #603.
MetaKey is the windows key on Windows/Linux. Using only that for
selecting items is really confusing, because AFAIK no existing
application does that. With this commit, ctrl can be used for selecting
items as well.
Previously, we showed the context menu if a multiselect was finished
right away. Since we can select items individually now, it makes more
sense to just select the items as well and show the context menu later
via right mouse button or similar.
A multiselect can only add items to the selection, because that seems to
be easier to use. As before, shift+click can be used to deselect items.
The selection is cleared if the multiselect rectangle is empty and shift
is not pressed. This allows the user to click somewhere on the free area
to clear the selection again. If the shift key is pressed, it is not
cleared to prevent that a user triggers that by accident if he misses a
photo/album.
This commit adds support for selecting photos and albums individually
via ctrl+click. For that, the event handlers in init.js call to
multiselect now, which collects the photo/album ids and calls the
appropriate method of contextMenu in the end.
Previously, we calculated whether there are at least two albums so that
we can actually perform the operation. Due to subalbums this simple
check is not sufficient anymore. Since the rules are more complicated
and we don't have all albums loaded at that point to calculate it
properly, this commit removes the check entirely and always displays
the operations.
The only disadvantage is that if an installation really has just one
album (should rarely happen), the user still sees the merge operation
(not merge all), which results in an album-list with one disabled album.
I think this is okay.
Especially for albums, it is difficult to which ones are
chosen for an operation, because in contrast to photos, the
only change is the thin blue border.
This commit adds a new CSS class, that is set when items
have been selected. Currently, it sets a 2px border instead
of 1px.
Previously, document.mouse{enter,leave} was used for that. This
has the disadvantage that is doesn't work when the browser is
in fullscreen mode (at least, in Chromium), because the mouse
can no longer leave the document.
With this commit, mousemove is used to switch to fullscreen
in the photo view after the user has not moved the mouse for
some time. It is left again, if the user moves the mouse.
Previously, we allowed that and reported an error in this case. Now,
the user can no longer select a parent album for merging it into a
subalbum. It is still checked on the server, though.