Maintain redundant copies of Astronomy Engine source in demo folders.

Windows does not support relative links in Git by default.
This broke the first-time experience for Windows users.
From now on I will maintain copies of the astronomy.js
and astronomy.py in the demo folders, so that the demos
will work on Windows immediately after cloning the repo.
This commit is contained in:
Don Cross
2020-08-10 11:08:27 -04:00
parent f8cc44a0a5
commit db9eb6b180
17 changed files with 22353 additions and 12 deletions

7173
demo/browser/astronomy.js Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
../../source/js/astronomy.min.js

View File

@@ -3,7 +3,7 @@
<head>
<title>Solar System Barycenter</title>
<link rel="stylesheet" href="barycenter.css">
<script src="astronomy.min.js"></script>
<script src="astronomy.js"></script>
<script>
window.onload = function() {
const ReservedPixelsBottom = 70;

View File

@@ -108,7 +108,7 @@
</p>
</body>
<script src="../../source/js/astronomy.js"></script>
<script src="astronomy.js"></script>
<script>
window.onload = function() {
var QuarterName = ['New Moon', 'First Quarter', 'Full Moon', 'Third Quarter'];

View File

@@ -126,7 +126,7 @@
</body>
<script src="../../source/js/astronomy.js"></script>
<script src="astronomy.js"></script>
<script>
function OnToggleAutoTime() {
const checkbox = document.getElementById('AutoTimeCheckBox');

View File

@@ -61,7 +61,7 @@
</body>
<script src="../../source/js/astronomy.js"></script>
<script src="astronomy.js"></script>
<script>
window.onload = function() {
const StorageKey = 'AstroDemo.Options';

7173
demo/nodejs/astronomy.js Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
node culminate latitude longitude [date]
*/
const Astronomy = require('../../source/js/astronomy.js');
const Astronomy = require('astronomy.js');
function ParseNumber(text, name) {
const x = Number(text);

View File

@@ -12,7 +12,7 @@
*/
'use strict';
const Astronomy = require('../../source/js/astronomy.js');
const Astronomy = require('astronomy.js');
const NUM_SAMPLES = 4;

View File

@@ -11,7 +11,7 @@
node lunar_eclipse [date]
*/
const Astronomy = require('../../source/js/astronomy.js');
const Astronomy = require('astronomy.js');
function Pad(s, w) {
s = s.toFixed(0);

View File

@@ -12,7 +12,7 @@
node moonphase [date]
*/
const Astronomy = require('../../source/js/astronomy.js'); // adjust path as needed for your system
const Astronomy = require('astronomy.js');
function Pad(s, w) {
s = s.toFixed(0);

View File

@@ -23,7 +23,7 @@
for example the ISO 8601 UTC format "yyyy-mm-ddThh:mm:ssZ".
*/
const Astronomy = require('../../source/js/astronomy.js'); // adjust path as needed for your system
const Astronomy = require('astronomy.js');
function Format(x) {
return x.toFixed(2).padStart(8);

View File

@@ -11,7 +11,7 @@
node riseset latitude longitude [date]
*/
const Astronomy = require('../../source/js/astronomy.js'); // adjust path as needed for your system
const Astronomy = require('astronomy.js');
function DisplayEvent(name, evt) {
let text = evt ? evt.date.toISOString() : '';

View File

@@ -11,7 +11,7 @@
node riseset latitude longitude [date]
*/
const Astronomy = require('../../source/js/astronomy.js'); // adjust path as needed for your system
const Astronomy = require('astronomy.js');
function DisplayEvent(name, evt) {
let text = evt ? evt.date.toISOString() : '';

7980
demo/python/astronomy.py Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -64,4 +64,9 @@ echo "Generating Python documentation."
python3 ../pydown/pydown.py ../pydown/py_prefix.md ../source/python/astronomy.py ../source/python/README.md || Fail "Error generating Markdown from Python source."
./check_internal_links.py $(realpath ../source/python/README.md) || exit 1
echo "Making redundant copies of source in demo folders."
cp -v ../source/js/astronomy.js ../demo/browser/ || exit $?
cp -v ../source/js/astronomy.js ../demo/nodejs/ || exit $?
cp -v ../source/python/astronomy.py ../demo/python/ || exit $?
exit 0

View File

@@ -148,4 +148,15 @@ echo.Generating Python documentation.
..\pydown\pydown.py ..\pydown\py_prefix.md ..\source\python\astronomy.py ..\source\python\README.md
if errorlevel 1 (exit /b 1)
echo.Making redundant copies of source in demo folders.
copy ..\source\js\astronomy.js ..\demo\browser\
if errorlevel 1 (exit /b 1)
copy ..\source\js\astronomy.js ..\demo\nodejs\
if errorlevel 1 (exit /b 1)
copy ..\source\python\astronomy.py ..\demo\python\
if errorlevel 1 (exit /b 1)
exit /b 0