/** * @description This module is used to generate HTML-Code. * @copyright 2015 by Tobias Reich */ build = {} build.iconic = function(icon, classes = '') { return `` } build.divider = function(title) { return `

${ title }

` } build.editIcon = function(id) { return `
${ build.iconic('pencil') }
` } build.multiselect = function(top, left) { return `
` } build.album = function(data) { if (data==null) return '' let { path: thumbPath, hasRetina: thumbRetina } = lychee.retinize(data.thumbs[0]) let 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) return '' let { path: thumbPath, hasRetina: thumbRetina } = lychee.retinize(data.thumbUrl) let 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) return '' let 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) { let 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) { let html = `

${ title }

` let i = 0 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) { let html = '' if (tags!=='') { tags = tags.split(',') tags.forEach(function(tag, index, array) { html += `${ tag }${ build.iconic('x') }` }) } else { html = `
No Tags
` } return html }