Commit 1838ec55 authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to warn the user about the problem and reload page when occurs...

refactor code to warn the user about the problem and reload page when occurs problems of document conversion

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43980 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent baa459e6
...@@ -79,12 +79,21 @@ function checkConversion(){\n ...@@ -79,12 +79,21 @@ function checkConversion(){\n
$.get("Base_getDocumentConversionState?path=" + parameterList.document_path, {},\n $.get("Base_getDocumentConversionState?path=" + parameterList.document_path, {},\n
function(data, textStatus, XMLHttpRequest){\n function(data, textStatus, XMLHttpRequest){\n
status = jQuery.parseJSON(data);\n status = jQuery.parseJSON(data);\n
if (status != "converted"){\n console.log(status);\n
setTimeout(checkConversion(), 1500);\n switch (status) {\n
}\n case "converted":\n
else {\n clearTimeout();\n
setTimeout(updateWebPage(), 1000); \n
break;\n
case "conversion_failed":\n
clearTimeout();\n clearTimeout();\n
setTimeout(updateWebPage(), 1000);\n $("a#loading_message").text("Problems to convert your document...");\n
setTimeout(window.location.href = window.location.href.match("^http.*\\/ung")[0], 3000);\n
break;\n
default:\n
console.log("converted");\n
setTimeout(checkConversion(), 1500); \n
break;\n
}\n }\n
});\n });\n
}\n }\n
......
276 277
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment