summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2013-08-22 14:30:33 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2013-08-22 14:30:33 +0000
commit6c7d00c958981658d07138a394d2f2647e72da4d (patch) (github)
treeba774314abe12279e514dadcc7ed93138c0226d6 /web
parenteb3686dc33417ea6b3938d650172c18204dbbb9c (diff)
downloadmame-6c7d00c958981658d07138a394d2f2647e72da4d.tar.bz2
mame-6c7d00c958981658d07138a394d2f2647e72da4d.zip
some 5 min slider work, to make it affect settings (nw)
Diffstat (limited to 'web')
-rw-r--r--web/index.html18
1 files changed, 16 insertions, 2 deletions
diff --git a/web/index.html b/web/index.html
index 087be401fd6..14d9e84c0e0 100644
--- a/web/index.html
+++ b/web/index.html
@@ -53,17 +53,31 @@
success: function(data) {
var items = [];
for (var i in data) {
- items.push('<label for="slider-mini">'+data[i].description +':</label>');
- items.push('<input type="range" name="slider-mini" id="slider-mini" value="'+data[i].curval+'" min="'+data[i].minval+'" max="'+data[i].maxval+'" step=="'+data[i].incval+'" data-highlight="true" data-mini="true" />');
+ items.push('<label for="slider-mini-'+i+'">'+data[i].description +':</label>');
+ items.push('<input type="range" name="slider-mini-'+i+'" id="slider-mini-'+i+'" value="'+data[i].curval+'" min="'+data[i].minval+'" max="'+data[i].maxval+'" step=="'+data[i].incval+'" data-highlight="true" data-mini="true" />');
}
$('#main').html('');
$('#main').append(items.join('')).trigger('create');
+ for (var i in data) {
+ $('#slider-mini-' + i).bind( "slidestop", function(event, ui) { setSliderValue($(this).attr('id').replace('slider-mini-',''),$(this).slider().val()); });
+ }
},
error: function (request, status, error) { alert(status + ", " + error); }
});
}
+ function setSliderValue(id,val)
+ {
+ $.ajax({
+ url: "/slider?id="+id+"&val="+val,
+ cache: false,
+ dataType: "text",
+ success: function(data) {
+ },
+ error: function (request, status, error) { alert(status + ", " + error); }
+ });
+ }
function startWebSocket() {
var url = 'ws://localhost:8080/foo';