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!==false&&isNumber(data)) {
|
||||
albums.refresh();
|
||||
lychee.goto(data);
|
||||
}
|
||||
albums.refresh();
|
||||
lychee.goto(data);
|
||||
}
|
||||
else lychee.error(null, params, data);
|
||||
|
||||
});
|
||||
@ -149,7 +149,7 @@ album = {
|
||||
albumIDs.forEach(function(id, index, array) {
|
||||
albums.json.num--;
|
||||
view.albums.content.delete(id);
|
||||
delete albums.json.content[id]
|
||||
delete albums.json.content[id]
|
||||
});
|
||||
|
||||
} else lychee.goto("");
|
||||
@ -293,8 +293,8 @@ album = {
|
||||
password = "",
|
||||
listed = false,
|
||||
downloadable = false;
|
||||
|
||||
albums.refresh();
|
||||
|
||||
albums.refresh();
|
||||
|
||||
if (!visible.message()&&album.json.public==0) {
|
||||
|
||||
@ -306,7 +306,7 @@ album = {
|
||||
else $(".message .choice input.text").hide();
|
||||
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
@ -17,73 +17,73 @@ albums = {
|
||||
|
||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomOut");
|
||||
lychee.animate(".divider", "fadeOut");
|
||||
|
||||
startTime = new Date().getTime();
|
||||
|
||||
startTime = new Date().getTime();
|
||||
|
||||
|
||||
if(this.json == null) {
|
||||
lychee.api("getAlbums", function(data) {
|
||||
|
||||
/* Smart Albums */
|
||||
data.unsortedAlbum = {
|
||||
id: 0,
|
||||
title: "Unsorted",
|
||||
sysdate: data.unsortedNum + " photos",
|
||||
unsorted: 1,
|
||||
thumb0: data.unsortedThumb0,
|
||||
thumb1: data.unsortedThumb1,
|
||||
thumb2: data.unsortedThumb2
|
||||
};
|
||||
|
||||
data.starredAlbum = {
|
||||
id: "f",
|
||||
title: "Starred",
|
||||
sysdate: data.starredNum + " photos",
|
||||
star: 1,
|
||||
thumb0: data.starredThumb0,
|
||||
thumb1: data.starredThumb1,
|
||||
thumb2: data.starredThumb2
|
||||
};
|
||||
|
||||
data.publicAlbum = {
|
||||
id: "s",
|
||||
title: "Public",
|
||||
sysdate: data.publicNum + " photos",
|
||||
public: 1,
|
||||
thumb0: data.publicThumb0,
|
||||
thumb1: data.publicThumb1,
|
||||
thumb2: data.publicThumb2
|
||||
};
|
||||
|
||||
data.recentAlbum = {
|
||||
id: "r",
|
||||
title: "Recent",
|
||||
sysdate: data.recentNum + " photos",
|
||||
recent: 1,
|
||||
thumb0: data.recentThumb0,
|
||||
thumb1: data.recentThumb1,
|
||||
thumb2: data.recentThumb2
|
||||
};
|
||||
|
||||
albums.json = data;
|
||||
|
||||
durationTime = (new Date().getTime() - startTime);
|
||||
if (durationTime>300) waitTime = 0; else waitTime = 300 - durationTime;
|
||||
if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0;
|
||||
if (visible.album()&&lychee.content.html()==="") waitTime = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
view.header.mode("albums");
|
||||
view.albums.init();
|
||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||
|
||||
}, waitTime);
|
||||
});
|
||||
} else {
|
||||
|
||||
if(this.json == null) {
|
||||
lychee.api("getAlbums", function(data) {
|
||||
|
||||
/* Smart Albums */
|
||||
data.unsortedAlbum = {
|
||||
id: 0,
|
||||
title: "Unsorted",
|
||||
sysdate: data.unsortedNum + " photos",
|
||||
unsorted: 1,
|
||||
thumb0: data.unsortedThumb0,
|
||||
thumb1: data.unsortedThumb1,
|
||||
thumb2: data.unsortedThumb2
|
||||
};
|
||||
|
||||
data.starredAlbum = {
|
||||
id: "f",
|
||||
title: "Starred",
|
||||
sysdate: data.starredNum + " photos",
|
||||
star: 1,
|
||||
thumb0: data.starredThumb0,
|
||||
thumb1: data.starredThumb1,
|
||||
thumb2: data.starredThumb2
|
||||
};
|
||||
|
||||
data.publicAlbum = {
|
||||
id: "s",
|
||||
title: "Public",
|
||||
sysdate: data.publicNum + " photos",
|
||||
public: 1,
|
||||
thumb0: data.publicThumb0,
|
||||
thumb1: data.publicThumb1,
|
||||
thumb2: data.publicThumb2
|
||||
};
|
||||
|
||||
data.recentAlbum = {
|
||||
id: "r",
|
||||
title: "Recent",
|
||||
sysdate: data.recentNum + " photos",
|
||||
recent: 1,
|
||||
thumb0: data.recentThumb0,
|
||||
thumb1: data.recentThumb1,
|
||||
thumb2: data.recentThumb2
|
||||
};
|
||||
|
||||
albums.json = data;
|
||||
|
||||
durationTime = (new Date().getTime() - startTime);
|
||||
if (durationTime>300) waitTime = 0; else waitTime = 300 - durationTime;
|
||||
if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0;
|
||||
if (visible.album()&&lychee.content.html()==="") waitTime = 0;
|
||||
|
||||
setTimeout(function() {
|
||||
view.header.mode("albums");
|
||||
view.albums.init();
|
||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||
|
||||
}, waitTime);
|
||||
});
|
||||
} else {
|
||||
view.header.mode("albums");
|
||||
view.albums.init();
|
||||
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
parse: function(album) {
|
||||
@ -99,9 +99,9 @@ albums = {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this.json = null;
|
||||
}
|
||||
|
||||
refresh: function() {
|
||||
this.json = null;
|
||||
}
|
||||
|
||||
};
|
@ -49,19 +49,19 @@ photo = {
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//preload the next photo for better response time
|
||||
preloadNext: function(photoID) {
|
||||
if(album.json &&
|
||||
album.json.content &&
|
||||
album.json.content[photoID] &&
|
||||
album.json.content[photoID].nextPhoto!="") {
|
||||
|
||||
var nextPhoto = album.json.content[photoID].nextPhoto;
|
||||
var url = album.json.content[nextPhoto].url;
|
||||
cache = new Image();
|
||||
cache.src = url;
|
||||
}
|
||||
|
||||
//preload the next photo for better response time
|
||||
preloadNext: function(photoID) {
|
||||
if(album.json &&
|
||||
album.json.content &&
|
||||
album.json.content[photoID] &&
|
||||
album.json.content[photoID].nextPhoto!="") {
|
||||
|
||||
var nextPhoto = album.json.content[photoID].nextPhoto;
|
||||
var url = album.json.content[nextPhoto].url;
|
||||
cache = new Image();
|
||||
cache.src = url;
|
||||
}
|
||||
},
|
||||
|
||||
parse: function() {
|
||||
@ -311,22 +311,22 @@ photo = {
|
||||
if (data!==true) lychee.error(null, params, data);
|
||||
|
||||
});
|
||||
|
||||
albums.refresh();
|
||||
|
||||
albums.refresh();
|
||||
|
||||
},
|
||||
|
||||
setPublic: function(photoID, e) {
|
||||
|
||||
var params;
|
||||
|
||||
|
||||
if (photo.json.public==2) {
|
||||
modal.show("Public Album", "This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.", [["Show Album", function() { lychee.goto(photo.json.original_album) }], ["Close", function() {}]]);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
albums.refresh();
|
||||
|
||||
albums.refresh();
|
||||
|
||||
|
||||
if (visible.photo()) {
|
||||
|
@ -121,8 +121,8 @@ view = {
|
||||
},
|
||||
|
||||
content: {
|
||||
|
||||
scroll_pos: 0,
|
||||
|
||||
scroll_pos: 0,
|
||||
|
||||
init: function() {
|
||||
|
||||
@ -137,16 +137,16 @@ view = {
|
||||
if (!lychee.publicMode) smartData = build.divider("Smart Albums") + build.album(albums.json.unsortedAlbum) + build.album(albums.json.starredAlbum) + build.album(albums.json.publicAlbum) + build.album(albums.json.recentAlbum);
|
||||
|
||||
/* Albums */
|
||||
|
||||
if (albums.json.content) {
|
||||
|
||||
if (albums.json.content) {
|
||||
$.each(albums.json.content, function() {
|
||||
albums.parse(this);
|
||||
|
||||
//display albums in reverse order
|
||||
|
||||
//display albums in reverse order
|
||||
albumsData = build.album(this) + albumsData;
|
||||
});
|
||||
|
||||
if (!lychee.publicMode) albumsData = build.divider("Albums") + albumsData;
|
||||
|
||||
if (!lychee.publicMode) albumsData = build.divider("Albums") + albumsData;
|
||||
}
|
||||
|
||||
if (smartData===""&&albumsData==="") {
|
||||
@ -157,12 +157,12 @@ view = {
|
||||
}
|
||||
|
||||
$("img[data-type!='nonretina']").retina();
|
||||
|
||||
//restore scroll
|
||||
if (view.albums.content.scroll_pos != null) {
|
||||
//$("html, body").setanimate({ scrollTop: view.albums.content.scroll_pos }, "slow");
|
||||
$("html, body").scrollTop(view.albums.content.scroll_pos);
|
||||
}
|
||||
|
||||
//restore scroll
|
||||
if (view.albums.content.scroll_pos != null) {
|
||||
//$("html, body").setanimate({ scrollTop: view.albums.content.scroll_pos }, "slow");
|
||||
$("html, body").scrollTop(view.albums.content.scroll_pos);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@ -260,10 +260,10 @@ view = {
|
||||
lychee.content.html(photosData);
|
||||
|
||||
$("img[data-type!='svg']").retina();
|
||||
|
||||
view.albums.content.scroll_pos = $(document).scrollTop();
|
||||
//scroll to top
|
||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||
|
||||
view.albums.content.scroll_pos = $(document).scrollTop();
|
||||
//scroll to top
|
||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||
|
||||
},
|
||||
|
||||
@ -470,7 +470,7 @@ view = {
|
||||
photo: function() {
|
||||
|
||||
lychee.imageview.html(build.imageview(photo.json, photo.isSmall(), visible.controls()));
|
||||
|
||||
|
||||
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==="")||lychee.viewMode) $("a#next").hide();
|
||||
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==="")||lychee.viewMode) $("a#previous").hide();
|
||||
|
||||
|
@ -13,12 +13,12 @@ if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
function debug_to_console( $data ) {
|
||||
|
||||
if ( is_array( $data ) )
|
||||
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
|
||||
else
|
||||
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>";
|
||||
if ( is_array( $data ) )
|
||||
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
|
||||
else
|
||||
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>";
|
||||
|
||||
echo $output;
|
||||
echo $output;
|
||||
}
|
||||
|
||||
class Album extends Module {
|
||||
@ -111,9 +111,9 @@ class Album extends Module {
|
||||
$photo['previousPhoto'] = $previousPhotoID;
|
||||
$photo['nextPhoto'] = '';
|
||||
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
|
||||
|
||||
# Parse url
|
||||
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $photo['url'];
|
||||
|
||||
# Parse url
|
||||
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $photo['url'];
|
||||
|
||||
if (isset($photo['takestamp'])&&$photo['takestamp']!=='0') {
|
||||
$photo['cameraDate'] = 1;
|
||||
@ -208,7 +208,7 @@ class Album extends Module {
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
|
||||
return $return;
|
||||
|
||||
}
|
||||
@ -394,7 +394,7 @@ class Album extends Module {
|
||||
|
||||
# Parse
|
||||
if (strlen($title)>50) $title = substr($title, 0, 50);
|
||||
|
||||
|
||||
# Execute query
|
||||
$result = $this->database->query("UPDATE lychee_albums SET title = '$title' WHERE id IN ($this->albumIDs);");
|
||||
|
||||
|
@ -23,9 +23,9 @@ class Database extends Module {
|
||||
# Avoid sql injection on older MySQL versions by using GBK
|
||||
if ($database->server_version<50500) $database->set_charset('GBK');
|
||||
else $database->set_charset("utf8");
|
||||
|
||||
# Set unicode
|
||||
$database->query('SET NAMES utf8;');
|
||||
|
||||
# Set unicode
|
||||
$database->query('SET NAMES utf8;');
|
||||
|
||||
# Check database
|
||||
if (!$database->select_db($name))
|
||||
|
Loading…
Reference in New Issue
Block a user