summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorGravatarGravatar R. Belmont <rb6502@users.noreply.github.com>2013-09-24 14:02:47 +0000
committerGravatarGravatar R. Belmont <rb6502@users.noreply.github.com>2013-09-24 14:02:47 +0000
commit6e06426096420f20abb4e7f173b65c2d352f70a2 (patch) (github)
treed4c905970e0f67f60bca2e64a80233f945ee5fd1 /web
parent9197a7adafe105279c98b465bee1ef1e1c4d7c45 (diff)
downloadmame-6e06426096420f20abb4e7f173b65c2d352f70a2.tar.bz2
mame-6e06426096420f20abb4e7f173b65c2d352f70a2.zip
web: Fix web options reading from ini, improved load/save state UI [Firehawke]
Diffstat (limited to 'web')
-rw-r--r--web/commands.html142
-rw-r--r--web/index.html21
2 files changed, 157 insertions, 6 deletions
diff --git a/web/commands.html b/web/commands.html
index 3fc3fb7822a..1923d80bd1c 100644
--- a/web/commands.html
+++ b/web/commands.html
@@ -1,6 +1,138 @@
<a href="javascript:executeCommands('togglepause');" data-role="button">Toggle Pause</a>
-<a href="javascript:executeCommands('softreset');" data-role="button">Soft reset</a>
-<a href="javascript:executeCommands('hardreset');" data-role="button">Hard reset</a>
-<a href="javascript:loadContent('savestate');" data-transition="fade" data-role="button">Save State</a>
-<a href="javascript:loadContent('loadstate');" data-transition="fade" data-role="button">Load State</a>
-<a href="javascript:executeCommands('exit');" data-role="button">Exit</a>
+<a href="confirmsoftreset.html" data-rel="dialog" data-role="button">Soft reset</a>
+<a href="confirmhardreset.html" data-rel="dialog" data-role="button">Hard reset</a>
+<a href="#savestatepanel" data-transition="fade" data-role="button">Save State</a>
+<a href="#loadstatepanel" data-transition="fade" data-role="button">Load State</a>
+<a href="confirmexit.html" data-rel="dialog" data-role="button">Exit</a>
+
+<div data-role="panel" id="savestatepanel" data-position="left" data-display="overlay" data-theme="a">
+ <h3>Select position to save to</h3>
+
+<!-- Yes, it's a little ugly. I could redo this more cleanly with a little javascript, but not right now. -->
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="" data-rel="close" data-role="button">Cancel</a>
+ <a href="javascript:executeCommands('savestate&val=auto');" data-role="button">Autosave Slot</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=0');" data-role="button">0</a>
+ <a href="javascript:executeCommands('savestate&val=1');" data-role="button">1</a>
+ <a href="javascript:executeCommands('savestate&val=2');" data-role="button">2</a>
+ <a href="javascript:executeCommands('savestate&val=3');" data-role="button">3</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=4');" data-role="button">4</a>
+ <a href="javascript:executeCommands('savestate&val=5');" data-role="button">5</a>
+ <a href="javascript:executeCommands('savestate&val=6');" data-role="button">6</a>
+ <a href="javascript:executeCommands('savestate&val=7');" data-role="button">7</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=8');" data-role="button">8</a>
+ <a href="javascript:executeCommands('savestate&val=9');" data-role="button">9</a>
+ <a href="javascript:executeCommands('savestate&val=a');" data-role="button">A</a>
+ <a href="javascript:executeCommands('savestate&val=b');" data-role="button">B</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=c');" data-role="button">C</a>
+ <a href="javascript:executeCommands('savestate&val=d');" data-role="button">D</a>
+ <a href="javascript:executeCommands('savestate&val=e');" data-role="button">E</a>
+ <a href="javascript:executeCommands('savestate&val=f');" data-role="button">F</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=g');" data-role="button">G</a>
+ <a href="javascript:executeCommands('savestate&val=h');" data-role="button">H</a>
+ <a href="javascript:executeCommands('savestate&val=i');" data-role="button">I</a>
+ <a href="javascript:executeCommands('savestate&val=j');" data-role="button">J</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=k');" data-role="button">K</a>
+ <a href="javascript:executeCommands('savestate&val=l');" data-role="button">L</a>
+ <a href="javascript:executeCommands('savestate&val=m');" data-role="button">M</a>
+ <a href="javascript:executeCommands('savestate&val=n');" data-role="button">N</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=o');" data-role="button">O</a>
+ <a href="javascript:executeCommands('savestate&val=p');" data-role="button">P</a>
+ <a href="javascript:executeCommands('savestate&val=q');" data-role="button">Q</a>
+ <a href="javascript:executeCommands('savestate&val=r');" data-role="button">R</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=s');" data-role="button">S</a>
+ <a href="javascript:executeCommands('savestate&val=t');" data-role="button">T</a>
+ <a href="javascript:executeCommands('savestate&val=u');" data-role="button">U</a>
+ <a href="javascript:executeCommands('savestate&val=v');" data-role="button">V</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('savestate&val=w');" data-role="button">W</a>
+ <a href="javascript:executeCommands('savestate&val=x');" data-role="button">X</a>
+ <a href="javascript:executeCommands('savestate&val=y');" data-role="button">Y</a>
+ <a href="javascript:executeCommands('savestate&val=z');" data-role="button">Z</a>
+ </div>
+ <!-- This is here to prevent webkit from trying to put the last row of states under the bottom menu on small screens like phone-->
+ <br><br><br><br><br>
+</div>
+
+<div data-role="panel" id="loadstatepanel" data-position="left" data-display="overlay" data-theme="a">
+ <h3>Select position to load from</h3>
+
+<!-- Yes, it's a little ugly. I could redo this more cleanly with a little javascript, but not right now. -->
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="" data-rel="close" data-role="button">Cancel</a>
+ <a href="javascript:executeCommands('loadstate&val=auto');" data-role="button">Autoload Slot</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=0');" data-role="button">0</a>
+ <a href="javascript:executeCommands('loadstate&val=1');" data-role="button">1</a>
+ <a href="javascript:executeCommands('loadstate&val=2');" data-role="button">2</a>
+ <a href="javascript:executeCommands('loadstate&val=3');" data-role="button">3</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=4');" data-role="button">4</a>
+ <a href="javascript:executeCommands('loadstate&val=5');" data-role="button">5</a>
+ <a href="javascript:executeCommands('loadstate&val=6');" data-role="button">6</a>
+ <a href="javascript:executeCommands('loadstate&val=7');" data-role="button">7</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=8');" data-role="button">8</a>
+ <a href="javascript:executeCommands('loadstate&val=9');" data-role="button">9</a>
+ <a href="javascript:executeCommands('loadstate&val=a');" data-role="button">A</a>
+ <a href="javascript:executeCommands('loadstate&val=b');" data-role="button">B</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=c');" data-role="button">C</a>
+ <a href="javascript:executeCommands('loadstate&val=d');" data-role="button">D</a>
+ <a href="javascript:executeCommands('loadstate&val=e');" data-role="button">E</a>
+ <a href="javascript:executeCommands('loadstate&val=f');" data-role="button">F</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=g');" data-role="button">G</a>
+ <a href="javascript:executeCommands('loadstate&val=h');" data-role="button">H</a>
+ <a href="javascript:executeCommands('loadstate&val=i');" data-role="button">I</a>
+ <a href="javascript:executeCommands('loadstate&val=j');" data-role="button">J</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=k');" data-role="button">K</a>
+ <a href="javascript:executeCommands('loadstate&val=l');" data-role="button">L</a>
+ <a href="javascript:executeCommands('loadstate&val=m');" data-role="button">M</a>
+ <a href="javascript:executeCommands('loadstate&val=n');" data-role="button">N</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=o');" data-role="button">O</a>
+ <a href="javascript:executeCommands('loadstate&val=p');" data-role="button">P</a>
+ <a href="javascript:executeCommands('loadstate&val=q');" data-role="button">Q</a>
+ <a href="javascript:executeCommands('loadstate&val=r');" data-role="button">R</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=s');" data-role="button">S</a>
+ <a href="javascript:executeCommands('loadstate&val=t');" data-role="button">T</a>
+ <a href="javascript:executeCommands('loadstate&val=u');" data-role="button">U</a>
+ <a href="javascript:executeCommands('loadstate&val=v');" data-role="button">V</a>
+ </div>
+ <div data-role="controlgroup" data-type="horizontal">
+ <a href="javascript:executeCommands('loadstate&val=w');" data-role="button">W</a>
+ <a href="javascript:executeCommands('loadstate&val=x');" data-role="button">X</a>
+ <a href="javascript:executeCommands('loadstate&val=y');" data-role="button">Y</a>
+ <a href="javascript:executeCommands('loadstate&val=z');" data-role="button">Z</a>
+ </div>
+ <!-- This is here to prevent webkit from trying to put the last row of states under the bottom menu on small screens like phone-->
+ <br><br><br><br><br>
+</div>
diff --git a/web/index.html b/web/index.html
index 554f13c2ecb..4591f77e16d 100644
--- a/web/index.html
+++ b/web/index.html
@@ -25,13 +25,14 @@
{
document.getElementById('main').innerHTML = '<center><img src="/screenshot.png"/></center>';
}
-
+
function loadContent(htmlName)
{
$("#main").load(htmlName+'.html', function () {
$(this).trigger('create');
});
}
+
function executeCommands(command)
{
$.ajax({
@@ -44,6 +45,24 @@
});
}
+ function executeHardReset()
+ {
+ executeCommands("hardreset");
+ $('.ui-dialog').dialog('close');
+ }
+
+ function executeSoftReset()
+ {
+ executeCommands("softreset");
+ $('.ui-dialog').dialog('close');
+ }
+
+ function executeExit()
+ {
+ executeCommands("exit");
+ $('.ui-dialog').dialog('close');
+ }
+
function executeSlider()
{
$.ajax({