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 {
|
||||
float: left;
|
||||
width: 70%;
|
||||
padding: 0px 10px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.upload_message .rows .row a.status {
|
||||
|
@ -208,6 +208,8 @@ build = {
|
||||
|
||||
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) {
|
||||
|
||||
modal += "<div class='row'>"
|
||||
|
@ -222,15 +222,20 @@ upload = {
|
||||
|
||||
var albumID = album.getID(),
|
||||
params,
|
||||
buttons;
|
||||
buttons,
|
||||
files = [];
|
||||
|
||||
if (albumID===false) albumID = 0;
|
||||
|
||||
buttons = [
|
||||
["Import", function() {
|
||||
|
||||
modal.close();
|
||||
upload.show("cog", "Importing photos");
|
||||
files[0] = {
|
||||
name: "uploads/import/",
|
||||
supported: true
|
||||
};
|
||||
|
||||
upload.show("Importing from server", files);
|
||||
|
||||
params = "importServer&albumID=" + albumID;
|
||||
lychee.api(params, function(data) {
|
||||
@ -262,7 +267,8 @@ upload = {
|
||||
dropbox: function() {
|
||||
|
||||
var albumID = album.getID(),
|
||||
params;
|
||||
params,
|
||||
links = "";
|
||||
|
||||
if (albumID===false) albumID = 0;
|
||||
|
||||
@ -272,15 +278,23 @@ upload = {
|
||||
multiselect: true,
|
||||
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) {
|
||||
|
||||
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