/**
* @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 += "
" + title + "
";
else album += "
" + 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) {
if (!photoJSON) return "";
var photo = "",
title = photoJSON.title;
if (title.length>18) 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) {
var modal = "";
modal += "";
switch (photoJSON.public) {
case "0":
public = "Private";
break;
case "1":
public = "Public";
break;
case "2":
public = "Public (Album)";
break;
default:
public = "-";
break;
}
editTitleHTML = (forView==true||lychee.publicMode) ? "" : "
";
editDescriptionHTML = (forView==true||lychee.publicMode) ? "" : "
";
infos = [
["", "Basics"],
["Name", photoJSON.title + editTitleHTML],
["Uploaded", photoJSON.sysdate],
["Description", photoJSON.description + editDescriptionHTML],
["", "Image"],
["Size", photoJSON.size],
["Format", photoJSON.type],
["Resolution", photoJSON.width + " x " + photoJSON.height],
["", "Camera"],
["Captured", photoJSON.takedate],
["Make", photoJSON.make],
["Type/Model", photoJSON.model],
["Shutter Speed", photoJSON.shutter],
["Aperture", photoJSON.aperture],
["Focal Length", photoJSON.focal],
["ISO", photoJSON.iso],
["", "Share"],
["Visibility", public]
];
$.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;
}
}