/**
* @name build.js
* @author Philipp Maurer
* @author Tobias Reich
* @copyright 2013 by Philipp Maurer, Tobias Reich
*
* Build Module
* This module is used to generate HTML-Code.
*/
build = {
divider: function(title) {
return "
";
album += "

";
album += "

";
album += "

";
album += "
";
if (albumJSON.password&&!lychee.publicMode) album += "
" + albumJSON.title + "
";
else album += "
" + albumJSON.title + "
";
album += "
" + albumJSON.sysdate + "";
album += "
";
if(!lychee.publicMode&&albumJSON.star=="1") album += "
";
if(!lychee.publicMode&&albumJSON.public=="1") album += "
";
if(!lychee.publicMode&&albumJSON.unsorted=="1") album += "
";
album += "
";
return album;
},
photo: function(photoJSON) {
var photo = "";
if(photoJSON=="") return "";
if(!photoJSON.title) photoJSON.title = "";
if(!photoJSON.thumbUrl) photoJSON.thumbUrl = "img/no_image.png";
if(photoJSON.title.length>18) photoJSON.title = photoJSON.title.substr(0, 18) + "...";
photo += "";
no_content += "
";
if (typ=="search") no_content += "
No results
";
else if (typ=="picture") no_content += "
No public albums
";
no_content += "
";
return no_content;
},
modal: function(title, text, button, func) {
var modal = "";
modal += "";
if (photo.public==1) photo.public = "Public"; else photo.public = "Private";
if (forView==true||lychee.publicMode) editTitleHTML = ""; else editTitleHTML = "
";
if (forView==true||lychee.publicMode) editDescriptionHTML = ""; else editDescriptionHTML = "
";
infos = [
["", "Basics"],
["Name", photo.title + editTitleHTML],
["Uploaded", photo.sysdate],
["Description", photo.description + editDescriptionHTML],
["", "Image"],
["Size", photo.size],
["Format", photo.type],
["Resolution", photo.width + " x " + photo.height],
["", "Camera"],
["Captured", photo.takedate],
["Make", photo.make],
["Type/Model", photo.model],
["Shutter Speed", photo.shutter],
["Aperture", photo.aperture],
["Focal Length", photo.focal],
["ISO", photo.iso],
["", "Share"],
["Visibility", photo.public],
["Short Link", photo.shortlink]
];
$.each(infos, function(index) {
if (infos[index][1]==""||infos[index][1]==undefined||infos[index][1]==null) infos[index][1] = "-";
if (infos[index][0]=="") {
infobox += "";
infobox += "
" + infos[index][1] + "
";
infobox += "
";
} else {
infobox += "";
infobox += "" + infos[index][0] + " | ";
infobox += "" + infos[index][1] + " | ";
infobox += "
";
}
});
infobox += "
";
infobox += "
";
infobox += "
";
return infobox;
}
}