-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathset_defaults.html
executable file
·1 lines (1 loc) · 8.67 KB
/
set_defaults.html
1
<!DOCTYPE html><html><meta charset="UTF-8"><head><link rel="stylesheet" href="sidereal_min.css"><title>Change Default Settings</title><style>.result{color:brown}</style><script src="jquery-3.6.4.min.js"></script><script src="set_defaults_min.js"></script></head><body><div id="wrapper"><br><h1>Change Default Settings for the Local Star Charts Page</h1><p>The best way to change the default locations for the local star charts page is to edit the file <code>sidereal.js</code>, as explained in the <a href="docs/star_charts.pdf">documentation</a>. Here I entertain the idea of using the url query string to set the defaults. Fill in the following form to obtain the query string for new default settings.</p><hr><h2>New Default Settings</h2><br><p><b>Location 1</b></p><p><input type="radio" id="Loc1Manual" name="Loc1Button" onclick="switchLocForm(1,0)"> <label for="Loc1Manual">Manually enter the location information</label> <input type="radio" id="Loc1Select" name="Loc1Button" onclick="switchLocForm(1,1)"> <label for="Loc1Select">Choose from a database</label></p><div id="Loc1Form0"><p id="geoloc"><button onclick="geoloc()">Determine Location 1 by GPS/IP address</button> <span id="geolocmessage"></span></p><p id="geolocerr" style="color:red"></p><p>* To prevent abuse by malicious users, the name of the location will not be set and will just be blank.</p><p>Longitude: <input type="number" id="long1in" step="any" min="-180" max="180"> degrees (positive in eatern hemisphere and negative in western hemisphere)</p><p>Latitude: <input type="number" id="lat1in" step="any" min="-90" max="90"> degrees (positive in northern hemiphere and negative in southern hemisphere)</p><p>Time zone: <input type="radio" id="tz1Computer" name="tz1radio"> <label for="tz1Computer">Set by computer's clock</label> <span id="tz1ClockSpan"></span> <input type="radio" id="tz1Custom" name="tz1radio"><label for="tz1Custom">Custom:</label> GMT+<input type="number" id="tz1in" step="any" min="-12" max="12"></p><br></div><div id="Loc1Form1" style="display:none"></div><p>Set initial time: <input type="radio" id="setTimeComputer" name="setTime1" onclick='showHide("timeInputLoc1",0)'> <label for="setTimeComputer">Use computer's clock (recommended)</label> <input type="radio" id="setTimeCustom" name="setTime1" onclick='showHide("timeInputLoc1",1)'> <label for="setTimeCustom">Custom</label></p><table><tr class="timeInputLoc1"><td>Year: <input type="number" id="year1in" step="1" min="-200000" max="200000"></td><td>Month: <input type="number" id="month1in" step="1" min="1" max="12"></td><td>Day: <input type="number" id="day1in" step="1" min="1" max="31"></td></tr><tr class="timeInputLoc1"><td>Hour: <input type="number" id="hour1in" step="1" min="0" max="23"></td><td>Minute: <input type="number" id="minute1in" step="1" min="0" max="59"></td><td>Second: <input type="number" id="second1in" step="1" min="0" max="59"></td></tr></table><br><p>Azimuth at the top of the star chart: <input type="number" id="azi1" step="1" value="0" size="5">degrees</p><p>Initial states of the show/hide buttons (click buttons to change the states)</p><div class="control"><p><button id="showPlanets1" class="active" onclick='toggleActive(1,"Planets")'>Sun, Moon, Planets</button> <button id="showEquator1" onclick='toggleActive(1,"Equator")'>Equator</button> <button id="showEcliptic1" onclick='toggleActive(1,"Ecliptic")'>Ecliptic</button> <button id="showGalactic1" onclick='toggleActive(1,"Galactic")'>Galactic</button> <button id="showMilkyWay1" class="active" onclick='toggleActive(1,"MilkyWay")'>Milky Way</button> <button id="showConLines1" class="active" onclick='toggleActive(1,"ConLines")'>Con. lines</button> <button id="showConLab1" onclick='toggleActive(1,"ConLab")'>Con. labels</button> <button id="showDayNight1" class="active" onclick='toggleActive(1,"DayNight")'>Day/Night</button></p></div><br><p><b>Location 2</b></p><p><input type="radio" id="Loc2Manual" name="Loc2Button" onclick="switchLocForm(2,0)"> <label for="Loc2Manual">Manually enter the location information</label> <input type="radio" id="Loc2Select" name="Loc2Button" onclick="switchLocForm(2,1)"> <label for="Loc2Select">Choose from a database</label></p><div id="Loc2Form0"><p>* To prevent abuse by malicious users, the name of the location will not be set and will just be blank.</p><p>Longitude: <input type="number" id="long2in" step="any" min="-180" max="180"> degrees (positive in eatern hemisphere and negative in western hemisphere)</p><p>Latitude: <input type="number" id="lat2in" step="any" min="-90" max="90"> degrees (positive in northern hemiphere and negative in southern hemisphere)</p><p>Time zone: GMT+<input type="number" id="tz2in" step="any" min="-12" max="12"></p></div><div id="Loc2Form1" style="display:none"></div><p>Set initial time:</p><table><tr><td colspan="3">Set the same time as in location 1 (same GMT but time zone may differ)? <input onchange='showHide("timeInputLoc2",0)' type="radio" id="synTimeYes" value="1" name="synTime"><label for="synTimeYes">Yes</label> <input onchange='showHide("timeInputLoc2",1)' type="radio" id="synTimeNo" name="synTime" value="0"><label for="synTimeNo">No</label></td></tr><tr class="timeInputLoc2"><td>Year: <input type="number" id="year2in" step="1" min="-200000" max="200000"></td><td>Month: <input type="number" id="month2in" step="1" min="1" max="12"></td><td>Day: <input type="number" id="day2in" step="1" min="1" max="31"></td></tr><tr class="timeInputLoc2"><td>Hour: <input type="number" id="hour2in" step="1" min="0" max="23"></td><td>Minute: <input type="number" id="minute2in" step="1" min="0" max="59"></td><td>Second: <input type="number" id="second2in" step="1" min="0" max="59"></td></tr></table><br><p>Azimuth at the top of the star chart: <input type="number" id="azi2" step="1" value="0" size="5">degrees</p><p>Initial states of the show/hide buttons (click buttons to change the states)</p><div class="control"><p><button id="showPlanets2" class="active" onclick='toggleActive(2,"Planets")'>Sun, Moon, Planets</button> <button id="showEquator2" onclick='toggleActive(2,"Equator")'>Equator</button> <button id="showEcliptic2" onclick='toggleActive(2,"Ecliptic")'>Ecliptic</button> <button id="showGalactic2" onclick='toggleActive(2,"Galactic")'>Galactic</button> <button id="showMilkyWay2" class="active" onclick='toggleActive(2,"MilkyWay")'>Milky Way</button> <button id="showConLines2" class="active" onclick='toggleActive(2,"ConLines")'>Con. lines</button> <button id="showConLab2" onclick='toggleActive(2,"ConLab")'>Con. labels</button> <button id="showDayNight2" class="active" onclick='toggleActive(2,"DayNight")'>Day/Night</button></p></div><br><p><input type="button" value="Submit" onclick="generateQueryString()"></p><div id="result"></div><hr><h3>Notes</h3><ol><li>If the computer's clock is set according to the time zone of location 1, it should be used to set the time zone for location 1 here as well since the daylight saving time, if any, would be handled automatically.</li><li>The database currently only contains major cities in the world. <a href="city.html">Here</a> is a list of all cities in the database. It is not difficult to add more cities, but a better API is required for users to easily search for a city when the number is large.</li><li>When a city is selected from the database, the custom time zone value will be filled in automatically according to the information in the database. Daylight saving time, if any, is not taken into account. You are encouraged to check the accuracy of the value and make any necessary adjustment.</li><li>The azimuth-at-the-top parameter is used to rotate the star chart, which is convenient for laptop and desktop users since the the device's screens can't be rotated easily. 0° means north is at the top, south at the bottom (useful for looking at stars near the southern horizon); 90° means east is at the top, west at the bottom (useful for looking at stars near the western horizon). 180° means south is at the top, north at the bottom; 270° means west is at the top, east at the bottom.</li><li>Links with query strings can also be used to show people star charts at particular times and locations without having them manually enter the information. To prevent malicious users from embedding inappropriate messages or scripts, location names are not set by the query string and the names of the manually entered locations will be blank.</li></ol></div><noscript><h2>Oops!</h2><p>You must enable JavaScript to use this page.</p><p>Please enable JavaScript and reload.</p></noscript><br><br><footer><hr><p style="text-align:center">© 2018–2025 by Yuk Tung Liu</p></footer><script>init()</script></body></html>