You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div>This is the demo for the Strip Map Generator.<br>Paste in your JSON and hit 'Generate Map'. Make sure to not have a variable declaration (i.e. <code>var line_name = ...</code>) or a trailing <code>;</code> in the JSON below or it will not work on certain browsers.</div>
24
+
<div>If there are issues (for example, one of the sample maps doesn't render when you hit 'Generate Map'), please post an issue on <atarget="_blank" href="https://github.com/Sparen/StripMapGen/issues">GitHub</a>. This may be due to an oversight, as the syntax parsing for this demo is stricter than the parsing when the library is hooked into normally.</div>
// This code powers the demo, loading and saving to Local Storage as well as calling the generator methods.
4
+
// This code is heavily based on the older Map Generator and many of the functions have been copied verbatim.
5
+
6
+
//Setup first time on load. Defaults to Baltimore
7
+
functiondemo_setup(){
8
+
varsuccess=false;
9
+
if(typeof(Storage)!=="undefined"){
10
+
//If preexisting work exists, load it.
11
+
vartemp=localStorage.getItem("storage1");
12
+
if(temp!==undefined&&temp!==null&&temp!==""){
13
+
document.getElementById("json1").value=temp;
14
+
success=true;
15
+
}
16
+
vartemp2=localStorage.getItem("storage2");
17
+
if(temp2!==undefined&&temp2!==null&&temp2!==""){
18
+
document.getElementById("json2").value=temp2;
19
+
success=true;
20
+
}
21
+
}else{
22
+
alert("Your browser does not support Local Storage. Your work will not be saved, so please make sure to copy it to your local computer if you wish to continue working on it at a later time.");
23
+
}
24
+
if(success){
25
+
return;
26
+
}
27
+
//Initialize contents of text area if new user/no storage saved
0 commit comments