mirror of
https://github.com/holub/mame
synced 2025-07-04 09:28:51 +03:00
display currently running driver and update on change on server side (nw)
This commit is contained in:
parent
5a511c644f
commit
3fafdaae30
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8901,3 +8901,4 @@ web/images/nav-arrow-right.png -text svneol=unset#image/png
|
|||||||
web/images/nav-arrow-right2.png -text svneol=unset#image/png
|
web/images/nav-arrow-right2.png -text svneol=unset#image/png
|
||||||
web/images/nav-sub-press.png -text svneol=unset#image/png
|
web/images/nav-sub-press.png -text svneol=unset#image/png
|
||||||
web/index.html svneol=native#text/html
|
web/index.html svneol=native#text/html
|
||||||
|
web/js/jquery.js svneol=native#text/javascript
|
||||||
|
@ -1,14 +1,2 @@
|
|||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
|
body { color: white; padding: 50px; border-top: none; background: #4c4c4c url(../images/grad1.png) 0 0 repeat-x; font: 12px/normal Tahoma, Arial, Helvetica, sans-serif; }
|
||||||
|
|
||||||
* { margin: 0; padding: 0; outline: none; }
|
|
||||||
body { padding: 50px; border-top: none; background: #4c4c4c url(../images/grad1.png) 0 0 repeat-x; color: #d9d9d9; color: #000; font: 14px/normal Tahoma, Arial, Helvetica, sans-serif; }
|
|
||||||
p { margin-bottom: 1em; }
|
|
||||||
body > p, .container > p { margin-bottom: 0; }
|
|
||||||
h1,h2,h3 { margin-bottom: .5em; font-family: Arial, Helvetica, sans-serif; line-height: normal; }
|
|
||||||
h1 { margin-bottom: .5em; padding-bottom: 4px; border-bottom: solid 1px #d9d9d9; font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 180%; text-indent: 5px; letter-spacing: -1px; }
|
|
||||||
cite { float: right; }
|
|
||||||
fieldset { border: none; }
|
|
||||||
ul.classic { list-style: disc; margin-bottom: 1em; padding-left: 2em; }
|
|
||||||
div.section { clear: both; padding-top: 50px; }
|
|
||||||
.dropdown-upward { margin-top: 400px !important; }
|
|
||||||
|
@ -9,36 +9,47 @@
|
|||||||
<link href="css/main.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="css/main.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<link href="css/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="css/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<link href="css/default.ultimate.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="css/default.ultimate.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="js/jquery.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
|
||||||
var writeToScreen = function(message) {
|
var writeToScreen = function(message) {
|
||||||
var div = document.createElement('div');
|
document.getElementById('output').innerHTML = message;
|
||||||
div.innerHTML = message;
|
|
||||||
document.getElementById('output').appendChild(div);
|
|
||||||
};
|
};
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var url = 'ws://localhost:8080/foo';
|
var url = 'ws://localhost:8080/foo';
|
||||||
websocket = new WebSocket(url);
|
websocket = new WebSocket(url);
|
||||||
websocket.onopen = function(ev) {
|
websocket.onopen = function(ev) {
|
||||||
writeToScreen('<span style="color: green;">CONNECTED</span>');
|
writeToScreen('<b style="color: green;">Connected</b>');
|
||||||
};
|
};
|
||||||
websocket.onclose = function(ev) {
|
websocket.onclose = function(ev) {
|
||||||
writeToScreen('<span style="color: white;">DISCONNECTED</span>');
|
writeToScreen('<b style="color: white;">disconnected</b>');
|
||||||
};
|
};
|
||||||
websocket.onmessage = function(ev) {
|
websocket.onmessage = function(ev) {
|
||||||
writeToScreen('<span style="color: blue;">RESPONSE: ' + ev.data +
|
if (ev.data=='update_machine')
|
||||||
' </span>');
|
{
|
||||||
|
$.getJSON('json/game', function(data) {
|
||||||
|
var items = [];
|
||||||
|
if(data.name =='___empty') {
|
||||||
|
items.push('No driver running');
|
||||||
|
} else {
|
||||||
|
items.push('<h1>Currently running : ' + data.description + ' [' + data.manufacturer+']</h1>');
|
||||||
|
|
||||||
|
}
|
||||||
|
document.getElementById('current').innerHTML = items.join('');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
websocket.onerror = function(ev) {
|
websocket.onerror = function(ev) {
|
||||||
writeToScreen('<span style="color: red; ">ERROR: </span> ' + ev.data);
|
writeToScreen('<b style="color: red; ">Error</b>');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<div data-role="page">
|
<div data-role="page">
|
||||||
<div data-role="header">
|
<div data-role="header">
|
||||||
<img src="images/logo-mame-small.png"/>
|
<img src="images/logo-mame-small.png"/><div id="output" style="display: inline;"><b style="color:white;">Connecting...</b></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul id="nav" class="dropdown dropdown-horizontal">
|
<ul id="nav" class="dropdown dropdown-horizontal">
|
||||||
@ -71,7 +82,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li id="n-debugger"><a href="./">Debugger</a></li>
|
<li id="n-debugger"><a href="./">Debugger</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<br/><br/><div id="output"></div>
|
<br/><br/><br/><br/>
|
||||||
|
<div id="current"></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
6
web/js/jquery.js
vendored
Normal file
6
web/js/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user