diff --git a/js/onlineide/leftmenu.js b/js/onlineide/leftmenu.js index 23b1365..5ecf570 100644 --- a/js/onlineide/leftmenu.js +++ b/js/onlineide/leftmenu.js @@ -621,7 +621,7 @@ var sliceFile = function (file) { var uploadInternal = function () { console.log("upload:" + global.uploadOrder + " total:" + global.chunks.length); var isAppend = true; - if (global.uploadOrder == 0) + if (global.uploadOrder === 0) isAppend = false; if (global.uploadOrder >= global.chunks.length) { progressTextDiv.innerText = global.uploadFiles[global.fileOrder - 1].name + "上传已完成"; @@ -664,18 +664,18 @@ var uploadInternal = function () { } }); global.uploadOrder++; - return; - - var pingObj = {}; - pingObj.isAppend = false; - pingObj.isPrivate = $("#privateprojecttab").hasClass("active"); - pingObj.path = global.lastClickProjectName; - pingObj.fileName = global.uploadFileName; - pingObj.action = "uploadFile"; - var text = btoa(new Uint8Array(chunk.arrayBuffer)); - - pingObj.content = text; - global.filewssocket.send(JSON.stringify(pingObj)); + // return; + // + // var pingObj = {}; + // pingObj.isAppend = false; + // pingObj.isPrivate = $("#privateprojecttab").hasClass("active"); + // pingObj.path = global.lastClickProjectName; + // pingObj.fileName = global.uploadFileName; + // pingObj.action = "uploadFile"; + // var text = btoa(new Uint8Array(chunk.arrayBuffer)); + // + // pingObj.content = text; + // global.filewssocket.send(JSON.stringify(pingObj)); } @@ -723,7 +723,7 @@ var cancelUpload = function () { var downloadContract = function (projectName) { // console.log(window.location.href); let url; - if (global.urlparam) { + if (global.urlparam && global.urlparam.nodeAddr) { if (location.href.startsWith("https")) { url = "https://"; } else { @@ -731,7 +731,7 @@ var downloadContract = function (projectName) { } url += `${global.urlparam.nodeAddr}/SCIDE/CMManager?`; } else { - if (window.location.href.indexOf("/SCIDE") != -1) + if (window.location.href.indexOf("/SCIDE") !== -1) url = window.location.href.replace("/OnlineIDE.html", "/CMManager?"); else url = window.location.href.replace("/OnlineIDE.html",