-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathesp32_script.js
More file actions
56 lines (38 loc) · 1.47 KB
/
Copy pathesp32_script.js
File metadata and controls
56 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$( document ).ready(function() {
//console.log( "ready!" );
// Instantiate a slider
$('#csuszka').slider({ });
$("#csuszka").on("slide", function(slideEvt) { $("#slider_val").text(slideEvt.value); });
$('.row').css('margin-bottom','50px');
//setTimeout(function(){ window.location.reload(1); }, $("#ref_time").val()*1000);
});
function button_one(){
if($( "#button_one" ).hasClass( "btn-success" )){
$.ajax({ url: "/gpio/5/off",
success: function(data){
if(data=="OK"){ $('#button_one').removeClass("btn-success"); $('#button_one').addClass("btn-danger"); }
}, timeout: 1000 //in milliseconds
});
}
else if($( "#button_one" ).hasClass( "btn-danger" )){
$.ajax({ url: "/gpio/5/on",
success: function(data){
if(data=="OK"){ $('#button_one').removeClass("btn-danger"); $('#button_one').addClass("btn-success"); }
}, timeout: 1000 //in milliseconds
});
}
}
function ref_time(){
$.ajax({ url: "/ref_time/"+$("#ref_time").val()+"",
success: function(data){
if(data=="OK"){ window.location.reload(1); }
}, timeout: 1000 //in milliseconds
});
}
function button_demo_1(){
$.ajax({ url: "/demo_1/"+$("#csuszka").val()+"",
success: function(data){
if(data=="OK"){ window.location.reload(1); }
}, timeout: 1000 //in milliseconds
});
}