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

Function readForm

js/main copy.js:495–661  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

493 * Redraw the page.
494 */
495 const readForm = function() {
496 const form = document.forms[0];
497 const panel = post.panels[currentlySelectedPanelIndex];
498
499 // Post
500 post.polePosition = form["postPosition"].value;
501
502 post.fontType = form["fontChange"].checked;
503
504 post.showPost = form["showPost"].checked;
505 if (post.firstPanel == false) {
506 var current = parseInt(form["panelNo"].value) - 1;
507
508 if (current < 0) {
509 current = 0
510 } else if (current > post.panels.length - 1) {
511 current = post.panels.length - 1
512 }
513
514 post.panelNo = current;
515
516 } else {
517 post.panelNo = 0;
518 }
519
520
521 // Exit Tab
522 panel.color = form["panelColor"].value;
523 panel.corner = form["panelCorner"].value;
524 panel.exitTab.number = form["exitNumber"].value;
525 panel.exitTab.width = form["exitTabWidth"].value;
526 panel.exitTab.position = form["exitTabPosition"].value;
527
528 // Left Tab
529 panel.left = form["showLeft"].checked;
530 panel.leftPosition = form["LeftPosition"].value;
531
532 // Sign
533 panel.sign.controlText = form["controlText"].value;
534 panel.sign.shieldPosition = form["shieldsPosition"].value;
535 panel.sign.guideArrow = form["guideArrow"].value;
536 panel.sign.guideArrowLanes = form["guideArrowLanes"].value;
537 panel.sign.arrowPosition = form["arrowLocations"].value;
538
539 panel.sign.exitguideArrows = form["exitOnlyDirection"].value;
540 panel.sign.showExitOnly = form["showExitOnly"].checked;
541
542 panel.sign.otherSymbol = form["otherSymbol"].value;
543 panel.sign.oSNum = form["oSNum"].value;
544 panel.sign.actionMessage = form["actionMessage"].value;
545 panel.sign.actionMessage = panel.sign.actionMessage.replace("1/2", "½");
546 panel.sign.actionMessage = panel.sign.actionMessage.replace("1/4", "¼");
547 panel.sign.actionMessage = panel.sign.actionMessage.replace("3/4", "¾");
548 panel.sign.advisoryMessage = form["outActionMessage"].checked;
549
550 panel.sign.exitTabColor = form["exitColor"].value;
551 panel.exitTab.oldFont = form["exitFont"].checked;
552

Callers

nothing calls this directly

Calls 1

redrawFunction · 0.70

Tested by

no test coverage detected