From 2e05965d45d02a463ba3ea5802a3285f1da7ed01 Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Tue, 28 Nov 2017 13:49:37 +0100 Subject: [PATCH] Slider generation in frontend --- examples/gui/data/js/controls.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/examples/gui/data/js/controls.js b/examples/gui/data/js/controls.js index 99a9799..869e575 100644 --- a/examples/gui/data/js/controls.js +++ b/examples/gui/data/js/controls.js @@ -6,6 +6,8 @@ const UI_PAD = 4; const UI_CPAD = 5; const UPDATE_LABEL = 6; const UPDATE_SWITCHER = 7; +const UI_SLIDER = 8; +const UPDATE_SLIDER = 9; const FOR = 0; const BACK = 1; @@ -214,6 +216,25 @@ function start() { else switcher(data.id, 1); break; + case UI_SLIDER: + $('#row').append( + "
" + + "
" + data.label + "

" + + "
" + + "" + + "
" + + "
" + ); + $('#row').append( + "" + ); + break; + + case UPDATE_SLIDER: + slider(data.id, data.value); + break; default: console.error('Unknown type or event'); break; @@ -253,6 +274,10 @@ function padclick(type, number, isdown) { } } +function slider(number, value) { + console.log('Should update slider: ' + value); +} + function switcher(number, state) { if (state == null) { if ($('#s' + number).is(':checked')) {