/** * @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 = ''; var {path: thumbPath, hasRetina: thumbRetina} = lychee.retinize(data.thumbs[0]); html = `
thumb thumb thumb

${ data.title }

${ data.sysdate }
` if (lychee.publicMode===false) { if (data.star==='1') html += `${ build.iconic('star') }`; if (data.public==='1') html += `${ build.iconic('eye') }`; if (data.unsorted==='1') html += `${ build.iconic('list') }`; if (data.recent==='1') html += `${ build.iconic('clock') }`; if (data.password==='1') html += `${ build.iconic('lock-locked') }`; } html += '
' return html; } build.photo = function(data) { if (data===null||data===undefined) return ''; var html = ''; var {path: thumbPath, hasRetina: thumbRetina} = lychee.retinize(data.thumbUrl); html = `
thumb

${ data.title }

` if (data.cameraDate==='1') html += `${ build.iconic('camera-slr') }${ data.sysdate }`; else html += `${ data.sysdate }`; html += '
'; if (lychee.publicMode===false) { if (data.star==='1') html += `${ build.iconic('star') }`; if (data.public==='1'&&album.json.public!=='1') html += `${ build.iconic('eye') }`; } html += '
'; return html } build.imageview = function(data, size, visibleControls) { if (data===null||data===undefined) return ''; var html = ''; 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 += `
${ lychee.escapeHTML(file.name) } ` if (file.supported===true) html += ``; else html += `Not supported`; html += `

` i++; } html += '
'; return html; } build.tags = function(tags) { var html = '', editTagsHTML = ''; if (tags!=='') { tags = tags.split(','); tags.forEach(function(tag, index, array) { html += `${ tag }${ build.iconic('x') }` }); } else { html = `
No Tags
`; } return html; }