Added 'visible' to album sidebar

This commit is contained in:
Tobias Reich 2015-03-15 21:57:25 +01:00
parent 9725eb707d
commit 93fc15532a
4 changed files with 46 additions and 24 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -505,6 +505,7 @@ album.setPublic = function(albumID, modal, e) {
album.json.password = (album.json.public==='0') ? '0' : album.json.password; album.json.password = (album.json.public==='0') ? '0' : album.json.password;
view.album.public(); view.album.public();
view.album.visible();
view.album.downloadable(); view.album.downloadable();
view.album.password(); view.album.password();

View File

@ -113,7 +113,7 @@ sidebar.createStructure.photo = function(data) {
var editable = false, var editable = false,
exifHash = data.takestamp + data.make + data.model + data.shutter + data.aperture + data.focal + data.iso, exifHash = data.takestamp + data.make + data.model + data.shutter + data.aperture + data.focal + data.iso,
structure = {}, structure = {},
visible = ''; public = '';
// Enable editable when user logged in // Enable editable when user logged in
if (lychee.publicMode===false) editable = true; if (lychee.publicMode===false) editable = true;
@ -121,13 +121,13 @@ sidebar.createStructure.photo = function(data) {
// Set value for public // Set value for public
switch (data.public) { switch (data.public) {
case '0': visible = 'No'; case '0': public = 'No';
break; break;
case '1': visible = 'Yes'; case '1': public = 'Yes';
break; break;
case '2': visible = 'Yes (Album)'; case '2': public = 'Yes (Album)';
break; break;
default: visible = '-'; default: public = '-';
break; break;
} }
@ -195,7 +195,7 @@ sidebar.createStructure.photo = function(data) {
title: 'Sharing', title: 'Sharing',
type: sidebar.types.DEFAULT, type: sidebar.types.DEFAULT,
rows: [ rows: [
{ title: 'Public', value: visible }, { title: 'Public', value: public },
] ]
} }
@ -218,9 +218,10 @@ sidebar.createStructure.album = function(data) {
var editable = false, var editable = false,
structure = {}, structure = {},
public = '',
visible = '', visible = '',
password = '', downloadable = '',
downloadable = ''; password = '';
// Enable editable when user logged in // Enable editable when user logged in
if (lychee.publicMode===false) editable = true; if (lychee.publicMode===false) editable = true;
@ -228,6 +229,18 @@ sidebar.createStructure.album = function(data) {
// Set value for public // Set value for public
switch (data.public) { switch (data.public) {
case '0': public = 'No';
break;
case '1': public = 'Yes';
break;
default: public = '-';
break;
}
// Set value for visible
switch (data.visible) {
case '0': visible = 'No'; case '0': visible = 'No';
break; break;
case '1': visible = 'Yes'; case '1': visible = 'Yes';
@ -237,18 +250,6 @@ sidebar.createStructure.album = function(data) {
} }
// Set value for password
switch (data.password) {
case '0': password = 'No';
break;
case '1': password = 'Yes';
break;
default: password = '-';
break;
}
// Set value for downloadable // Set value for downloadable
switch (data.downloadable) { switch (data.downloadable) {
@ -261,6 +262,18 @@ sidebar.createStructure.album = function(data) {
} }
// Set value for password
switch (data.password) {
case '0': password = 'No';
break;
case '1': password = 'Yes';
break;
default: password = '-';
break;
}
structure.basics = { structure.basics = {
title: 'Basics', title: 'Basics',
type: sidebar.types.DEFAULT, type: sidebar.types.DEFAULT,
@ -283,7 +296,8 @@ sidebar.createStructure.album = function(data) {
title: 'Share', title: 'Share',
type: sidebar.types.DEFAULT, type: sidebar.types.DEFAULT,
rows: [ rows: [
{ title: 'Public', value: visible }, { title: 'Public', value: public },
{ title: 'Visible', value: visible },
{ title: 'Downloadable', value: downloadable }, { title: 'Downloadable', value: downloadable },
{ title: 'Password', value: password } { title: 'Password', value: password }
] ]

View File

@ -249,10 +249,10 @@ view.album = {
}, },
password: function() { visible: function() {
if (album.json.password==='1') sidebar.changeAttr('password', 'Yes'); if (album.json.visible==='1') sidebar.changeAttr('visible', 'Yes');
else sidebar.changeAttr('password', 'No'); else sidebar.changeAttr('visible', 'No');
}, },
@ -263,6 +263,13 @@ view.album = {
}, },
password: function() {
if (album.json.password==='1') sidebar.changeAttr('password', 'Yes');
else sidebar.changeAttr('password', 'No');
},
sidebar: function() { sidebar: function() {
if ((visible.album()||!album.json.init)&&!visible.photo()) { if ((visible.album()||!album.json.init)&&!visible.photo()) {