Improved handling of long file names and fixed Dropbox and URL import
This commit is contained in:
parent
5acc5760da
commit
ce5f8b9d0f
@ -94,9 +94,12 @@
|
|||||||
|
|
||||||
.upload_message .rows .row a.name {
|
.upload_message .rows .row a.name {
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 70%;
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload_message .rows .row a.status {
|
.upload_message .rows .row a.status {
|
||||||
|
@ -208,6 +208,8 @@ build = {
|
|||||||
|
|
||||||
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, 40) + "...";
|
||||||
|
|
||||||
if (files[i].supported===true) {
|
if (files[i].supported===true) {
|
||||||
|
|
||||||
modal += "<div class='row'>"
|
modal += "<div class='row'>"
|
||||||
|
@ -222,15 +222,20 @@ upload = {
|
|||||||
|
|
||||||
var albumID = album.getID(),
|
var albumID = album.getID(),
|
||||||
params,
|
params,
|
||||||
buttons;
|
buttons,
|
||||||
|
files = [];
|
||||||
|
|
||||||
if (albumID===false) albumID = 0;
|
if (albumID===false) albumID = 0;
|
||||||
|
|
||||||
buttons = [
|
buttons = [
|
||||||
["Import", function() {
|
["Import", function() {
|
||||||
|
|
||||||
modal.close();
|
files[0] = {
|
||||||
upload.show("cog", "Importing photos");
|
name: "uploads/import/",
|
||||||
|
supported: true
|
||||||
|
};
|
||||||
|
|
||||||
|
upload.show("Importing from server", files);
|
||||||
|
|
||||||
params = "importServer&albumID=" + albumID;
|
params = "importServer&albumID=" + albumID;
|
||||||
lychee.api(params, function(data) {
|
lychee.api(params, function(data) {
|
||||||
@ -262,7 +267,8 @@ upload = {
|
|||||||
dropbox: function() {
|
dropbox: function() {
|
||||||
|
|
||||||
var albumID = album.getID(),
|
var albumID = album.getID(),
|
||||||
params;
|
params,
|
||||||
|
links = "";
|
||||||
|
|
||||||
if (albumID===false) albumID = 0;
|
if (albumID===false) albumID = 0;
|
||||||
|
|
||||||
@ -272,15 +278,23 @@ upload = {
|
|||||||
multiselect: true,
|
multiselect: true,
|
||||||
success: function(files) {
|
success: function(files) {
|
||||||
|
|
||||||
if (files.length>1) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
|
||||||
for (var i = 0; i < files.length; i++) files[i] = files[i].link;
|
links += files[i].link + ",";
|
||||||
|
|
||||||
} else files = files[0].link;
|
files[i] = {
|
||||||
|
name: files[i].link,
|
||||||
|
supported: true
|
||||||
|
};
|
||||||
|
|
||||||
upload.show("cog", "Importing photos");
|
}
|
||||||
|
|
||||||
params = "importUrl&url=" + escape(files) + "&albumID=" + albumID;
|
// Remove last comma
|
||||||
|
links = links.substr(0, links.length-1);
|
||||||
|
|
||||||
|
upload.show("Importing from Dropbox", files);
|
||||||
|
|
||||||
|
params = "importUrl&url=" + escape(links) + "&albumID=" + albumID;
|
||||||
lychee.api(params, function(data) {
|
lychee.api(params, function(data) {
|
||||||
|
|
||||||
upload.close();
|
upload.close();
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user