()
| 338 | |
| 339 | // Read the form and update the page by redrawing it. |
| 340 | const readForm = function() { |
| 341 | const form = document.forms[0]; |
| 342 | const panel = post.panels[currentlySelectedPanelIndex]; |
| 343 | const subPanel = (currentlySelectedSubPanelIndex != -1) ? panel.sign.subPanels[currentlySelectedSubPanelIndex] : panel.sign; |
| 344 | const exitTab = (currentlySelectedNestedExitTabIndex != -1) ? exitTab.nestedExitTabs[currentlySelectedNestedExitTabIndex] : panel.exitTabs[currentlySelectedExitTabIndex]; |
| 345 | |
| 346 | // Post |
| 347 | post.polePosition = form["postPosition"].value; |
| 348 | post.fontType = form["fontChange"].checked; |
| 349 | post.showPost = form["showPost"].checked; |
| 350 | post.secondExitOnly = form["secondExitOnly"].checked; |
| 351 | |
| 352 | // Panel |
| 353 | panel.color = form["panelColor"].value; |
| 354 | panel.corner = form["panelCorner"].value; |
| 355 | |
| 356 | // Exit Tab |
| 357 | exitTab.number = form["exitNumber"].value; |
| 358 | exitTab.width = form["exitTabWidth"].value; |
| 359 | exitTab.position = form["exitTabPosition"].value; |
| 360 | exitTab.color = form["exitColor"].value; |
| 361 | exitTab.variant = form["exitVariant"].value; |
| 362 | |
| 363 | if (exitTab.variant == "Toll") { |
| 364 | for (const tollOption of document.getElementsByName("tollOption")) { |
| 365 | if (tollOption.checked == true) { |
| 366 | if (tollOption.value != "custom") { |
| 367 | exitTab.icon = tollOption.value; |
| 368 | exitTab.useTextBasedIcon = false; |
| 369 | } else { |
| 370 | exitTab.icon = form["customTag"].value; |
| 371 | exitTab.useTextBasedIcon = true; |
| 372 | } |
| 373 | break; |
| 374 | } |
| 375 | } |
| 376 | } else if (exitTab.variant == "Icon") { |
| 377 | exitTab.icon = form["iconSelect"].value; |
| 378 | } else { |
| 379 | exitTab.icon = null; |
| 380 | } |
| 381 | |
| 382 | exitTab.FHWAFont = form["exitFont"].checked; |
| 383 | exitTab.showLeft = form["showLeft"].checked; |
| 384 | exitTab.fullBorder = form["fullBorder"].checked; |
| 385 | exitTab.topOffset = form["topOffset"].checked; |
| 386 | exitTab.borderThickness = form["borderThickness"].value; |
| 387 | exitTab.minHeight = form["minHeight"].value; |
| 388 | exitTab.fontSize = form["fontSize"].value; |
| 389 | |
| 390 | // Misc Shields |
| 391 | panel.sign.shieldBacks = form["shieldBacks"].checked; |
| 392 | |
| 393 | // Sign |
| 394 | if (document.getElementById("Visual").style.display == "block") { |
| 395 | panel.sign.padding = form["paddingTop"].value.toString() + "rem " + form["paddingRight"].value.toString() + "rem " + form["paddingBottom"].value.toString() + "rem " + form["paddingLeft"].value.toString() + "rem"; |
| 396 | } else { |
| 397 | panel.sign.padding = form["manualTop"].value.toString() + "rem " + form["manualRight"].value.toString() + "rem " + form["manualBottom"].value.toString() + "rem " + form["manualLeft"].value.toString() + "rem"; |
nothing calls this directly
no test coverage detected