mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-15 18:38:20 +01:00
26 lines
636 B
JavaScript
26 lines
636 B
JavaScript
Sui.ready(() => {
|
|
let debugResponse = (data) => {
|
|
$('#response').html(data);
|
|
};
|
|
[{
|
|
api: 'MOTOR',
|
|
method: 'GET',
|
|
selector: '.motor.slider',
|
|
event: 'change',
|
|
data: function(){
|
|
return this.getAttribute('data-motor-nr');
|
|
},
|
|
onResponse: debugResponse
|
|
}, {
|
|
api: 'LASER',
|
|
method: 'GET',
|
|
selector: '.laser.slider',
|
|
event: 'change',
|
|
onResponse: debugResponse
|
|
}].forEach(Sui.link({
|
|
api: {
|
|
MOTOR: '/motor/', // {motorNr}/{value}
|
|
LASER: '/laser/' // {value}
|
|
}
|
|
}));
|
|
}); |