mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-16 10:44:30 +01:00
setup base frontend framework
This commit is contained in:
26
frontend/scripts/zMain.js
Normal file
26
frontend/scripts/zMain.js
Normal file
@@ -0,0 +1,26 @@
|
||||
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}
|
||||
}
|
||||
}));
|
||||
});
|
||||
Reference in New Issue
Block a user