MCPcopy Create free account
hub / github.com/JKPotato-Computer/SignMaker / exportData

Function exportData

js/main copy.js:375–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373 }
374
375 const exportData = function() {
376 var dataToSave = post.polePosition + ";";
377 for (let i = 0; i < post.panels.length; i++) {
378 var panel = post.panels[i];
379 function add(data) {
380 dataToSave += data + ";";
381 };
382
383 function add2(data) {
384 dataToSave += data;
385 }
386
387 function add_string(data) {
388 dataToSave += `"` + data + `";`;
389 };
390
391 function add_string2(data) {
392 dataToSave += `"` + data + `"`;
393 };
394
395
396
397 function new_chunk() {
398 dataToSave += ":";
399 };
400
401 function shield(shieldIndex) {
402 add(panel.sign.shields[shieldIndex].type);
403 add(panel.sign.shields[shieldIndex].routeNumber);
404 add(panel.sign.shields[shieldIndex].to);
405 add(panel.sign.shields[shieldIndex].specialBannerType);
406 add(panel.sign.shields[shieldIndex].bannerType);
407 add(panel.sign.shields[shieldIndex].bannerType2);
408 add2(panel.sign.shields[shieldIndex].bannerPosition);
409 dataToSave += ","
410 }
411
412 function specialshield(shieldIndex) {
413 add(panel.sign.shields[shieldIndex].type);
414 add(panel.sign.shields[shieldIndex].routeNumber);
415 add(panel.sign.shields[shieldIndex].to);
416 add(panel.sign.shields[shieldIndex].specialBannerType);
417 add(panel.sign.shields[shieldIndex].bannerType);
418 add(panel.sign.shields[shieldIndex].bannerType2);
419 add2(panel.sign.shields[shieldIndex].bannerPosition);
420 }
421
422 add(panel.color);
423 add2(panel.corner);
424 new_chunk();
425
426 var value = panel.exitTab.number;
427
428 if ((value == "") || (value == null)) {
429 value = null;
430 }
431
432 add(value);

Callers

nothing calls this directly

Calls 7

addFunction · 0.85
add2Function · 0.85
new_chunkFunction · 0.85
shieldFunction · 0.85
specialshieldFunction · 0.85
add_stringFunction · 0.85
add_string2Function · 0.85

Tested by

no test coverage detected