Commit 9676556a authored by Tobias Reich's avatar Tobias Reich
Browse files

Merge branch 'master' into downloadable

Conflicts:
	assets/min/main.js
parents b23360d6 61ecca04
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
margin: 2px; margin: 2px;
} }
.album .overlay { .album .overlay {
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 20%,rgba(0,0,0,0.9) 100%); background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 40%,rgba(0,0,0,0.85) 100%);
} }
.photo .overlay { .photo .overlay {
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.9) 100%); background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.9) 100%);
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
left: 50%; left: 50%;
height: 160px; height: 160px;
width: 180px; width: 180px;
margin-top: -80px; margin-top: -60px;
margin-left: -90px; margin-left: -90px;
padding-top: 20px; padding-top: 20px;
color: rgba(20, 20, 20, 1); color: rgba(20, 20, 20, 1);
...@@ -237,8 +237,9 @@ ...@@ -237,8 +237,9 @@
text-align: center; text-align: center;
} }
.no_content .icon { .no_content .icon {
font-size: 120px; font-size: 80px;
} }
.no_content p { .no_content p {
font-size: 18px; font-size: 18px;
font-weight: bold;
} }
\ No newline at end of file
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
text-align: center; text-align: center;
} }
.upload_message .close { .upload_message .close {
display: none;
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0px; right: 0px;
...@@ -118,4 +119,15 @@ ...@@ -118,4 +119,15 @@
.upload_message .rows .row a.status.success { .upload_message .rows .row a.status.success {
color: rgb(42, 213, 0); color: rgb(42, 213, 0);
} }
\ No newline at end of file
.upload_message .rows .row p.notice {
display: none;
float: left;
padding: 2px 10px 5px;
width: calc(100% - 20px);
color: rgba(255,255,255,.5);
font-size: 12px;
overflow: hidden;
line-height: 16px;
}
\ No newline at end of file
...@@ -56,9 +56,9 @@ build = { ...@@ -56,9 +56,9 @@ build = {
if (!lychee.publicMode) { if (!lychee.publicMode) {
if(albumJSON.star==1) album += "<a class='badge red icon-star'></a>"; if(albumJSON.star==1) album += "<a class='badge red icon-star'></a>";
if(albumJSON.public==1) album += "<a class='badge red icon-share'></a>"; if(albumJSON.public==1) album += "<a class='badge red icon-share'></a>";
if(albumJSON.unsorted==1) album += "<a class='badge red icon-reorder'></a>"; if(albumJSON.unsorted==1) album += "<a class='badge red icon-reorder'></a>";
if(albumJSON.recent==1) album += "<a class='badge red icon-time'></a>"; if(albumJSON.recent==1) album += "<a class='badge red icon-time'></a>";
} }
...@@ -139,9 +139,9 @@ build = { ...@@ -139,9 +139,9 @@ build = {
no_content += "<div class='no_content fadeIn'>"; no_content += "<div class='no_content fadeIn'>";
no_content += "<a class='icon icon-" + typ + "'></a>"; no_content += "<a class='icon icon-" + typ + "'></a>";
if (typ==="search") no_content += "<p>No results</p>"; if (typ==="search") no_content += "<p>No results</p>";
else if (typ==="picture") no_content += "<p>No public albums</p>"; else if (typ==="share") no_content += "<p>No public albums</p>";
else if (typ==="cog") no_content += "<p>No Configuration!</p>"; else if (typ==="cog") no_content += "<p>No configuration</p>";
no_content += "</div>"; no_content += "</div>";
...@@ -214,27 +214,21 @@ build = { ...@@ -214,27 +214,21 @@ build = {
modal += "<div class='upload_overlay fadeIn'>"; modal += "<div class='upload_overlay fadeIn'>";
modal += "<div class='upload_message center'>"; modal += "<div class='upload_message center'>";
modal += "<h1>" + title + "</h1>"; modal += "<h1>" + title + "</h1>";
modal += "<a class='close icon-remove-sign'></a>";
modal += "<div class='rows'>"; modal += "<div class='rows'>";
for (var i = 0; i < files.length; i++) { for (var i = 0; i < files.length; i++) {
if (files[i].name.length>40) files[i].name = files[i].name.substr(0, 17) + "..." + files[i].name.substr(files[i].name.length-20, 20); if (files[i].name.length>40) files[i].name = files[i].name.substr(0, 17) + "..." + files[i].name.substr(files[i].name.length-20, 20);
if (files[i].supported===true) { modal += "<div class='row'>";
modal += "<a class='name'>" + lychee.escapeHTML(files[i].name) + "</a>";
modal += "<div class='row'>"
modal += "<a class='name'>" + lychee.escapeHTML(files[i].name) + "</a>"
modal += "<a class='status'></a>"
modal += "</div>";
} else { if (files[i].supported===true) modal += "<a class='status'></a>";
else modal += "<a class='status error'>Not supported</a>";
modal += "<div class='row'>" modal += "<p class='notice'></p>";
modal += "<a class='name'>" + lychee.escapeHTML(files[i].name) + "</a>" modal += "</div>";
modal += "<a class='status error'>Not supported</a>"
modal += "</div>";
}
} }
......
...@@ -164,9 +164,6 @@ $(document).ready(function(){ ...@@ -164,9 +164,6 @@ $(document).ready(function(){
/* Add Dialog */ /* Add Dialog */
.on(event_name, ".button_add", function(e) { contextMenu.add(e) }) .on(event_name, ".button_add", function(e) { contextMenu.add(e) })
/* Upload */
.on("change", "#upload_files", function() { modal.close(); upload.start.local(this.files) })
/* Context Menu */ /* Context Menu */
.on("contextmenu", ".photo", function(e) { contextMenu.photo(photo.getID(), e) }) .on("contextmenu", ".photo", function(e) { contextMenu.photo(photo.getID(), e) })
.on("contextmenu", ".album", function(e) { contextMenu.album(album.getID(), e) }) .on("contextmenu", ".album", function(e) { contextMenu.album(album.getID(), e) })
...@@ -177,12 +174,14 @@ $(document).ready(function(){ ...@@ -177,12 +174,14 @@ $(document).ready(function(){
.on(event_name, "#infobox_overlay", view.infobox.hide) .on(event_name, "#infobox_overlay", view.infobox.hide)
/* Upload */ /* Upload */
.on("change", "#upload_files", function() { modal.close(); upload.start.local(this.files) })
.on(event_name, ".upload_message a.close", upload.close)
.on("dragover", function(e) { e.preventDefault(); }, false) .on("dragover", function(e) { e.preventDefault(); }, false)
.on("drop", function(e) { .on("drop", function(e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
if (e.originalEvent.dataTransfer.files.length>0) upload.start.local(e.originalEvent.dataTransfer.files); if (e.originalEvent.dataTransfer.files.length>0) upload.start.local(e.originalEvent.dataTransfer.files);
else if (e.originalEvent.dataTransfer.getData('Text').length>3) upload.start.url(e.originalEvent.dataTransfer.getData('Text')); else if (e.originalEvent.dataTransfer.getData('Text').length>3) upload.start.url(e.originalEvent.dataTransfer.getData('Text'));
return true; return true;
}); });
......
...@@ -354,9 +354,12 @@ var lychee = { ...@@ -354,9 +354,12 @@ var lychee = {
error: function(errorThrown, params, data) { error: function(errorThrown, params, data) {
console.log("Error Description: " + errorThrown); console.error({
console.log("Error Params: " + params); description: errorThrown,
console.log("Server Response: " + data); params: params,
response: data
});
loadingBar.show("error", errorThrown); loadingBar.show("error", errorThrown);
} }
......
...@@ -16,36 +16,18 @@ upload = { ...@@ -16,36 +16,18 @@ upload = {
}, },
setIcon: function(icon) { notify: function(title, text) {
$(".upload_message a").remove();
$(".upload_message").prepend("<a class='icon-" + icon + "'></a>");
},
setProgress: function(progress) {
$(".progressbar div").css("width", progress + "%");
},
setText: function(text) {
$(".progressbar").remove();
$(".upload_message").append("<p>" + text + "</p>");
},
notify: function(title) {
var popup; var popup;
if (!text||text==="") text = "You can now manage your new photo(s).";
if (!window.webkitNotifications) return false; if (!window.webkitNotifications) return false;
if (window.webkitNotifications.checkPermission()!==0) window.webkitNotifications.requestPermission(); if (window.webkitNotifications.checkPermission()!==0) window.webkitNotifications.requestPermission();
if (window.webkitNotifications.checkPermission()===0&&title) { if (window.webkitNotifications.checkPermission()===0&&title) {
popup = window.webkitNotifications.createNotification("", title, "You can now manage your new photo(s)."); popup = window.webkitNotifications.createNotification("", title, text);
popup.show(); popup.show();
} }
...@@ -56,6 +38,7 @@ upload = { ...@@ -56,6 +38,7 @@ upload = {
local: function(files) { local: function(files) {
var albumID = album.getID(), var albumID = album.getID(),
error = false,
process = function(files, file) { process = function(files, file) {
var formData = new FormData(), var formData = new FormData(),
...@@ -68,7 +51,19 @@ upload = { ...@@ -68,7 +51,19 @@ upload = {
$("#upload_files").val(""); $("#upload_files").val("");
upload.close(); if (error===false) {
// Success
upload.close();
upload.notify("Upload complete");
} else {
// Error
$(".upload_message a.close").show();
upload.notify("Upload complete", "Failed to upload one or more photos.");
}
if (album.getID()===false) lychee.goto("0"); if (album.getID()===false) lychee.goto("0");
else album.load(albumID); else album.load(albumID);
...@@ -112,34 +107,49 @@ upload = { ...@@ -112,34 +107,49 @@ upload = {
xhr.onload = function() { xhr.onload = function() {
// On success var wait = false;
if (xhr.status===200) {
file.ready = true;
var wait; // Set status
if (xhr.status===200&&xhr.responseText==="1") {
// Set status to finished // Success
$(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status") $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status")
.html("Finished") .html("Finished")
.addClass("success"); .addClass("success");
file.ready = true; } else {
wait = false;
// Check if there are file which are not finished // Error
for (var i = 0; i < files.length; i++) { $(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status")
.html("Error")
.addClass("error");
$(".upload_message .rows .row:nth-child(" + (file.num+1) + ") p.notice")
.html("Server returned an unknown response. Please take a look at the console of your browser for further details.")
.show();
if (files[i].ready===false) { // Set global error
wait = true; error = true;
break;
}
} // Throw error
lychee.error("Upload failed. Server returned the status code " + xhr.status + "!", xhr, xhr.responseText);
}
// Finish upload when all files are finished // Check if there are file which are not finished
if (wait===false) finish(); for (var i = 0; i < files.length; i++) {
if (files[i].ready===false) {
wait = true;
break;
}
} }
// Finish upload when all files are finished
if (wait===false) finish();
}; };
xhr.upload.onprogress = function(e) { xhr.upload.onprogress = function(e) {
...@@ -374,7 +384,6 @@ upload = { ...@@ -374,7 +384,6 @@ upload = {
if (force===true) { if (force===true) {
$(".upload_overlay").remove(); $(".upload_overlay").remove();
} else { } else {
upload.setProgress(100);
$(".upload_overlay").removeClass("fadeIn").css("opacity", 0); $(".upload_overlay").removeClass("fadeIn").css("opacity", 0);
setTimeout(function() { $(".upload_overlay").remove() }, 300); setTimeout(function() { $(".upload_overlay").remove() }, 300);
} }
......
...@@ -146,7 +146,7 @@ view = { ...@@ -146,7 +146,7 @@ view = {
if (smartData===""&&albumsData==="") { if (smartData===""&&albumsData==="") {
lychee.content.html(''); lychee.content.html('');
$("body").append(build.no_content("picture")); $("body").append(build.no_content("share"));
} else { } else {
lychee.content.html(smartData + albumsData); lychee.content.html(smartData + albumsData);
} }
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "Lychee", "name": "Lychee",
"version": "2.5.6", "version": "2.6.0",
"description": "Self-hosted photo-management done right.", "description": "Self-hosted photo-management done right.",
"authors": "Tobias Reich <tobias.reich.ich@gmail.com>", "authors": "Tobias Reich <tobias.reich.ich@gmail.com>",
"license": "MIT", "license": "MIT",
......
## v2.6 ## v2.6
Released August ??, 2014 Released August 16, 2014
- `New` Uploader (#101) - `New` Rewritten and redesigned Uploader (#101)
- `New` Custom server-import directory (#187)
- `New` Plugin documentation - `New` Plugin documentation
- `Improved` Database and installation process (#202 #195) - `Improved` Database and installation process (#202 #195)
- `Improved` "No public albums" now easier to read (#205)
- `Fixed` Don't show EXIF info when not available (#194) - `Fixed` Don't show EXIF info when not available (#194)
## v2.5.6 ## v2.5.6
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment