mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update search css loading
This commit is contained in:
parent
96eb9ea63a
commit
3118991c21
15 changed files with 161 additions and 190 deletions
73
dashboard-ui/cordova/fileupload.js
vendored
73
dashboard-ui/cordova/fileupload.js
vendored
|
@ -6,57 +6,56 @@
|
|||
|
||||
self.upload = function (path, name, url) {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
resolveLocalFileSystemURL(path, function (fileEntry) {
|
||||
resolveLocalFileSystemURL(path, function (fileEntry) {
|
||||
|
||||
fileEntry.file(function (file) {
|
||||
fileEntry.file(function (file) {
|
||||
|
||||
var mimeType = (file.type || '');
|
||||
var mimeType = (file.type || '');
|
||||
|
||||
if (mimeType.indexOf('image/') != 0) {
|
||||
Logger.log('Skipping upload because file is not an image. path: ' + path + ' mimeType: ' + mimeType);
|
||||
deferred.reject();
|
||||
return;
|
||||
}
|
||||
if (mimeType.indexOf('image/') != 0) {
|
||||
Logger.log('Skipping upload because file is not an image. path: ' + path + ' mimeType: ' + mimeType);
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.log('mimeType for file ' + path + ' is ' + file);
|
||||
Logger.log('mimeType for file ' + path + ' is ' + file);
|
||||
|
||||
var onSuccess = function (r) {
|
||||
console.log("Code = " + r.responseCode);
|
||||
console.log("Response = " + r.response);
|
||||
console.log("Sent = " + r.bytesSent);
|
||||
deferred.resolve();
|
||||
}
|
||||
var onSuccess = function (r) {
|
||||
console.log("Code = " + r.responseCode);
|
||||
console.log("Response = " + r.response);
|
||||
console.log("Sent = " + r.bytesSent);
|
||||
resolve();
|
||||
}
|
||||
|
||||
var onFail = function (error) {
|
||||
console.log("upload error source " + error.source);
|
||||
console.log("upload error target " + error.target);
|
||||
deferred.reject();
|
||||
}
|
||||
var onFail = function (error) {
|
||||
console.log("upload error source " + error.source);
|
||||
console.log("upload error target " + error.target);
|
||||
reject();
|
||||
}
|
||||
|
||||
var options = new FileUploadOptions();
|
||||
options.fileKey = "file";
|
||||
options.fileName = name;
|
||||
options.mimeType = mimeType;
|
||||
var options = new FileUploadOptions();
|
||||
options.fileKey = "file";
|
||||
options.fileName = name;
|
||||
options.mimeType = mimeType;
|
||||
|
||||
var params = {};
|
||||
options.params = params;
|
||||
var params = {};
|
||||
options.params = params;
|
||||
|
||||
new FileTransfer().upload(path, url, onSuccess, onFail, options);
|
||||
new FileTransfer().upload(path, url, onSuccess, onFail, options);
|
||||
|
||||
}, function () {
|
||||
Logger.log('File upload failed. fileEntry.file returned an error');
|
||||
reject();
|
||||
});
|
||||
|
||||
}, function () {
|
||||
Logger.log('File upload failed. fileEntry.file returned an error');
|
||||
deferred.reject();
|
||||
|
||||
Logger.log('File upload failed. resolveLocalFileSystemURL returned an error');
|
||||
reject();
|
||||
});
|
||||
|
||||
}, function () {
|
||||
|
||||
Logger.log('File upload failed. resolveLocalFileSystemURL returned an error');
|
||||
deferred.reject();
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue