Catch "photo not found" in view.php

This commit is contained in:
Tobias Reich 2015-04-06 21:10:33 +02:00
parent 6303adc679
commit 0f8bf0f8e1
2 changed files with 12 additions and 0 deletions

View File

@ -195,6 +195,8 @@ build.no_content = function(typ) {
break; break;
case 'cog': html += '<p>No configuration</p>'; case 'cog': html += '<p>No configuration</p>';
break; break;
case 'question-mark': html += '<p>Photo not found</p>';
break;
} }
html += '</div>'; html += '</div>';

View File

@ -81,6 +81,16 @@ loadPhotoInfo = function(photoID) {
api.post('Photo::get', params, function(data) { api.post('Photo::get', params, function(data) {
if (data==='Warning: Photo private!'||
data==='Warning: Wrong password!') {
$('body').append(build.no_content('question-mark'));
$('body').removeClass('view');
header.dom().remove();
return false;
}
/* Set title */ /* Set title */
if (!data.title) data.title = 'Untitled'; if (!data.title) data.title = 'Untitled';