forked from dimagoltsman/Random-Broadlink-RM-Code-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (30 loc) · 996 Bytes
/
index.js
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
function startGenerate() {
var type = $('#signal_type').val();
var generated = generate(type);
console.log(generated.regular);
console.log(generated.long);
var html = '<tr scope="row"><td>' + type + '</td><td>' + generated.regular + '</td><td>' + generated.long + '</td></tr>';
$('#restable').append(html);
}
function calcRepeats() {
var code = $("#usercode").val();
var repeats = getRepeats(code);
$("#repeats").html(repeats);
}
function generateNewRepeat() {
var code = $("#usercode").val();
var repeats = $("#newrepeat").val();
var newCode = getNewCode(code, repeats);
$("#newcode").val(newCode);
}
function startGenerateLivolo(){
var remote = $('#remoteId').val();
if(remote == ""){
alert("please select remote id");
return;
}
var btn = $('#liv_btn').val();
var code = generateLivolo(remote, btn);
var html = '<tr scope="row">'+ '<td>' + 'Livolo' + '</td>' +'<td>' + code + '</td>';
$('#livtable').append(html);
}