Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribution: easier way to view the AGC scans #690

Open
lurch opened this issue Aug 2, 2020 · 5 comments
Open

Contribution: easier way to view the AGC scans #690

lurch opened this issue Aug 2, 2020 · 5 comments
Labels
Type: Meta Translations and other changes outside source code

Comments

@lurch
Copy link
Contributor

lurch commented Aug 2, 2020

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).

wopian added a commit that referenced this issue Aug 3, 2020
Adds code with modifications from #690
@wopian
Copy link
Collaborator

wopian commented Aug 3, 2020

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

@wopian wopian added the Type: Meta Translations and other changes outside source code label Aug 3, 2020
@lurch
Copy link
Contributor Author

lurch commented Aug 3, 2020

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.

@wopian
Copy link
Collaborator

wopian commented Aug 3, 2020

Added :)

@Illusion47586
Copy link

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

@Htorres507

This comment has been minimized.

@chrislgarry chrislgarry unpinned this issue Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Meta Translations and other changes outside source code
Projects
None yet
Development

No branches or pull requests

4 participants