|
@@ -9,46 +9,10 @@ $(document).ready(function() {
|
|
var eventName = ('ontouchend' in document.documentElement) ? 'touchend' : 'click';
|
|
var eventName = ('ontouchend' in document.documentElement) ? 'touchend' : 'click';
|
|
|
|
|
|
/* Multiselect */
|
|
/* Multiselect */
|
|
- $('#content') .on('mousedown', function(e) { if (e.which===1) multiselect.show(e) });
|
|
|
|
- $(document) .on('mouseup', function(e) { if (e.which===1) multiselect.getSelection(e) });
|
|
|
|
|
|
+ multiselect.bind();
|
|
|
|
|
|
/* Header */
|
|
/* Header */
|
|
- header.dom('#title').on(eventName, function(e) {
|
|
|
|
- if (!$(this).hasClass('editable')) return false;
|
|
|
|
- if (visible.photo()) contextMenu.photoTitle(album.getID(), photo.getID(), e);
|
|
|
|
- else contextMenu.albumTitle(album.getID(), e);
|
|
|
|
- });
|
|
|
|
- header.dom('#button_share').on(eventName, function(e) {
|
|
|
|
- if (photo.json.public==='1'||photo.json.public==='2') contextMenu.sharePhoto(photo.getID(), e);
|
|
|
|
- else photo.setPublic(photo.getID(), e);
|
|
|
|
- });
|
|
|
|
- header.dom('#button_share_album').on(eventName, function(e) {
|
|
|
|
- if (album.json.public==='1') contextMenu.shareAlbum(album.getID(), e);
|
|
|
|
- else album.setPublic(album.getID(), true, e);
|
|
|
|
- });
|
|
|
|
- header.dom('#button_signin') .on(eventName, lychee.loginDialog);
|
|
|
|
- header.dom('#button_settings') .on(eventName, contextMenu.settings);
|
|
|
|
- header.dom('#button_info_album') .on(eventName, sidebar.toggle);
|
|
|
|
- header.dom('#button_info') .on(eventName, sidebar.toggle);
|
|
|
|
- header.dom('.button_add') .on(eventName, contextMenu.add);
|
|
|
|
- header.dom('#button_more') .on(eventName, function(e) { contextMenu.photoMore(photo.getID(), e) });
|
|
|
|
- header.dom('#button_move') .on(eventName, function(e) { contextMenu.move([photo.getID()], e) });
|
|
|
|
- header.dom('#hostedwith') .on(eventName, function() { window.open(lychee.website) });
|
|
|
|
- header.dom('#button_trash_album') .on(eventName, function() { album.delete([album.getID()]) });
|
|
|
|
- header.dom('#button_trash') .on(eventName, function() { photo.delete([photo.getID()]) });
|
|
|
|
- header.dom('#button_archive') .on(eventName, function() { album.getArchive(album.getID()) });
|
|
|
|
- header.dom('#button_star') .on(eventName, function() { photo.setStar([photo.getID()]) });
|
|
|
|
- header.dom('#button_back_home') .on(eventName, function() { lychee.goto('') });
|
|
|
|
- header.dom('#button_back') .on(eventName, function() { lychee.goto(album.getID()) });
|
|
|
|
-
|
|
|
|
- /* Search */
|
|
|
|
- header.dom('#search').on('keyup click', function() { search.find($(this).val()) });
|
|
|
|
-
|
|
|
|
- /* Clear Search */
|
|
|
|
- header.dom('#clearSearch').on(eventName, function () {
|
|
|
|
- header.dom('#search').focus();
|
|
|
|
- search.reset();
|
|
|
|
- });
|
|
|
|
|
|
+ header.bind();
|
|
|
|
|
|
/* Image View */
|
|
/* Image View */
|
|
lychee.imageview
|
|
lychee.imageview
|
|
@@ -61,12 +25,9 @@ $(document).ready(function() {
|
|
.bind('right', function() { if (visible.photo()) $('#imageview a#next').click() })
|
|
.bind('right', function() { if (visible.photo()) $('#imageview a#next').click() })
|
|
.bind('u', function() { $('#upload_files').click() })
|
|
.bind('u', function() { $('#upload_files').click() })
|
|
.bind(['s', 'f'], function(e) {
|
|
.bind(['s', 'f'], function(e) {
|
|
- if (visible.photo()) {
|
|
|
|
- header.dom('#button_star').click();
|
|
|
|
- } else if (visible.albums()) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- header.dom('#search').focus();
|
|
|
|
- }
|
|
|
|
|
|
+ if (visible.photo()) header.dom('#button_star').click();
|
|
|
|
+ else if (visible.albums()) header.dom('#search').focus();
|
|
|
|
+ return false;
|
|
})
|
|
})
|
|
.bind('r', function(e) {
|
|
.bind('r', function(e) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|