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