chrislgarry / Apollo-11

Original Apollo 11 Guidance Computer (AGC) source code for the command and lunar modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contribution: easier way to view the AGC scans

lurch opened this issue Β· comments

I was finding it quite tedious navigating through the AGC scans on ibiblio "by hand", so I knocked up a little HTML page which uses some buttons and some Javascript to make the scans much easier to navigate πŸ˜ƒ

<HTML>
<HEAD>
<TITLE>AGC scans viewer</TITLE>
<SCRIPT>
function changeDir(newdir) {
	showPage()
}
function showPrevious() {
	newpage = parseInt(document.form.pagenum.value) - 1;
	if (newpage >= 1) {
		changePage(newpage);
	}
}
function showNext() {
	newpage = parseInt(document.form.pagenum.value) + 1;
	if (newpage <= 9999) {
		changePage(newpage);
	}
}
function changePage(page) {
	document.form.pagenum.value = page;
	showPage();
}
function showPage() {
	page = parseInt(document.form.pagenum.value);
	if ((page >= 1) && (page <= 9999)) {
		formatted = "000" + page;
		formatted = formatted.substr(formatted.length - 4);
		imgUrl = "http://www.ibiblio.org/apollo/ScansForConversion/" + document.form.directory.value + "/" + formatted + ".jpg";
		document.body.style.cursor = "progress";
		document.image.src = imgUrl;
	}
}
</SCRIPT>
</HEAD>
<BODY onLoad="showPage()">
<FORM NAME=form onSubmit="return false">
<SELECT NAME="directory" onChange="changeDir(this.value)"><OPTION>Comanche055</OPTION><OPTION>Luminary099</OPTION><SELECT>
<INPUT TYPE=BUTTON onClick="showPrevious()" VALUE="&lt;">
<INPUT TYPE=TEXT NAME=pagenum onChange="changePage(parseInt(this.value))" SIZE=5 MAXLENGTH=4 VALUE=1>
<INPUT TYPE=BUTTON onClick="showNext()" VALUE="&gt;">
</FORM>
<IMG NAME=image onLoad="this.title=this.src;document.body.style.cursor='default'" WIDTH=1314 HEIGHT=1000></IMG>
</BODY>
</HTML>

It doesn't really make sense to submit a PR for this though, as GitHub only displays the source-code of HTML pages, rather than allowing the browser to render the HTML itself. See e.g. https://github.com/lurch/Apollo-11/blob/master/view_scans.html

So if you have somewhere suitable to host this file, then feel free! I release it into the Public Domain so do with it whatever you like.
In a worst-case scenario, you can simply download it onto your computer and open it in your web-browser as a local file (which is exactly how I tested it).

Thank you for this!

So if you have somewhere suitable to host this file, then feel free!

We can probably host it on GitHub Pages. I've modified the code slightly and committed it to the gh-pages branch, but @chrislgarry would need to enable Pages in the repository settings to use it.

For now I have it mirrored on a CodeSandbox instance: https://28gpc.csb.app/

image

Cool. Now that you've added the COMANCHE055_PAGES and LUMINARY099_PAGES constants (I thought about that, but couldn't be bothered πŸ˜‰ ), I guess you could also add "First Page" and "Last Page" buttons.

Added :)

commented

Hey yo! I added a few styles to the buttons and added dark mode, check out my PR #778

hi this a new girl at this