Updated code style

This commit is contained in:
Tobias Reich 2016-01-24 15:16:03 +01:00
parent eb887c7ca8
commit 606968f349
17 changed files with 218 additions and 207 deletions

View File

@ -2,9 +2,9 @@ function gup(b) {
b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]") b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]")
let a = "[\\?&]" + b + "=([^&#]*)", let a = "[\\?&]" + b + "=([^&#]*)"
d = new RegExp(a), let d = new RegExp(a)
c = d.exec(window.location.href) let c = d.exec(window.location.href)
if (c === null) return '' if (c === null) return ''
else return c[1] else return c[1]

View File

@ -146,9 +146,9 @@ album.add = function() {
album.delete = function(albumIDs) { album.delete = function(albumIDs) {
let action = {}, let action = {}
cancel = {}, let cancel = {}
msg = '' let msg = ''
if (!albumIDs) return false if (!albumIDs) return false
if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ] if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ]
@ -234,8 +234,8 @@ album.delete = function(albumIDs) {
album.setTitle = function(albumIDs) { album.setTitle = function(albumIDs) {
let oldTitle = '', let oldTitle = ''
msg = '' let msg = ''
if (!albumIDs) return false if (!albumIDs) return false
if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ] if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ]
@ -365,12 +365,12 @@ album.setPublic = function(albumID, modal, e) {
if (modal===true) { if (modal===true) {
let text = '', let text = ''
action = {} let action = {}
action.fn = () => { action.fn = () => {
// setPublic function without showing the modal // Call setPublic function without showing the modal
album.setPublic(album.getID(), false, e) album.setPublic(album.getID(), false, e)
} }
@ -515,8 +515,8 @@ album.setPublic = function(albumID, modal, e) {
album.share = function(service) { album.share = function(service) {
let link = '', let link = ''
url = location.href let url = location.href
switch (service) { switch (service) {
case 'twitter': case 'twitter':
@ -539,8 +539,8 @@ album.share = function(service) {
album.getArchive = function(albumID) { album.getArchive = function(albumID) {
let link, let link = ''
url = `${ api.path }?function=Album::getArchive&albumID=${ albumID }` let url = `${ api.path }?function=Album::getArchive&albumID=${ albumID }`
if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url) if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url)
else link = location.href.replace(location.hash, '') + url else link = location.href.replace(location.hash, '') + url
@ -553,9 +553,9 @@ album.getArchive = function(albumID) {
album.merge = function(albumIDs) { album.merge = function(albumIDs) {
let title = '', let title = ''
sTitle = '', let sTitle = ''
msg = '' let msg = ''
if (!albumIDs) return false if (!albumIDs) return false
if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ] if (albumIDs instanceof Array===false) albumIDs = [ albumIDs ]

View File

@ -134,7 +134,7 @@ albums.deleteByID = function(albumID) {
if (!albums.json) return false if (!albums.json) return false
if (!albums.json.albums) return false if (!albums.json.albums) return false
var deleted = false let deleted = false
$.each(albums.json.albums, function(i) { $.each(albums.json.albums, function(i) {

View File

@ -31,9 +31,9 @@ api.post = function(fn, params, callback) {
else if (data==='') data = false else if (data==='') data = false
// Convert to JSON if string start with '{' and ends with '}' // Convert to JSON if string start with '{' and ends with '}'
if (typeof data==='string' && if (typeof data==='string' && data.substring(0, 1)==='{' && data.substring(data.length - 1, data.length)==='}') {
data.substring(0, 1)==='{' && data = $.parseJSON(data)
data.substring(data.length-1, data.length)==='}') data = $.parseJSON(data) }
// Output response when debug mode is enabled // Output response when debug mode is enabled
if (lychee.debugMode) console.log(data) if (lychee.debugMode) console.log(data)

View File

@ -115,8 +115,8 @@ build.photo = function(data) {
build.imageview = function(data, visibleControls) { build.imageview = function(data, visibleControls) {
let html = '', let html = ''
hasMedium = data.medium!=='' let hasMedium = data.medium!==''
if (hasMedium===false) { if (hasMedium===false) {

View File

@ -236,7 +236,7 @@ contextMenu.photoMore = function(photoID, e) {
contextMenu.move = function(photoIDs, e) { contextMenu.move = function(photoIDs, e) {
var items = [] let items = []
api.post('Album::getAll', {}, function(data) { api.post('Album::getAll', {}, function(data) {
@ -278,8 +278,8 @@ contextMenu.move = function(photoIDs, e) {
contextMenu.sharePhoto = function(photoID, e) { contextMenu.sharePhoto = function(photoID, e) {
let link = photo.getViewLink(photoID), let link = photo.getViewLink(photoID)
iconClass = 'ionicons' let iconClass = 'ionicons'
let items = [ let items = [
{ title: `<input readonly id="link" value="${ link }">`, fn: () => {}, class: 'basicContext__item--noHover' }, { title: `<input readonly id="link" value="${ link }">`, fn: () => {}, class: 'basicContext__item--noHover' },

View File

@ -99,8 +99,8 @@ header.hide = function(e, delay = 500) {
header.setTitle = function(title = 'Untitled') { header.setTitle = function(title = 'Untitled') {
let $title = header.dom('.header__title'), let $title = header.dom('.header__title')
html = lychee.html`$${ title }${ build.iconic('caret-bottom') }` let html = lychee.html`$${ title }${ build.iconic('caret-bottom') }`
$title.html(html) $title.html(html)

View File

@ -24,31 +24,31 @@ $(document).ready(function() {
// Keyboard // Keyboard
Mousetrap Mousetrap
.bind('left', function() { .bind([ 'left' ], function() {
if (visible.photo()) { $('#imageview a#previous').click(); return false } if (visible.photo()) { $('#imageview a#previous').click(); return false }
}) })
.bind('right', function() { .bind([ 'right' ], function() {
if (visible.photo()) { $('#imageview a#next').click(); return false } if (visible.photo()) { $('#imageview a#next').click(); return false }
}) })
.bind('u', function() { .bind([ 'u' ], function() {
if (!visible.photo()) { $('#upload_files').click(); return false } if (!visible.photo()) { $('#upload_files').click(); return false }
}) })
.bind([ 's', 'f' ], function() { .bind([ 's', 'f' ], function() {
if (visible.photo()) { header.dom('#button_star').click(); return false } if (visible.photo()) { header.dom('#button_star').click(); return false }
else if (visible.albums()) { header.dom('.header__search').focus(); return false } else if (visible.albums()) { header.dom('.header__search').focus(); return false }
}) })
.bind('r', function() { .bind([ 'r' ], function() {
if (visible.album()) { album.setTitle(album.getID()); return false } if (visible.album()) { album.setTitle(album.getID()); return false }
else if (visible.photo()) { photo.setTitle([photo.getID()]); return false } else if (visible.photo()) { photo.setTitle([photo.getID()]); return false }
}) })
.bind('d', function() { .bind([ 'd' ], function() {
if (visible.photo()) { photo.setDescription(photo.getID()); return false } if (visible.photo()) { photo.setDescription(photo.getID()); return false }
else if (visible.album()) { album.setDescription(album.getID()); return false } else if (visible.album()) { album.setDescription(album.getID()); return false }
}) })
.bind('t', function() { .bind([ 't' ], function() {
if (visible.photo()) { photo.editTags([photo.getID()]); return false } if (visible.photo()) { photo.editTags([photo.getID()]); return false }
}) })
.bind('i', function() { .bind([ 'i' ], function() {
if (!visible.multiselect()) { sidebar.toggle(); return false } if (!visible.multiselect()) { sidebar.toggle(); return false }
}) })
.bind([ 'command+backspace', 'ctrl+backspace' ], function() { .bind([ 'command+backspace', 'ctrl+backspace' ], function() {

View File

@ -84,8 +84,8 @@ lychee.init = function() {
lychee.login = function(data) { lychee.login = function(data) {
let user = data.username, let user = data.username
password = data.password let password = data.password
let params = { let params = {
user, user,
@ -169,9 +169,9 @@ lychee.goto = function(url) {
lychee.load = function() { lychee.load = function() {
let albumID = '', let albumID = ''
photoID = '', let photoID = ''
hash = document.location.hash.replace('#', '').split('/') let hash = document.location.hash.replace('#', '').split('/')
$('.no_content').remove() $('.no_content').remove()
contextMenu.close() contextMenu.close()
@ -227,9 +227,13 @@ lychee.load = function() {
lychee.getUpdate = function() { lychee.getUpdate = function() {
const success = function(data) {
if (data.lychee.version>parseInt(lychee.versionCode)) $('.version span').show()
}
$.ajax({ $.ajax({
url : lychee.updatePath, url : lychee.updatePath,
success : function(data) { if (data.lychee.version>parseInt(lychee.versionCode)) $('.version span').show() }, success : success
}) })
} }
@ -256,12 +260,12 @@ lychee.setMode = function(mode) {
.off('drop') .off('drop')
Mousetrap Mousetrap
.unbind('u') .unbind([ 'u' ])
.unbind('s') .unbind([ 's' ])
.unbind('f') .unbind([ 'f' ])
.unbind('r') .unbind([ 'r' ])
.unbind('d') .unbind([ 'd' ])
.unbind('t') .unbind([ 't' ])
.unbind([ 'command+backspace', 'ctrl+backspace' ]) .unbind([ 'command+backspace', 'ctrl+backspace' ])
.unbind([ 'command+a', 'ctrl+a' ]) .unbind([ 'command+a', 'ctrl+a' ])
@ -272,6 +276,7 @@ lychee.setMode = function(mode) {
} else if (mode==='view') { } else if (mode==='view') {
Mousetrap.unbind([ 'esc', 'command+up' ]) Mousetrap.unbind([ 'esc', 'command+up' ])
$('#button_back, a#next, a#previous').remove() $('#button_back, a#next, a#previous').remove()
$('.no_content').remove() $('.no_content').remove()
@ -306,8 +311,8 @@ lychee.animate = function(obj, animation) {
lychee.retinize = function(path = '') { lychee.retinize = function(path = '') {
let extention = path.split('.').pop(), let extention = path.split('.').pop()
isPhoto = extention!=='svg' let isPhoto = extention!=='svg'
if (isPhoto===true) { if (isPhoto===true) {
@ -329,8 +334,8 @@ lychee.loadDropbox = function(callback) {
loadingBar.show() loadingBar.show()
let g = document.createElement('script'), let g = document.createElement('script')
s = document.getElementsByTagName('script')[0] let s = document.getElementsByTagName('script')[0]
g.src = 'https://www.dropbox.com/static/api/1/dropins.js' g.src = 'https://www.dropbox.com/static/api/1/dropins.js'
g.id = 'dropboxjs' g.id = 'dropboxjs'
@ -360,8 +365,8 @@ lychee.loadDropbox = function(callback) {
lychee.getEventName = function() { lychee.getEventName = function() {
let touchendSupport = (/Android|iPhone|iPad|iPod/i).test(navigator.userAgent || navigator.vendor || window.opera) && ('ontouchend' in document.documentElement), let touchendSupport = (/Android|iPhone|iPad|iPod/i).test(navigator.userAgent || navigator.vendor || window.opera) && ('ontouchend' in document.documentElement)
eventName = (touchendSupport===true ? 'touchend' : 'click') let eventName = (touchendSupport===true ? 'touchend' : 'click')
return eventName return eventName
@ -388,8 +393,8 @@ lychee.html = function(literalSections, ...substs) {
// Use raw literal sections: we dont want // Use raw literal sections: we dont want
// backslashes (\n etc.) to be interpreted // backslashes (\n etc.) to be interpreted
let raw = literalSections.raw, let raw = literalSections.raw
result = '' let result = ''
substs.forEach((subst, i) => { substs.forEach((subst, i) => {

View File

@ -89,8 +89,8 @@ multiselect.resize = function(e) {
multiselect.position.bottom === null || multiselect.position.bottom === null ||
multiselect.position.left === null) return false multiselect.position.left === null) return false
let newSize = {}, let newSize = {}
documentSize = {} let documentSize = {}
// Get the position of the mouse // Get the position of the mouse
let mousePos = { let mousePos = {
@ -167,8 +167,8 @@ multiselect.getSize = function() {
if (!visible.multiselect()) return false if (!visible.multiselect()) return false
let $elem = $('#multiselect'), let $elem = $('#multiselect')
offset = $elem.offset() let offset = $elem.offset()
return { return {
top : offset.top, top : offset.top,
@ -181,9 +181,9 @@ multiselect.getSize = function() {
multiselect.getSelection = function(e) { multiselect.getSelection = function(e) {
let tolerance = 150, let tolerance = 150
ids = [], let ids = []
size = multiselect.getSize() let size = multiselect.getSize()
if (visible.contextMenu()) return false if (visible.contextMenu()) return false
if (!visible.multiselect()) return false if (!visible.multiselect()) return false

View File

@ -71,8 +71,8 @@ photo.preloadNext = function(photoID) {
album.json.content[photoID] && album.json.content[photoID] &&
album.json.content[photoID].nextPhoto!='') { album.json.content[photoID].nextPhoto!='') {
let nextPhoto = album.json.content[photoID].nextPhoto, let nextPhoto = album.json.content[photoID].nextPhoto
url = album.json.content[nextPhoto].url let url = album.json.content[nextPhoto].url
$('head [data-prefetch]').remove() $('head [data-prefetch]').remove()
$('head').append(`<link data-prefetch rel="prefetch" href="${ url }">`) $('head').append(`<link data-prefetch rel="prefetch" href="${ url }">`)
@ -171,10 +171,10 @@ photo.duplicate = function(photoIDs) {
photo.delete = function(photoIDs) { photo.delete = function(photoIDs) {
let action = {}, let action = {}
cancel = {}, let cancel = {}
msg = '', let msg = ''
photoTitle = '' let photoTitle = ''
if (!photoIDs) return false if (!photoIDs) return false
if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ] if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ]
@ -192,8 +192,8 @@ photo.delete = function(photoIDs) {
action.fn = function() { action.fn = function() {
let nextPhoto, let nextPhoto
previousPhoto let previousPhoto
basicModal.close() basicModal.close()
@ -269,8 +269,8 @@ photo.delete = function(photoIDs) {
photo.setTitle = function(photoIDs) { photo.setTitle = function(photoIDs) {
let oldTitle = '', let oldTitle = ''
msg = '' let msg = ''
if (!photoIDs) return false if (!photoIDs) return false
if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ] if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ]
@ -335,8 +335,8 @@ photo.setTitle = function(photoIDs) {
photo.setAlbum = function(photoIDs, albumID) { photo.setAlbum = function(photoIDs, albumID) {
let nextPhoto, let nextPhoto
previousPhoto let previousPhoto
if (!photoIDs) return false if (!photoIDs) return false
if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ] if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ]
@ -416,7 +416,7 @@ photo.setPublic = function(photoID, e) {
} }
basicModal.show({ basicModal.show({
body: "<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>", body: '<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>',
buttons: { buttons: {
action: { action: {
title: 'Show Album', title: 'Show Album',
@ -500,8 +500,8 @@ photo.setDescription = function(photoID) {
photo.editTags = function(photoIDs) { photo.editTags = function(photoIDs) {
let oldTags = '', let oldTags = ''
msg = '' let msg = ''
if (!photoIDs) return false if (!photoIDs) return false
if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ] if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ]
@ -597,8 +597,8 @@ photo.deleteTag = function(photoID, index) {
photo.share = function(photoID, service) { photo.share = function(photoID, service) {
let link = '', let link = ''
url = photo.getViewLink(photoID) let url = photo.getViewLink(photoID)
switch (service) { switch (service) {
case 'twitter': case 'twitter':
@ -627,8 +627,8 @@ photo.share = function(photoID, service) {
photo.getArchive = function(photoID) { photo.getArchive = function(photoID) {
let link, let link
url = `${ api.path }?function=Photo::getArchive&photoID=${ photoID }` let url = `${ api.path }?function=Photo::getArchive&photoID=${ photoID }`
if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url) if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url)
else link = location.href.replace(location.hash, '') + url else link = location.href.replace(location.hash, '') + url

View File

@ -19,9 +19,9 @@ search.find = function(term) {
api.post('search', { term }, function(data) { api.post('search', { term }, function(data) {
let html = '', let html = ''
albumsData = '', let albumsData = ''
photosData = '' let photosData = ''
// Build albums // Build albums
if (data && data.albums) { if (data && data.albums) {

View File

@ -9,11 +9,11 @@ settings.createConfig = function() {
const action = function(data) { const action = function(data) {
let dbName = data.dbName || '', let dbName = data.dbName || ''
dbUser = data.dbUser || '', let dbUser = data.dbUser || ''
dbPassword = data.dbPassword || '', let dbPassword = data.dbPassword || ''
dbHost = data.dbHost || '', let dbHost = data.dbHost || ''
dbTablePrefix = data.dbTablePrefix || '' let dbTablePrefix = data.dbTablePrefix || ''
if (dbUser.length<1) { if (dbUser.length<1) {
basicModal.error('dbUser') basicModal.error('dbUser')
@ -140,8 +140,8 @@ settings.createLogin = function() {
const action = function(data) { const action = function(data) {
let username = data.username, let username = data.username
password = data.password let password = data.password
if (username.length<1) { if (username.length<1) {
basicModal.error('username') basicModal.error('username')
@ -204,9 +204,9 @@ settings.setLogin = function() {
const action = function(data) { const action = function(data) {
let oldPassword = data.oldPassword || '', let oldPassword = data.oldPassword || ''
username = data.username || '', let username = data.username || ''
password = data.password || '' let password = data.password || ''
if (oldPassword.length<1) { if (oldPassword.length<1) {
basicModal.error('oldPassword') basicModal.error('oldPassword')
@ -269,8 +269,8 @@ settings.setLogin = function() {
settings.setSorting = function() { settings.setSorting = function() {
let sortingPhotos = [], let sortingPhotos = []
sortingAlbums = [] let sortingAlbums = []
const action = function() { const action = function() {

View File

@ -30,7 +30,7 @@ sidebar.bind = function() {
// event handlers should be removed before binding a new one. // event handlers should be removed before binding a new one.
// Event Name // Event Name
let eventName = lychee.getEventName(); let eventName = lychee.getEventName()
sidebar sidebar
.dom('#edit_title') .dom('#edit_title')
@ -114,10 +114,10 @@ sidebar.createStructure.photo = function(data) {
if (data==null || data==='') return false if (data==null || data==='') return false
let editable = false, let editable = false
exifHash = data.takestamp + data.make + data.model + data.shutter + data.aperture + data.focal + data.iso, let exifHash = data.takestamp + data.make + data.model + data.shutter + data.aperture + data.focal + data.iso
structure = {}, let structure = {}
_public = '' let _public = ''
// Enable editable when user logged in // Enable editable when user logged in
if (lychee.publicMode===false) editable = true if (lychee.publicMode===false) editable = true
@ -220,12 +220,12 @@ sidebar.createStructure.album = function(data) {
if (data==null || data==='') return false if (data==null || data==='') return false
let editable = false, let editable = false
structure = {}, let structure = {}
_public = '', let _public = ''
visible = '', let visible = ''
downloadable = '', let downloadable = ''
password = '' let password = ''
// Enable editable when user logged in // Enable editable when user logged in
if (lychee.publicMode===false) editable = true if (lychee.publicMode===false) editable = true
@ -367,8 +367,8 @@ sidebar.render = function(structure) {
let renderTags = function(section) { let renderTags = function(section) {
let _html = '', let _html = ''
editable = '' let editable = ''
// Add edit-icon to the value when editable // Add edit-icon to the value when editable
if (section.editable===true) editable = build.editIcon('edit_tags') if (section.editable===true) editable = build.editIcon('edit_tags')

View File

@ -40,16 +40,16 @@ upload.start = {
local: function(files) { local: function(files) {
let albumID = album.getID(), let albumID = album.getID()
error = false, let error = false
warning = false let warning = false
const process = function(files, file) { const process = function(files, file) {
let formData = new FormData(), let formData = new FormData()
xhr = new XMLHttpRequest(), let xhr = new XMLHttpRequest()
pre_progress = 0, let pre_progress = 0
progress = 0 let progress = 0
const finish = function() { const finish = function() {
@ -122,8 +122,8 @@ upload.start = {
xhr.onload = function() { xhr.onload = function() {
let wait = false, let wait = false
errorText = '' let errorText = ''
file.ready = true file.ready = true

View File

@ -26,8 +26,8 @@ view.albums = {
init: function() { init: function() {
let smartData = '', let smartData = ''
albumsData = '' let albumsData = ''
// Smart Albums // Smart Albums
if (lychee.publicMode===false) { if (lychee.publicMode===false) {
@ -271,8 +271,8 @@ view.album = {
if ((visible.album() || !album.json.init) && !visible.photo()) { if ((visible.album() || !album.json.init) && !visible.photo()) {
let structure = sidebar.createStructure.album(album.json), let structure = sidebar.createStructure.album(album.json)
html = sidebar.render(structure) let html = sidebar.render(structure)
sidebar.dom('.sidebar__wrapper').html(html) sidebar.dom('.sidebar__wrapper').html(html)
sidebar.bind() sidebar.bind()
@ -408,27 +408,33 @@ view.photo = {
lychee.imageview.html(build.imageview(photo.json, visible.header())) lychee.imageview.html(build.imageview(photo.json, visible.header()))
let $nextArrow = lychee.imageview.find('a#next'), let $nextArrow = lychee.imageview.find('a#next')
$previousArrow = lychee.imageview.find('a#previous'), let $previousArrow = lychee.imageview.find('a#previous')
photoID = photo.getID(), let photoID = photo.getID()
hasNext = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].nextPhoto!=='', let hasNext = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].nextPhoto!==''
hasPrevious = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].previousPhoto!=='' let hasPrevious = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].previousPhoto!==''
if (hasNext===false || lychee.viewMode===true) { $nextArrow.hide() } if (hasNext===false || lychee.viewMode===true) {
else {
let nextPhotoID = album.json.content[photoID].nextPhoto, $nextArrow.hide()
nextPhoto = album.json.content[nextPhotoID]
} else {
let nextPhotoID = album.json.content[photoID].nextPhoto
let nextPhoto = album.json.content[nextPhotoID]
$nextArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ nextPhoto.thumbUrl }")`) $nextArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ nextPhoto.thumbUrl }")`)
} }
if (hasPrevious===false || lychee.viewMode===true) { $previousArrow.hide() } if (hasPrevious===false || lychee.viewMode===true) {
else {
let previousPhotoID = album.json.content[photoID].previousPhoto, $previousArrow.hide()
previousPhoto = album.json.content[previousPhotoID]
} else {
let previousPhotoID = album.json.content[photoID].previousPhoto
let previousPhoto = album.json.content[previousPhotoID]
$previousArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ previousPhoto.thumbUrl }")`) $previousArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ previousPhoto.thumbUrl }")`)
@ -438,8 +444,8 @@ view.photo = {
sidebar: function() { sidebar: function() {
let structure = sidebar.createStructure.photo(photo.json), let structure = sidebar.createStructure.photo(photo.json)
html = sidebar.render(structure) let html = sidebar.render(structure)
sidebar.dom('.sidebar__wrapper').html(html) sidebar.dom('.sidebar__wrapper').html(html)
sidebar.bind() sidebar.bind()

View File

@ -11,8 +11,8 @@ lychee.content = $('.content')
lychee.getEventName = function() { lychee.getEventName = function() {
let touchendSupport = (/Android|iPhone|iPad|iPod/i).test(navigator.userAgent || navigator.vendor || window.opera) && ('ontouchend' in document.documentElement), let touchendSupport = (/Android|iPhone|iPad|iPod/i).test(navigator.userAgent || navigator.vendor || window.opera) && ('ontouchend' in document.documentElement)
eventName = (touchendSupport===true ? 'touchend' : 'click') let eventName = (touchendSupport===true ? 'touchend' : 'click')
return eventName return eventName
@ -39,8 +39,8 @@ lychee.html = function(literalSections, ...substs) {
// Use raw literal sections: we dont want // Use raw literal sections: we dont want
// backslashes (\n etc.) to be interpreted // backslashes (\n etc.) to be interpreted
let raw = literalSections.raw, let raw = literalSections.raw
result = '' let result = ''
substs.forEach((subst, i) => { substs.forEach((subst, i) => {
@ -127,8 +127,8 @@ const loadPhotoInfo = function(photoID) {
imageview.addClass('fadeIn').show() imageview.addClass('fadeIn').show()
// Render Sidebar // Render Sidebar
let structure = sidebar.createStructure.photo(data), let structure = sidebar.createStructure.photo(data)
html = sidebar.render(structure) let html = sidebar.render(structure)
sidebar.dom('.sidebar__wrapper').html(html) sidebar.dom('.sidebar__wrapper').html(html)
sidebar.bind() sidebar.bind()