Skip to content

Commit 24d039f

Browse files
authored
Merge pull request #874 from MatzElectronics/demo
Fix upload file checksumming
2 parents 2c499ef + 93052b8 commit 24d039f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/webapp/cdn/editor.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ function downloadCode() {
258258
value = value.replace(/[\\/:*?\"<>|]/g, '_');
259259

260260
var xmlChecksum = hashCode(projXMLcode).toString();
261+
261262
var xmlChecksum = '000000000000'.substring(xmlChecksum.length, 12) + xmlChecksum;
262263

263264
// Assemble both the SVG (image) of the blocks and the blocks' XML definition
@@ -274,8 +275,9 @@ function uploadHandler(files) {
274275

275276
var UploadReader = new FileReader();
276277
UploadReader.onload = function() {
277-
var parsed = new DOMParser().parseFromString(this.result, "text/xml");
278-
var xmlString = (new XMLSerializer()).serializeToString(parsed);
278+
//var parsed = new DOMParser().parseFromString(this.result, "text/xml");
279+
//var xmlString = (new XMLSerializer()).serializeToString(parsed);
280+
var xmlString = this.result;
279281
var xmlValid = false;
280282
var uploadBoardType = '';
281283

@@ -290,9 +292,7 @@ function uploadHandler(files) {
290292
uploadedXML = xmlString.substring(xmlString.indexOf("<block"), (xmlString.length - 29));
291293
var computedChecksum = hashCode(uploadedXML).toString();
292294
computedChecksum = '000000000000'.substring(computedChecksum.length, 12) + computedChecksum;
293-
294-
alert("uploaded = " + uploadedChecksum + "\ncomputed = " + computedChecksum);
295-
295+
296296
if(computedChecksum === uploadedChecksum) xmlValid = true;
297297

298298
if(xmlValid) {

0 commit comments

Comments
 (0)