/**
* @description This module is used to generate HTML-Code.
* @copyright 2015 by Tobias Reich
*/
window.build = {}
build.iconic = function(icon, classes) {
var html = '';
classes = classes || '';
html = `
`
return html;
}
build.divider = function(title) {
var html = '';
html = `
${ title }
`
return html;
}
build.editIcon = function(id) {
var html = '';
html = `
${ build.iconic('pencil') }
`
return html;
}
build.multiselect = function(top, left) {
var html = '';
html = ``
return html;
}
build.album = function(data) {
if (data===null||data===undefined) return '';
var html = '',
title = data.title,
longTitle = '';
if (title!==null&&title.length>18) {
title = data.title.substr(0, 18) + '...';
longTitle = data.title;
}
var {path: thumbPath, hasRetina: thumbRetina} = lychee.retinize(data.thumbs[0]);
html = `
`
if (size==='big') {
if (visibleControls===true)
html += ``;
else
html += ``;
} else if (size==='medium') {
if (visibleControls===true)
html += ``;
else
html += ``;
} else if (size==='small') {
if (visibleControls===true)
html += ``;
else
html += ``;
}
return html;
}
build.no_content = function(typ) {
var html;
html = `
${ build.iconic(typ) }
`
switch (typ) {
case 'magnifying-glass': html += '
No results
';
break;
case 'eye': html += '
No public albums
';
break;
case 'cog': html += '
No configuration
';
break;
case 'question-mark': html += '
Photo not found
';
break;
}
html += '
';
return html;
}
build.uploadModal = function(title, files) {
var html = '',
i = 0,
file = null;
html = `
${ title }
`
while (i40) file.name = file.name.substr(0, 17) + '...' + file.name.substr(file.name.length-20, 20);
html += `