Skip to content

Commit

Permalink
Merge pull request tweecode#8 from tmedwards/master
Browse files Browse the repository at this point in the history
Updated the test play/start at passage feature to be header agnostic.
  • Loading branch information
webbedspace committed Dec 18, 2013
2 parents 0dea8c5 + bc863da commit f4c69ae
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
2 changes: 2 additions & 0 deletions targets/Responsive/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

"SUGARCANE"

testplay = "START_AT";

}());
</script>
<script title="modules">
Expand Down
32 changes: 17 additions & 15 deletions targets/jonah/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

"JONAH"

testplay = "START_AT";

// CssLexer/CssParser
// Copyright (C) 2010 Google Inc.
//
Expand Down Expand Up @@ -74,7 +76,7 @@
<script title="modules">
"JQUERY"
"MODERNIZR"
</script>
</script>
<style id="baseCSS">
body {
background-color: #f8f8f8;
Expand Down Expand Up @@ -265,21 +267,21 @@
}
</style>
<style id="storyCSS"></style>
<style id="tagCSS"></style>
</head>
<style id="tagCSS"></style>
</head>
<body>
<div id="floater"><div class="container">
<div id="storyMenu"></div>
<div id="floater"><div class="container">
<div id="storyMenu"></div>
<p><a id="restart" href="#">Restart Story</a></p>
</div></div>
<div id="content1"><div id="content2">
<div id="header"></div><div id="titleLine"></div>
<h1><span id="storyTitle"></span></h1>
<h2><span id="storySubtitle"></span></h2>
</div></div>
<div id="content1"><div id="content2">
<div id="header"></div><div id="titleLine"></div>
<h1><span id="storyTitle"></span></h1>
<h2><span id="storySubtitle"></span></h2>
<h3><span id="storyAuthor"></span></h3>
<div id="passages"><noscript><div id="noscript">Please enable Javascript to play this story!</div></noscript></div>
<p id="footer">
This story was created with <a class="externalLink" href="http://twinery.org/">Twine</a> and is powered by <a class="externalLink" href="http://www.tiddlywiki.com/">TiddlyWiki</a>.
</p>
</div></div>
<div id="passages"><noscript><div id="noscript">Please enable Javascript to play this story!</div></noscript></div>
<p id="footer">
This story was created with <a class="externalLink" href="http://twinery.org/">Twine</a> and is powered by <a class="externalLink" href="http://www.tiddlywiki.com/">TiddlyWiki</a>.
</p>
</div></div>
<div id="storeArea">"STORY"</div></body></html>
2 changes: 2 additions & 0 deletions targets/sugarcane/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

"SUGARCANE"

testplay = "START_AT";

}());
</script>
<script title="modules">
Expand Down
13 changes: 8 additions & 5 deletions tiddlywiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,20 @@ def insertEngine(app, output, filename, label, extra = ''):
# Insert version number
output = output.replace('"VERSION"', "Made in " + app.NAME + " " + app.VERSION)

# Set up the test play variable
# Insert the test play "start at passage" value
if (startAt):
startAt = 'testplay = "' + startAt.replace('\\', r'\\').replace('"', '\"') + '";'
output = output.replace('"START_AT"', '"' + startAt.replace('\\', r'\\').replace('"', '\"') + '"')
else:
output = output.replace('"START_AT"', '""')

# Insert the main engine
output = insertEngine(app, output, 'engine.js', '"ENGINE"', startAt)
output = insertEngine(app, output, 'engine.js', '"ENGINE"')
if not output: return

# Insert Sugarcane/Jonah code if the storyformat is a Sugarcane/Jonah offshoot
output = insertEngine(app, output, 'sugarcane/code.js', '"SUGARCANE"', startAt)
output = insertEngine(app, output, 'sugarcane/code.js', '"SUGARCANE"')
if not output: return
output = insertEngine(app, output, 'jonah/code.js', '"JONAH"', startAt)
output = insertEngine(app, output, 'jonah/code.js', '"JONAH"')
if not output: return

falseOpts = ["false", "off", "0"]
Expand Down

0 comments on commit f4c69ae

Please sign in to comment.