mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added original filenames to each item for creating a new vault from uploads.
This commit is contained in:
parent
17573b5fd3
commit
6f475d6e03
@ -81,12 +81,16 @@ function linkCreateVault(element) {
|
||||
$("div[id^='upload-panel-']").each(function () {
|
||||
var url = $(this).find('#upload-url').val();
|
||||
if (url !== '') {
|
||||
var origFile = $(this).find('#upload-title').text();
|
||||
if (origFile !== null && origFile !== '') {
|
||||
url += ':' + origFile;
|
||||
}
|
||||
allUploads.unshift(url);
|
||||
}
|
||||
});
|
||||
if (allUploads.length > 0) {
|
||||
var urlList = allUploads.join();
|
||||
window.open(createVaultURL + '&urls=' + urlList, '_blank');
|
||||
window.open(createVaultURL + '&urls=' + encodeURIComponent(urlList), '_blank');
|
||||
}
|
||||
else {
|
||||
window.open(createVaultURL, '_blank');
|
||||
|
@ -96,10 +96,19 @@ namespace Teknik.Areas.Vault.Controllers
|
||||
string[] allURLs = urls.Split(',');
|
||||
foreach (string url in allURLs)
|
||||
{
|
||||
if (IsValidItem(type, url))
|
||||
string[] urlInfo = url.Split(':');
|
||||
string uploadId = urlInfo[0];
|
||||
string title = string.Empty;
|
||||
if (urlInfo.GetUpperBound(0) >= 1)
|
||||
{
|
||||
// They also passed in the original filename, so let's use it as our title
|
||||
title = urlInfo[1];
|
||||
}
|
||||
if (IsValidItem(type, uploadId))
|
||||
{
|
||||
NewVaultItemViewModel item = new NewVaultItemViewModel();
|
||||
item.url = url;
|
||||
item.title = title;
|
||||
item.url = uploadId;
|
||||
item.type = type;
|
||||
model.items.Add(item);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user