Changed spaces to tabs for indentation

This commit is contained in:
Roman 2014-09-16 15:20:35 +03:00
parent 1671517f41
commit fa8cad02bb
6 changed files with 124 additions and 124 deletions

View File

@ -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("");
@ -294,7 +294,7 @@ album = {
listed = false,
downloadable = false;
albums.refresh();
albums.refresh();
if (!visible.message()&&album.json.public==0) {

View File

@ -18,72 +18,72 @@ 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) {
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
};
/* 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.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.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
};
data.recentAlbum = {
id: "r",
title: "Recent",
sysdate: data.recentNum + " photos",
recent: 1,
thumb0: data.recentThumb0,
thumb1: data.recentThumb1,
thumb2: data.recentThumb2
};
albums.json = data;
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;
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");
setTimeout(function() {
view.header.mode("albums");
view.albums.init();
lychee.animate(".album:nth-child(-n+50), .photo:nth-child(-n+50)", "contentZoomIn");
}, waitTime);
});
} else {
}, 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) {
@ -100,8 +100,8 @@ albums = {
},
refresh: function() {
this.json = null;
}
refresh: function() {
this.json = null;
}
};

View File

@ -50,18 +50,18 @@ 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!="") {
//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;
}
var nextPhoto = album.json.content[photoID].nextPhoto;
var url = album.json.content[nextPhoto].url;
cache = new Image();
cache.src = url;
}
},
parse: function() {
@ -312,7 +312,7 @@ photo = {
});
albums.refresh();
albums.refresh();
},
@ -326,7 +326,7 @@ photo = {
}
albums.refresh();
albums.refresh();
if (visible.photo()) {

View File

@ -122,7 +122,7 @@ view = {
content: {
scroll_pos: 0,
scroll_pos: 0,
init: function() {
@ -138,15 +138,15 @@ view = {
/* 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==="") {
@ -158,11 +158,11 @@ 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);
}
},
@ -261,9 +261,9 @@ view = {
$("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");
},

View File

@ -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 {
@ -112,8 +112,8 @@ class Album extends Module {
$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;

View File

@ -24,8 +24,8 @@ class Database extends Module {
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))