HTML output now playable with JavaScript disabled or missing js file.
This commit is contained in:
parent
25fb3ec60c
commit
9f9e613d4d
|
@ -24,7 +24,7 @@
|
|||
.sectionnumber,.introsectionheading {font-weight: bolder;
|
||||
width: 100%;
|
||||
text-align: center;}
|
||||
.section {display: none; width: 90%; margin-left: 5%; margin-right: 5%;}
|
||||
.section {width: 90%; margin-left: 5%; margin-right: 5%;}
|
||||
.sectiontext {margin-top: 0.5em;}
|
||||
.gamebook {max-width: 30em; padding: 1em; width: 100%; font-size: 133%;}
|
||||
.collections {margin-top: 4em;}
|
||||
|
@ -47,4 +47,6 @@
|
|||
.sectionimage {width: 100%; padding: 1em;}
|
||||
.nodisplay {display: none;}
|
||||
.resumenr {font-weight: bold;}
|
||||
.counterChange {font-weight: bold;}
|
||||
.counterChange {font-weight: bold;}
|
||||
|
||||
a {text-decoration: none; color: black;}
|
|
@ -160,6 +160,11 @@ var gamebook = {
|
|||
this.displaySection(nr);
|
||||
},
|
||||
|
||||
prepare : function() {
|
||||
this.addClassToClass('section', 'nodisplay');
|
||||
this.runActionsInIntroSections();
|
||||
},
|
||||
|
||||
'start' : function() {
|
||||
this.hideIntroSections();
|
||||
this.addClassToClass('startlink', 'nodisplay');
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
<link rel="stylesheet" href="gamebookformat.css"
|
||||
type="text/css" />
|
||||
<script>
|
||||
gamebook.id = '%(id)s';
|
||||
if (typeof gamebook !== 'undefined') {
|
||||
gamebook.id = '%(id)s';
|
||||
}
|
||||
</script>
|
||||
#include "head-overrides"
|
||||
</head>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
if (this.gamebook) {
|
||||
gamebook.runActionsInIntroSections();
|
||||
if (typeof gamebook !== 'undefined') {
|
||||
gamebook.prepare();
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
<a class="sectionref enabledlink" data-ref="%(nr)d">%(nr)d</a>
|
||||
<a class="sectionref enabledlink" data-ref="%(nr)d"
|
||||
href="#section%(nr)d">%(nr)d</a>
|
|
@ -4,7 +4,7 @@
|
|||
<div class="startlink"
|
||||
onclick="gamebook.turnTo(1)">%(starttext)s</div>
|
||||
<script>
|
||||
if (gamebook.hasSavedGame()) {
|
||||
if (typeof gamebook !== 'undefined' && gamebook.hasSavedGame()) {
|
||||
var resumeLinks = document.getElementsByClassName('resumelink');
|
||||
Array.prototype.forEach.call(resumeLinks, function(e) {
|
||||
e.classList.remove('nodisplay');
|
||||
|
|
4
todo.org
4
todo.org
|
@ -1,4 +1,4 @@
|
|||
* TODO [48/72] [66%]
|
||||
* TODO [49/72] [68%]
|
||||
- [X] Debug output
|
||||
- [X] DOT output
|
||||
- [X] LaTeX output
|
||||
|
@ -59,7 +59,7 @@
|
|||
display somewhere on page (in HTML output)
|
||||
- [X] Counters increase/decrease
|
||||
- [X] Counters check
|
||||
- [ ] Make sure HTML output works with javascript disabled
|
||||
- [X] Make sure HTML output works with javascript disabled
|
||||
and in inferior browsers
|
||||
- [ ] Trade (optionally drop something from collection to add something new).
|
||||
- [ ] Buy (optionally decrease a counter to add something to a collection)
|
||||
|
|
Loading…
Reference in New Issue