forked from dimagoltsman/Random-Broadlink-RM-Code-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
184 lines (153 loc) · 7.13 KB
/
index.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Broadlink RM Random Code Generator</title>
<script src="hex.js"></script>
<script src="generator.js"></script>
<script src="index.js"></script>
<script src="pageActions.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"
integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"
integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<style>
td {
word-break: break-all;
min-width: 90px;
}
</style>
</head>
<body>
<div class="container">
<h1>Random Broadlink RM Code Generator</h1>
<br><br>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#" onclick="showRandomCodeTab()">Generate Random Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showLivoloTab()">Generate Random Livolo Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showRepeatsTab()">Change Repeats</a>
</li>
</ul>
<div id="random-code-section">
<div class="card">
<div class="card-body" style="width: 90rem;">
<h3>Generate Random Code</h3>
<div class="row">
<label for="signal_type" class="badge-pill col col-2">type:</label>
<select id="signal_type" class="custom-select col col-2">
<option value="RF433">RF433</option>
<option value="RF315">RF315</option>
</select>
</div>
<button type="button" class="btn btn-success" onclick="startGenerate()">Generate</button>
</div>
</div>
<br><br><br><br>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">Type</th>
<th scope="col">Regular code</th>
<th scope="col">same code with long repeat (for learning)</th>
</tr>
</thead>
<tbody id="restable">
</tbody>
</table>
</div>
</div>
<div id="livolo-section">
<div class="card">
<div class="card-body" style="width: 90rem;">
<h3>Generate Random Livolo Code</h3>
<br><br>
<form class="form-horizontal">
<div class="form-group">
<label for="remoteId">Remote ID:</label>
<input type="text" class="form-control" id="remoteId"
placeholder="7400" style="width: 13rem;" >
<label>Working sample eg. 7400, 6550, 10550. Range 1 - 65500. Usually divisible by 4</label>
<br>
</div>
<div class="form-group">
<label for="liv_btn" class="badge-pill col">Button:</label>
<select id="liv_btn" class="custom-select">
<option value='90' >On Only(scn1)</option>
<option value='40' >On/Off (toggle/button10)</option>
<option value='106' >Off Only</option>
<option value='0' >Button 1</option>
<option value='96' >Button 2</option>
<option value='120' >Button 3</option>
<option value='24' >Button 4</option>
<option value='108' >Button 5</option>
<option value='80' >Button 6</option>
<option value='48' >Button 7</option>
<option value='12' >Button 8</option>
<option value='72' >Button 9</option>
<option value='40' >Button 10</option>
<option value='90' >Scene 1</option>
<option value='114' >Scene 2</option>
<option value='10' >Scene 3</option>
<option value='18' >Scene 4</option>
</select>
<br>
</div>
<button type="button" class="btn btn-success" onclick="startGenerateLivolo()">Generate</button>
</form>
<br><br><br><br>
<div class="table-responsive">
<table class="table table-striped table-hover" style="width: 70%">
<thead>
<tr>
<th scope="col">Type</th>
<th scope="col">Code</th>
</tr>
</thead>
<tbody id="livtable">
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="card" id="repeats-section">
<div class="card-body" style="width: 90rem;">
<h3>Change number of repeats in existing code (also works for IR codes)</h3>
<br><br>
<form class="form-horizontal">
<div class="form-group">
<label for="usercode">Your code:</label>
<input type="text" class="form-control" id="usercode"
placeholder="sgw0AA0kDSQkDQ0kJA0NJA0kDSQNJCQNJA0NJCQNDSQNJA0kDSQkDSQNDSQNJA0kDSQkDQwAAW8AAAAA" style="width: 65rem;"
onchange="calcRepeats()">
<br><label for="repeats">Current Repeats:</label>
<b>
<div id="repeats" placeholder="14 (max 255)" style="width: 10rem;">0</div>
</b>
</div>
<input type="text" class="form-control" id="newrepeat" placeholder="New Repeats (max 255)" style="width: 13rem;">
<br>
<button type="button" class="btn btn-success" onclick="generateNewRepeat()">Generate</button>
<div class="form-group">
<br>
<input type="text" class="form-control" id="newcode" placeholder="New Code" style="width: 65rem;">
</div>
</form>
</div>
</div>
</div>
<div style="margin-top: 100px; margin-left: 20px;">
you are welcome to contribute: <a href="https://github.com/dimagoltsman/Random-Broadlink-RM-Code-Generator">https://github.com/dimagoltsman/Random-Broadlink-RM-Code-Generator</a>
</div>
</body>
</html>