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;
view.album.public();
view.album.visible();
view.album.downloadable();
view.album.password();

View File

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