summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/html
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-09-30 17:47:13 -0400
committerFranklin Wei <git@fwei.tk>2017-09-30 20:06:50 -0400
commitb9386109e8f0cf346037b72464577fe19bba2d43 (patch)
treef0c15f6c80043376ec94d23cb1b681324eb3df3d /apps/plugins/puzzles/src/html
parentea679de8371e4e74fe4e78fb8df8e5df19efffdc (diff)
downloadrockbox-b9386109e8f0cf346037b72464577fe19bba2d43.zip
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.gz
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.bz2
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.xz
puzzles: resync with upstream
This brings puzzles to upstream commit 84d3fd2. Change-Id: I808a197f868032d771fc101a15666c5ec4b9f94b
Diffstat (limited to 'apps/plugins/puzzles/src/html')
-rwxr-xr-xapps/plugins/puzzles/src/html/jspage.pl35
1 files changed, 30 insertions, 5 deletions
diff --git a/apps/plugins/puzzles/src/html/jspage.pl b/apps/plugins/puzzles/src/html/jspage.pl
index a21f977..b409783 100755
--- a/apps/plugins/puzzles/src/html/jspage.pl
+++ b/apps/plugins/puzzles/src/html/jspage.pl
@@ -3,6 +3,17 @@
use strict;
use warnings;
+my $jspath = "";
+while ($ARGV[0] =~ /^-/) {
+ my $opt = shift @ARGV;
+ last if $opt eq "--";
+ if ($opt =~ /^--jspath=(.+)$/) {
+ $jspath = $1;
+ } else {
+ die "jspage.pl: unrecognised option '$opt'\n";
+ }
+}
+
open my $footerfile, "<", shift @ARGV or die "footer: open: $!\n";
my $footer = "";
$footer .= $_ while <$footerfile>;
@@ -62,7 +73,7 @@ EOF
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ASCII" />
<title>${puzzlename}, ${unfinishedtitlefragment}from Simon Tatham's Portable Puzzle Collection</title>
-<script type="text/javascript" src="${filename}.js"></script>
+<script type="text/javascript" src="${jspath}${filename}.js"></script>
<style class="text/css">
/* Margins and centring on the top-level div for the game menu */
#gamemenu { margin-top: 0; margin-bottom: 0.5em; text-align: center }
@@ -103,6 +114,15 @@ EOF
color: rgba(0,0,0,0.5);
}
+#gamemenu ul li.separator {
+ color: transparent;
+ border: 0;
+}
+
+#gamemenu ul li.afterseparator {
+ border-left: 1px solid rgba(0,0,0,0.3);
+}
+
#gamemenu ul li:first-of-type {
/* Reinstate the left border for the leftmost top-level menu item */
border-left: 1px solid rgba(0,0,0,0.3);
@@ -196,14 +216,19 @@ ${unfinishedpara}
<hr>
<div id="puzzle" style="display: none">
-<div id="gamemenu"><ul><li id="new">New game</li
+<div id="gamemenu"><ul><li>Game...<ul
+><li id="specific">Enter game ID</li
+><li id="random">Enter random seed</li
+><li id="save">Download save file</li
+><li id="load">Upload save file</li
+></ul></li
+><li>Type...<ul id="gametype"></ul></li
+><li class="separator"></li
+><li id="new" class="afterseparator">New game</li
><li id="restart">Restart game</li
><li id="undo">Undo move</li
><li id="redo">Redo move</li
><li id="solve">Solve game</li
-><li id="specific">Enter game ID</li
-><li id="random">Enter random seed</li
-><li>Select game type<ul id="gametype" class="left"></ul></li
></ul></div>
<div align=center>
<div id="resizable" style="position:relative; left:0; top:0">