这是一个跟进question from.
我正在尝试利用当前的删除过程进行标题更新(在我的情况下)。实现有效,但statusText仍然是默认值(正在删除....)。根据上面链接中的答案,我尝试设置deletionStatusText ='正在更新...'在DeleteFile选项中。而且,我在DeleteFile中有警告声明。即使在显示警报之前,statusText也已显示“正在删除...”。请参阅screenshot。
我可能会遗漏一些我无法弄清楚缺少的东西。我是否需要在任何其他地方设置状态?
JS
var isCaptionUpdate = false;
var statusText = "Deleting...";
var captionValue = "";
function captionUpdate(){
isCaptionUpdate = true;
statusText = "Updating...";
};
var manualUploaderSection1 = new qq.s3.FineUploader({
element: document.getElementById('fine-uploader-manual-trigger-section1'),
template: 'qq-template-manual-trigger-section1',
autoUpload: false,
debug: true,
request: {
endpoint: "http://xx_my_bucket_xx.s3.amazonaws.com",
accessKey: "AKIAIAABIA",
},
signature: {
endpoint: "http://localhost/app/ci/php-s3-server/endpoint-cors.php"
},
uploadSuccess: {
endpoint: "http://localhost/app/ci/php-s3-server/endpoint-cors.php?success",
params: {
isBrowserPreviewCapable: qq.supportedFeatures.imagePreviews
}
},
session: {
endpoint: "http://localhost/app/ci/php-s3-server/endpoint-cors.php?filelist"
},
iframeSupport: {
localBlankPagePath: "success.html"
},
cors: {
expected: true
},
chunking: {
enabled: true
},
resume: {
enabled: true
},
deleteFile: {
enabled: true,
method: "POST",
endpoint: "http://localhost/app/ci/php-s3-server/endpoint-cors.php",
deletingStatusText: statusText,
params: {
qqcaption: function(id, name) {
alert(statusText);
if (isCaptionUpdate === true) {
isCaptionUpdate = false;
return captionValue;
}
}
}
},
validation: {
itemLimit: 5,
sizeLimit: 15000000
},
thumbnails: {
placeholders: {
notAvailablePath: "http://localhost/app/ci/s3.fine-uploader/placeholders/not_available-generic.png",
waitingPath: "http://localhost/app/ci/s3.fine-uploader/placeholders/waiting-generic.png"
}
},
callbacks: {
onComplete: function(id, name, response) {
var previewLink = qq(this.getItemByFileId(id)).getByClass('preview-link')[0];
if (response.success) {
previewLink.setAttribute("href", response.tempLink)
}
},
onUpload: function(id, fileName) {
captionValue = qq(this.getItemByFileId(id)).getByClass('qq-edit-caption')[0].value;
this.setParams({'qqcaption':captionValue});
},
onDelete: function(id) {
captionValue = qq(this.getItemByFileId(id)).getByClass('qq-edit-caption')[0].value;
}
}
});
qq(document.getElementById("trigger-upload-section1")).attach("click", function() {
manualUploaderSection1.uploadStoredFiles();
});