lychee/src/scripts/view.js

500 lines
11 KiB
JavaScript
Raw Normal View History

2012-10-02 15:48:08 +00:00
/**
2014-02-23 15:02:01 +00:00
* @description Responsible to reflect data changes to the UI.
* @copyright 2014 by Tobias Reich
2012-10-02 15:48:08 +00:00
*/
2014-11-20 22:30:33 +00:00
view = {}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.header = {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
show: function() {
2014-09-17 21:11:02 +00:00
2014-11-20 23:13:01 +00:00
var newMargin = -1*($('#imageview #image').height()/2)+20;
2014-11-20 23:13:01 +00:00
clearTimeout($(window).data('timeout'));
2014-11-20 23:13:01 +00:00
lychee.imageview.removeClass('full');
lychee.header.removeClass('hidden');
lychee.loadingBar.css('opacity', 1);
2014-11-20 23:13:01 +00:00
// Adjust position or size of photo
if ($('#imageview #image.small').length>0) $('#imageview #image').css('margin-top', newMargin);
else $('#imageview #image').removeClass('full');
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
},
2014-03-25 14:15:40 +00:00
2014-11-20 22:30:33 +00:00
hide: function(e, delay) {
2014-11-20 23:13:01 +00:00
var newMargin = -1*($('#imageview #image').height()/2);
2014-11-20 22:30:33 +00:00
if (delay===undefined) delay = 500;
2014-11-20 22:30:33 +00:00
if (visible.photo()&&!visible.infobox()&&!visible.contextMenu()&&!visible.message()) {
2014-11-20 23:13:01 +00:00
clearTimeout($(window).data('timeout'));
2014-11-20 23:13:01 +00:00
$(window).data('timeout', setTimeout(function() {
2014-11-20 23:13:01 +00:00
lychee.imageview.addClass('full');
lychee.header.addClass('hidden');
lychee.loadingBar.css('opacity', 0);
2014-11-20 23:13:01 +00:00
// Adjust position or size of photo
if ($('#imageview #image.small').length>0) $('#imageview #image').css('margin-top', newMargin);
else $('#imageview #image').addClass('full');
2014-11-20 22:30:33 +00:00
}, delay));
2014-11-20 22:30:33 +00:00
}
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
},
2014-11-20 22:30:33 +00:00
mode: function(mode) {
2014-11-20 22:30:33 +00:00
var albumID = album.getID();
2014-09-20 09:34:32 +00:00
2014-11-20 22:30:33 +00:00
switch (mode) {
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
case 'albums':
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
lychee.header.removeClass('view');
$('#tools_album, #tools_photo').hide();
$('#tools_albums').show();
2014-09-20 09:34:32 +00:00
2014-11-20 22:30:33 +00:00
break;
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
case 'album':
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
lychee.header.removeClass('view');
$('#tools_albums, #tools_photo').hide();
$('#tools_album').show();
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
// Hide download button when album empty
album.json.content === false ? $('#button_archive').hide() : $('#button_archive').show();
// Hide download button when not logged in and album not downloadable
if (lychee.publicMode&&album.json.downloadable==='0') $('#button_archive').hide();
if (albumID==='s'||albumID==='f'||albumID==='r') {
$('#button_info_album, #button_trash_album, #button_share_album').hide();
} else if (albumID==='0') {
$('#button_info_album, #button_share_album').hide();
$('#button_trash_album').show();
2014-11-20 22:30:33 +00:00
} else {
2014-11-20 23:13:01 +00:00
$('#button_info_album, #button_trash_album, #button_share_album').show();
2014-11-20 22:30:33 +00:00
}
2014-09-20 09:34:32 +00:00
2014-11-20 22:30:33 +00:00
break;
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
case 'photo':
2014-09-20 09:34:32 +00:00
2014-11-20 23:13:01 +00:00
lychee.header.addClass('view');
$('#tools_albums, #tools_album').hide();
$('#tools_photo').show();
2014-11-20 22:30:33 +00:00
break;
2014-02-23 15:02:01 +00:00
}
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
}
2014-11-20 22:30:33 +00:00
}
2014-11-20 22:30:33 +00:00
view.infobox = {
2014-11-20 22:30:33 +00:00
show: function() {
2014-11-20 23:13:01 +00:00
if (!visible.infobox()) $('body').append("<div id='infobox_overlay' class='fadeIn'></div>");
lychee.infobox.addClass('active');
2014-02-23 15:02:01 +00:00
},
2014-11-20 22:30:33 +00:00
hide: function() {
2014-11-20 23:13:01 +00:00
lychee.animate('#infobox_overlay', 'fadeOut');
setTimeout(function() { $('#infobox_overlay').remove() }, 300);
lychee.infobox.removeClass('active');
2014-11-20 22:30:33 +00:00
}
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
}
2014-11-20 22:30:33 +00:00
view.albums = {
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
init: function() {
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
view.albums.title();
view.albums.content.init();
2014-11-20 22:30:33 +00:00
},
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
title: function() {
2012-10-02 15:48:08 +00:00
2014-11-20 23:13:01 +00:00
lychee.setTitle('Albums', false);
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
},
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
content: {
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
scrollPosition: 0,
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
init: function() {
2014-09-17 21:11:02 +00:00
2014-11-20 23:13:01 +00:00
var smartData = '',
albumsData = '';
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
/* Smart Albums */
albums.parse(albums.json.unsortedAlbum);
albums.parse(albums.json.publicAlbum);
albums.parse(albums.json.starredAlbum);
albums.parse(albums.json.recentAlbum);
2014-11-20 23:13:01 +00:00
if (!lychee.publicMode) smartData = build.divider('Smart Albums') + build.album(albums.json.unsortedAlbum) + build.album(albums.json.starredAlbum) + build.album(albums.json.publicAlbum) + build.album(albums.json.recentAlbum);
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
/* Albums */
if (albums.json.content&&albums.json.num!==0) {
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
$.each(albums.json.content, function() {
albums.parse(this);
2014-09-17 21:11:02 +00:00
2014-11-20 23:13:01 +00:00
// Display albums in reverse order
2014-11-20 22:30:33 +00:00
albumsData = build.album(this) + albumsData;
});
2012-10-02 15:48:08 +00:00
2014-11-20 23:13:01 +00:00
if (!lychee.publicMode) albumsData = build.divider('Albums') + albumsData;
2012-10-02 15:48:08 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
if (smartData===''&&albumsData==='') {
2014-11-20 22:30:33 +00:00
lychee.content.html('');
2014-11-20 23:13:01 +00:00
$('body').append(build.no_content('share'));
2014-11-20 22:30:33 +00:00
} else {
lychee.content.html(smartData + albumsData);
}
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('img[data-type!="nonretina"]').retina();
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
// Restore scroll position
2014-11-20 22:30:33 +00:00
if (view.albums.content.scrollPosition!==null) {
2014-12-04 21:12:29 +00:00
$(document).scrollTop(view.albums.content.scrollPosition);
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
title: function(albumID) {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
var prefix = '',
longTitle = '',
title = albums.json.content[albumID].title;
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
if (albums.json.content[albumID].password) prefix = "<span class='icon-lock'></span> ";
2014-11-20 23:13:01 +00:00
2014-11-20 22:30:33 +00:00
if (title!==null&&title.length>18) {
2014-11-20 23:13:01 +00:00
longTitle = title;
title = title.substr(0, 18) + '...';
2014-02-23 15:02:01 +00:00
}
2014-11-20 23:13:01 +00:00
$('.album[data-id="' + albumID + '"] .overlay h1')
2014-11-20 22:30:33 +00:00
.html(prefix + title)
2014-11-20 23:13:01 +00:00
.attr('title', longTitle);
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
delete: function(albumID) {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('.album[data-id="' + albumID + '"]').css('opacity', 0).animate({
width: 0,
marginLeft: 0
2014-11-20 22:30:33 +00:00
}, 300, function() {
$(this).remove();
2014-11-20 23:13:01 +00:00
if (albums.json.num<=0) lychee.animate('.divider:last-of-type', 'fadeOut');
2014-11-20 22:30:33 +00:00
});
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.album = {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
init: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
album.parse();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.album.infobox();
view.album.title();
view.album.public();
view.album.content.init();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
album.json.init = 1;
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
hide: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.infobox.hide();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
title: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
if ((visible.album()||!album.json.init)&&!visible.photo()) {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
switch (album.getID()) {
2014-11-20 23:13:01 +00:00
case 'f':
lychee.setTitle('Starred', false);
2014-11-20 22:30:33 +00:00
break;
2014-11-20 23:13:01 +00:00
case 's':
lychee.setTitle('Public', false);
2014-11-20 22:30:33 +00:00
break;
2014-11-20 23:13:01 +00:00
case 'r':
lychee.setTitle('Recent', false);
2014-11-20 22:30:33 +00:00
break;
2014-11-20 23:13:01 +00:00
case '0':
lychee.setTitle('Unsorted', false);
2014-11-20 22:30:33 +00:00
break;
default:
2014-11-20 23:13:01 +00:00
if (album.json.init) $('#infobox .attr_title').html(album.json.title + ' ' + build.editIcon('edit_title_album'));
2014-11-20 22:30:33 +00:00
lychee.setTitle(album.json.title, true);
break;
}
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
}
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
content: {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
init: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
var photosData = '';
2014-02-23 15:02:01 +00:00
2014-12-04 21:12:29 +00:00
// Save and reset scroll position
view.albums.content.scrollPosition = $(document).scrollTop();
$('html, body').scrollTop(0);
2014-11-20 22:30:33 +00:00
$.each(album.json.content, function() {
photosData += build.photo(this);
});
lychee.content.html(photosData);
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('img[data-type!="svg"]').retina();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
title: function(photoID) {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
var longTitle = '',
title = album.json.content[photoID].title;
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
if (title!==null&&title.length>18) {
2014-11-20 23:13:01 +00:00
longTitle = title;
title = title.substr(0, 18) + '...';
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('.photo[data-id="' + photoID + '"] .overlay h1')
2014-11-20 22:30:33 +00:00
.html(title)
2014-11-20 23:13:01 +00:00
.attr('title', longTitle);
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
star: function(photoID) {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('.photo[data-id="' + photoID + '"] .icon-star').remove();
if (album.json.content[photoID].star==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge red icon-star'></a>");
2014-02-23 15:02:01 +00:00
},
2014-11-20 22:30:33 +00:00
public: function(photoID) {
2014-08-17 17:06:45 +00:00
2014-11-20 23:13:01 +00:00
$('.photo[data-id="' + photoID + '"] .icon-share').remove();
if (album.json.content[photoID].public==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge red icon-share'></a>");
2014-08-17 17:06:45 +00:00
},
2014-11-20 22:30:33 +00:00
delete: function(photoID) {
2014-11-20 23:13:01 +00:00
$('.photo[data-id="' + photoID + '"]').css('opacity', 0).animate({
width: 0,
marginLeft: 0
2014-11-20 22:30:33 +00:00
}, 300, function() {
$(this).remove();
// Only when search is not active
if (!visible.albums()) {
album.json.num--;
view.album.num();
view.album.title();
}
});
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
description: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('#infobox .attr_description').html(album.json.description + ' ' + build.editIcon('edit_description_album'));
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
num: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('#infobox .attr_images').html(album.json.num);
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
public: function() {
if (album.json.public==1) {
2014-11-20 23:13:01 +00:00
$('#button_share_album a').addClass('active');
$('#button_share_album').attr('title', 'Share Album');
$('.photo .icon-share').remove();
if (album.json.init) $('#infobox .attr_visibility').html('Public');
2014-11-20 22:30:33 +00:00
} else {
2014-11-20 23:13:01 +00:00
$('#button_share_album a').removeClass('active');
$('#button_share_album').attr('title', 'Make Public');
if (album.json.init) $('#infobox .attr_visibility').html('Private');
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
password: function() {
2014-11-20 23:13:01 +00:00
if (album.json.password==1) $('#infobox .attr_password').html('Yes');
else $('#infobox .attr_password').html('No');
2014-02-23 15:02:01 +00:00
},
2014-11-20 22:30:33 +00:00
infobox: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
if ((visible.album()||!album.json.init)&&!visible.photo()) lychee.infobox.html(build.infoboxAlbum(album.json)).show();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.photo = {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
init: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
photo.parse();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.photo.infobox();
view.photo.title();
view.photo.star();
view.photo.public();
view.photo.photo();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
photo.json.init = 1;
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
show: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Change header
2014-11-20 23:13:01 +00:00
lychee.content.addClass('view');
view.header.mode('photo');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Make body not scrollable
2014-11-20 23:13:01 +00:00
$('body').css('overflow', 'hidden');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Fullscreen
$(document)
2014-11-20 23:13:01 +00:00
.bind('mouseenter', view.header.show)
.bind('mouseleave', view.header.hide);
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
lychee.animate(lychee.imageview, 'fadeIn');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
hide: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
view.header.show();
if (visible.infobox) view.infobox.hide();
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
lychee.content.removeClass('view');
view.header.mode('album');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Make body scrollable
2014-11-20 23:13:01 +00:00
$('body').css('overflow', 'auto');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Disable Fullscreen
$(document)
2014-11-20 23:13:01 +00:00
.unbind('mouseenter')
.unbind('mouseleave');
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
// Hide Photo
2014-11-20 23:13:01 +00:00
lychee.animate(lychee.imageview, 'fadeOut');
2014-11-20 22:30:33 +00:00
setTimeout(function() {
lychee.imageview.hide();
view.album.infobox();
}, 300);
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
title: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
if (photo.json.init) $('#infobox .attr_title').html(photo.json.title + ' ' + build.editIcon('edit_title'));
2014-11-20 22:30:33 +00:00
lychee.setTitle(photo.json.title, true);
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
description: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
if (photo.json.init) $('#infobox .attr_description').html(photo.json.description + ' ' + build.editIcon('edit_description'));
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
star: function() {
2014-11-20 23:13:01 +00:00
$('#button_star a').removeClass('icon-star-empty icon-star');
2014-11-20 22:30:33 +00:00
if (photo.json.star==1) {
// Starred
2014-11-20 23:13:01 +00:00
$('#button_star a').addClass('icon-star');
$('#button_star').attr('title', 'Unstar Photo');
2014-11-20 22:30:33 +00:00
} else {
// Unstarred
2014-11-20 23:13:01 +00:00
$('#button_star a').addClass('icon-star-empty');
$('#button_star').attr('title', 'Star Photo');
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
public: function() {
if (photo.json.public==1||photo.json.public==2) {
// Photo public
2014-11-20 23:13:01 +00:00
$('#button_share a').addClass('active');
$('#button_share').attr('title', 'Share Photo');
if (photo.json.init) $('#infobox .attr_visibility').html('Public');
2014-11-20 22:30:33 +00:00
} else {
// Photo private
2014-11-20 23:13:01 +00:00
$('#button_share a').removeClass('active');
$('#button_share').attr('title', 'Make Public');
if (photo.json.init) $('#infobox .attr_visibility').html('Private');
2014-11-20 22:30:33 +00:00
}
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
tags: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
$('#infobox #tags').html(build.tags(photo.json.tags));
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
photo: function() {
2014-09-17 21:11:02 +00:00
2014-11-20 22:30:33 +00:00
lychee.imageview.html(build.imageview(photo.json, photo.getSize(), visible.controls()));
2014-02-23 15:02:01 +00:00
2014-11-20 23:13:01 +00:00
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==='')||lychee.viewMode) $('a#next').hide();
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==='')||lychee.viewMode) $('a#previous').hide();
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
},
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
infobox: function() {
2014-02-23 15:02:01 +00:00
2014-11-20 22:30:33 +00:00
lychee.infobox.html(build.infoboxPhoto(photo.json)).show();
2014-02-23 15:02:01 +00:00
}
2014-11-20 22:30:33 +00:00
}