Changed spaces to tabs for indentation
This commit is contained in:
parent
1671517f41
commit
fa8cad02bb
@ -114,9 +114,9 @@ album = {
|
|||||||
if (data===true) data = 1; // Avoid first album to be true
|
if (data===true) data = 1; // Avoid first album to be true
|
||||||
|
|
||||||
if (data!==false&&isNumber(data)) {
|
if (data!==false&&isNumber(data)) {
|
||||||
albums.refresh();
|
albums.refresh();
|
||||||
lychee.goto(data);
|
lychee.goto(data);
|
||||||
}
|
}
|
||||||
else lychee.error(null, params, data);
|
else lychee.error(null, params, data);
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -149,7 +149,7 @@ album = {
|
|||||||
albumIDs.forEach(function(id, index, array) {
|
albumIDs.forEach(function(id, index, array) {
|
||||||
albums.json.num--;
|
albums.json.num--;
|
||||||
view.albums.content.delete(id);
|
view.albums.content.delete(id);
|
||||||
delete albums.json.content[id]
|
delete albums.json.content[id]
|
||||||
});
|
});
|
||||||
|
|
||||||
} else lychee.goto("");
|
} else lychee.goto("");
|
||||||
@ -294,7 +294,7 @@ album = {
|
|||||||
listed = false,
|
listed = false,
|
||||||
downloadable = false;
|
downloadable = false;
|
||||||
|
|
||||||
albums.refresh();
|
albums.refresh();
|
||||||
|
|
||||||
if (!visible.message()&&album.json.public==0) {
|
if (!visible.message()&&album.json.public==0) {
|
||||||
|
|
||||||
|
@ -18,72 +18,72 @@ albums = {
|
|||||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
||||||
lychee.animate(".divider", "fadeOut");
|
lychee.animate(".divider", "fadeOut");
|
||||||
|
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
|
|
||||||
|
|
||||||
if(this.json == null) {
|
if(this.json == null) {
|
||||||
lychee.api("getAlbums", function(data) {
|
lychee.api("getAlbums", function(data) {
|
||||||
|
|
||||||
/* Smart Albums */
|
/* Smart Albums */
|
||||||
data.unsortedAlbum = {
|
data.unsortedAlbum = {
|
||||||
id: 0,
|
id: 0,
|
||||||
title: "Unsorted",
|
title: "Unsorted",
|
||||||
sysdate: data.unsortedNum + " photos",
|
sysdate: data.unsortedNum + " photos",
|
||||||
unsorted: 1,
|
unsorted: 1,
|
||||||
thumb0: data.unsortedThumb0,
|
thumb0: data.unsortedThumb0,
|
||||||
thumb1: data.unsortedThumb1,
|
thumb1: data.unsortedThumb1,
|
||||||
thumb2: data.unsortedThumb2
|
thumb2: data.unsortedThumb2
|
||||||
};
|
};
|
||||||
|
|
||||||
data.starredAlbum = {
|
data.starredAlbum = {
|
||||||
id: "f",
|
id: "f",
|
||||||
title: "Starred",
|
title: "Starred",
|
||||||
sysdate: data.starredNum + " photos",
|
sysdate: data.starredNum + " photos",
|
||||||
star: 1,
|
star: 1,
|
||||||
thumb0: data.starredThumb0,
|
thumb0: data.starredThumb0,
|
||||||
thumb1: data.starredThumb1,
|
thumb1: data.starredThumb1,
|
||||||
thumb2: data.starredThumb2
|
thumb2: data.starredThumb2
|
||||||
};
|
};
|
||||||
|
|
||||||
data.publicAlbum = {
|
data.publicAlbum = {
|
||||||
id: "s",
|
id: "s",
|
||||||
title: "Public",
|
title: "Public",
|
||||||
sysdate: data.publicNum + " photos",
|
sysdate: data.publicNum + " photos",
|
||||||
public: 1,
|
public: 1,
|
||||||
thumb0: data.publicThumb0,
|
thumb0: data.publicThumb0,
|
||||||
thumb1: data.publicThumb1,
|
thumb1: data.publicThumb1,
|
||||||
thumb2: data.publicThumb2
|
thumb2: data.publicThumb2
|
||||||
};
|
};
|
||||||
|
|
||||||
data.recentAlbum = {
|
data.recentAlbum = {
|
||||||
id: "r",
|
id: "r",
|
||||||
title: "Recent",
|
title: "Recent",
|
||||||
sysdate: data.recentNum + " photos",
|
sysdate: data.recentNum + " photos",
|
||||||
recent: 1,
|
recent: 1,
|
||||||
thumb0: data.recentThumb0,
|
thumb0: data.recentThumb0,
|
||||||
thumb1: data.recentThumb1,
|
thumb1: data.recentThumb1,
|
||||||
thumb2: data.recentThumb2
|
thumb2: data.recentThumb2
|
||||||
};
|
};
|
||||||
|
|
||||||
albums.json = data;
|
albums.json = data;
|
||||||
|
|
||||||
durationTime = (new Date().getTime() - startTime);
|
durationTime = (new Date().getTime() - startTime);
|
||||||
if (durationTime>300) waitTime = 0; else waitTime = 300 - durationTime;
|
if (durationTime>300) waitTime = 0; else waitTime = 300 - durationTime;
|
||||||
if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0;
|
if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0;
|
||||||
if (visible.album()&&lychee.content.html()==="") waitTime = 0;
|
if (visible.album()&&lychee.content.html()==="") waitTime = 0;
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
view.header.mode("albums");
|
view.header.mode("albums");
|
||||||
view.albums.init();
|
view.albums.init();
|
||||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||||
|
|
||||||
}, waitTime);
|
}, waitTime);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
view.header.mode("albums");
|
view.header.mode("albums");
|
||||||
view.albums.init();
|
view.albums.init();
|
||||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parse: function(album) {
|
parse: function(album) {
|
||||||
@ -100,8 +100,8 @@ albums = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
this.json = null;
|
this.json = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
@ -50,18 +50,18 @@ photo = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//preload the next photo for better response time
|
//preload the next photo for better response time
|
||||||
preloadNext: function(photoID) {
|
preloadNext: function(photoID) {
|
||||||
if(album.json &&
|
if(album.json &&
|
||||||
album.json.content &&
|
album.json.content &&
|
||||||
album.json.content[photoID] &&
|
album.json.content[photoID] &&
|
||||||
album.json.content[photoID].nextPhoto!="") {
|
album.json.content[photoID].nextPhoto!="") {
|
||||||
|
|
||||||
var nextPhoto = album.json.content[photoID].nextPhoto;
|
var nextPhoto = album.json.content[photoID].nextPhoto;
|
||||||
var url = album.json.content[nextPhoto].url;
|
var url = album.json.content[nextPhoto].url;
|
||||||
cache = new Image();
|
cache = new Image();
|
||||||
cache.src = url;
|
cache.src = url;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parse: function() {
|
parse: function() {
|
||||||
@ -312,7 +312,7 @@ photo = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
albums.refresh();
|
albums.refresh();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ photo = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
albums.refresh();
|
albums.refresh();
|
||||||
|
|
||||||
|
|
||||||
if (visible.photo()) {
|
if (visible.photo()) {
|
||||||
|
@ -122,7 +122,7 @@ view = {
|
|||||||
|
|
||||||
content: {
|
content: {
|
||||||
|
|
||||||
scroll_pos: 0,
|
scroll_pos: 0,
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
|
|
||||||
@ -138,15 +138,15 @@ view = {
|
|||||||
|
|
||||||
/* Albums */
|
/* Albums */
|
||||||
|
|
||||||
if (albums.json.content) {
|
if (albums.json.content) {
|
||||||
$.each(albums.json.content, function() {
|
$.each(albums.json.content, function() {
|
||||||
albums.parse(this);
|
albums.parse(this);
|
||||||
|
|
||||||
//display albums in reverse order
|
//display albums in reverse order
|
||||||
albumsData = build.album(this) + albumsData;
|
albumsData = build.album(this) + albumsData;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!lychee.publicMode) albumsData = build.divider("Albums") + albumsData;
|
if (!lychee.publicMode) albumsData = build.divider("Albums") + albumsData;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smartData===""&&albumsData==="") {
|
if (smartData===""&&albumsData==="") {
|
||||||
@ -158,11 +158,11 @@ view = {
|
|||||||
|
|
||||||
$("img[data-type!='nonretina']").retina();
|
$("img[data-type!='nonretina']").retina();
|
||||||
|
|
||||||
//restore scroll
|
//restore scroll
|
||||||
if (view.albums.content.scroll_pos != null) {
|
if (view.albums.content.scroll_pos != null) {
|
||||||
//$("html, body").setanimate({ scrollTop: view.albums.content.scroll_pos }, "slow");
|
//$("html, body").setanimate({ scrollTop: view.albums.content.scroll_pos }, "slow");
|
||||||
$("html, body").scrollTop(view.albums.content.scroll_pos);
|
$("html, body").scrollTop(view.albums.content.scroll_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -261,9 +261,9 @@ view = {
|
|||||||
|
|
||||||
$("img[data-type!='svg']").retina();
|
$("img[data-type!='svg']").retina();
|
||||||
|
|
||||||
view.albums.content.scroll_pos = $(document).scrollTop();
|
view.albums.content.scroll_pos = $(document).scrollTop();
|
||||||
//scroll to top
|
//scroll to top
|
||||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
|||||||
|
|
||||||
function debug_to_console( $data ) {
|
function debug_to_console( $data ) {
|
||||||
|
|
||||||
if ( is_array( $data ) )
|
if ( is_array( $data ) )
|
||||||
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
|
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
|
||||||
else
|
else
|
||||||
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>";
|
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>";
|
||||||
|
|
||||||
echo $output;
|
echo $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Album extends Module {
|
class Album extends Module {
|
||||||
@ -112,8 +112,8 @@ class Album extends Module {
|
|||||||
$photo['nextPhoto'] = '';
|
$photo['nextPhoto'] = '';
|
||||||
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
|
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
|
||||||
|
|
||||||
# Parse url
|
# Parse url
|
||||||
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $photo['url'];
|
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $photo['url'];
|
||||||
|
|
||||||
if (isset($photo['takestamp'])&&$photo['takestamp']!=='0') {
|
if (isset($photo['takestamp'])&&$photo['takestamp']!=='0') {
|
||||||
$photo['cameraDate'] = 1;
|
$photo['cameraDate'] = 1;
|
||||||
|
@ -24,8 +24,8 @@ class Database extends Module {
|
|||||||
if ($database->server_version<50500) $database->set_charset('GBK');
|
if ($database->server_version<50500) $database->set_charset('GBK');
|
||||||
else $database->set_charset("utf8");
|
else $database->set_charset("utf8");
|
||||||
|
|
||||||
# Set unicode
|
# Set unicode
|
||||||
$database->query('SET NAMES utf8;');
|
$database->query('SET NAMES utf8;');
|
||||||
|
|
||||||
# Check database
|
# Check database
|
||||||
if (!$database->select_db($name))
|
if (!$database->select_db($name))
|
||||||
|
Loading…
Reference in New Issue
Block a user