mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
nodejs: handling conversion -9 error
This commit is contained in:
@ -109,7 +109,7 @@ if (typeof jQuery != "undefined") {
|
||||
});
|
||||
|
||||
var timer = null;
|
||||
var checkConvert = function (filePass) {
|
||||
var checkConvert = function (filePass, forceConvert) {
|
||||
filePass = filePass ? filePass : null;
|
||||
if (timer != null) {
|
||||
clearTimeout(timer);
|
||||
@ -131,13 +131,16 @@ if (typeof jQuery != "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
var convData = {filename: fileName, filePass: filePass, lang: language};
|
||||
if (forceConvert) convData.forceConv = forceConvert;
|
||||
|
||||
timer = setTimeout(function () {
|
||||
jq.ajaxSetup({ cache: false });
|
||||
jq.ajax({
|
||||
async: true,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {filename: fileName, filePass: filePass, lang: language},
|
||||
data: convData,
|
||||
url: UrlConverter,
|
||||
complete: function (data) {
|
||||
var responseText = data.responseText;
|
||||
@ -157,6 +160,12 @@ if (typeof jQuery != "undefined") {
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (response.error.includes("-9")){
|
||||
jq("#xmlError").removeClass("invisible");
|
||||
jq("#step2").removeClass("current");
|
||||
jq("#hiddenFileName").attr("placeholder",filePass);
|
||||
return;
|
||||
}
|
||||
jq(".current").removeClass("current");
|
||||
jq(".step:not(.done)").addClass("error");
|
||||
jq("#mainProgress .error-message").show().find("span").text(response.error);
|
||||
@ -168,7 +177,7 @@ if (typeof jQuery != "undefined") {
|
||||
jq("#hiddenFileName").val(response.filename);
|
||||
|
||||
if (typeof response.step != "undefined" && response.step < 100) {
|
||||
checkConvert(filePass);
|
||||
checkConvert(filePass, forceConvert);
|
||||
} else {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
@ -214,6 +223,15 @@ if (typeof jQuery != "undefined") {
|
||||
}
|
||||
};
|
||||
|
||||
jq(document).on("click", "#forceConvert:not(.disable)", function () {
|
||||
const currentElement = jq(this);
|
||||
var fileType = currentElement.attr("data");
|
||||
var filePass = jq("#hiddenFileName").attr("placeholder");
|
||||
jq("div[id='forceConvert']").addClass("disable, pale");
|
||||
currentElement.removeClass("pale");
|
||||
checkConvert(filePass, fileType);
|
||||
});
|
||||
|
||||
jq(document).on("click", "#enterPass", function () {
|
||||
var pass = jq("#filePass").val();
|
||||
if (pass) {
|
||||
|
||||
Reference in New Issue
Block a user