83c200e0dbffe73d6481d34ec522f1a3d69e3c58
[project/luci.git] / jsapi / form.js.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Source: form.js</title>
6
7
8 <script src="scripts/prettify/prettify.js"></script>
9 <script src="scripts/prettify/lang-css.js"></script>
10 <script src="scripts/jquery.min.js"></script>
11 <!--[if lt IE 9]>
12 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13 <![endif]-->
14 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
15 <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
16 <link type="text/css" rel="stylesheet" href="styles/jaguar.css">
17
18
19 <script>
20 var config = {"monospaceLinks":true,"cleverLinks":true,"default":{"outputSourceFiles":true}};
21 </script>
22
23
24
25 </head>
26 <body>
27 <div id="wrap" class="clearfix">
28
29 <div class="navigation">
30 <h3 class="applicationName"><a href="index.html"></a></h3>
31
32 <div class="search">
33 <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations">
34 </div>
35 <ul class="list">
36
37 <li class="item" data-name="LuCI">
38 <span class="title">
39 <a href="LuCI.html">LuCI</a>
40
41 </span>
42 <ul class="members itemMembers">
43
44 <span class="subtitle">Members</span>
45
46 <li data-name="LuCI#Class"><a href="LuCI.html#Class">Class</a></li>
47
48 <li data-name="LuCI#dom"><a href="LuCI.html#dom">dom</a></li>
49
50 <li data-name="LuCI#env"><a href="LuCI.html#env">env</a></li>
51
52 <li data-name="LuCI#naturalCompare"><a href="LuCI.html#naturalCompare">naturalCompare</a></li>
53
54 <li data-name="LuCI#Poll"><a href="LuCI.html#Poll">Poll</a></li>
55
56 <li data-name="LuCI#Request"><a href="LuCI.html#Request">Request</a></li>
57
58 <li data-name="LuCI#view"><a href="LuCI.html#view">view</a></li>
59
60 </ul>
61 <ul class="typedefs itemMembers">
62
63 <span class="subtitle">Typedefs</span>
64
65 <li data-name="LuCI.requestCallbackFn"><a href="LuCI.html#.requestCallbackFn">requestCallbackFn</a></li>
66
67 </ul>
68 <ul class="typedefs itemMembers">
69
70 </ul>
71 <ul class="methods itemMembers">
72
73 <span class="subtitle">Methods</span>
74
75 <li data-name="LuCI#bind"><a href="LuCI.html#bind">bind</a></li>
76
77 <li data-name="LuCI#error"><a href="LuCI.html#error">error</a></li>
78
79 <li data-name="LuCI#fspath"><a href="LuCI.html#fspath">fspath</a></li>
80
81 <li data-name="LuCI#get"><a href="LuCI.html#get">get</a></li>
82
83 <li data-name="LuCI#halt"><a href="LuCI.html#halt">halt</a></li>
84
85 <li data-name="LuCI#hasSystemFeature"><a href="LuCI.html#hasSystemFeature">hasSystemFeature</a></li>
86
87 <li data-name="LuCI#hasViewPermission"><a href="LuCI.html#hasViewPermission">hasViewPermission</a></li>
88
89 <li data-name="LuCI#isObject"><a href="LuCI.html#isObject">isObject</a></li>
90
91 <li data-name="LuCI#location"><a href="LuCI.html#location">location</a></li>
92
93 <li data-name="LuCI#media"><a href="LuCI.html#media">media</a></li>
94
95 <li data-name="LuCI#path"><a href="LuCI.html#path">path</a></li>
96
97 <li data-name="LuCI#poll"><a href="LuCI.html#poll">poll</a></li>
98
99 <li data-name="LuCI#post"><a href="LuCI.html#post">post</a></li>
100
101 <li data-name="LuCI#raise"><a href="LuCI.html#raise">raise</a></li>
102
103 <li data-name="LuCI#require"><a href="LuCI.html#require">require</a></li>
104
105 <li data-name="LuCI#resolveDefault"><a href="LuCI.html#resolveDefault">resolveDefault</a></li>
106
107 <li data-name="LuCI#resource"><a href="LuCI.html#resource">resource</a></li>
108
109 <li data-name="LuCI#run"><a href="LuCI.html#run">run</a></li>
110
111 <li data-name="LuCI#sortedArray"><a href="LuCI.html#sortedArray">sortedArray</a></li>
112
113 <li data-name="LuCI#sortedKeys"><a href="LuCI.html#sortedKeys">sortedKeys</a></li>
114
115 <li data-name="LuCI#stop"><a href="LuCI.html#stop">stop</a></li>
116
117 <li data-name="LuCI#toArray"><a href="LuCI.html#toArray">toArray</a></li>
118
119 <li data-name="LuCI#url"><a href="LuCI.html#url">url</a></li>
120
121 </ul>
122 <ul class="events itemMembers">
123
124 </ul>
125 </li>
126
127 <li class="item" data-name="LuCI.baseclass">
128 <span class="title">
129 <a href="LuCI.baseclass.html">LuCI.baseclass</a>
130
131 </span>
132 <ul class="members itemMembers">
133
134 </ul>
135 <ul class="typedefs itemMembers">
136
137 </ul>
138 <ul class="typedefs itemMembers">
139
140 </ul>
141 <ul class="methods itemMembers">
142
143 <span class="subtitle">Methods</span>
144
145 <li data-name="LuCI.baseclass.extend"><a href="LuCI.baseclass.html#.extend">extend</a></li>
146
147 <li data-name="LuCI.baseclass.instantiate"><a href="LuCI.baseclass.html#.instantiate">instantiate</a></li>
148
149 <li data-name="LuCI.baseclass.isSubclass"><a href="LuCI.baseclass.html#.isSubclass">isSubclass</a></li>
150
151 <li data-name="LuCI.baseclass.singleton"><a href="LuCI.baseclass.html#.singleton">singleton</a></li>
152
153 <li data-name="LuCI.baseclass#super"><a href="LuCI.baseclass.html#super">super</a></li>
154
155 <li data-name="LuCI.baseclass#varargs"><a href="LuCI.baseclass.html#varargs">varargs</a></li>
156
157 </ul>
158 <ul class="events itemMembers">
159
160 </ul>
161 </li>
162
163 <li class="item" data-name="LuCI.dom">
164 <span class="title">
165 <a href="LuCI.dom.html">LuCI.dom</a>
166
167 </span>
168 <ul class="members itemMembers">
169
170 </ul>
171 <ul class="typedefs itemMembers">
172
173 <span class="subtitle">Typedefs</span>
174
175 <li data-name="LuCI.dom~ignoreCallbackFn"><a href="LuCI.dom.html#~ignoreCallbackFn">ignoreCallbackFn</a></li>
176
177 </ul>
178 <ul class="typedefs itemMembers">
179
180 </ul>
181 <ul class="methods itemMembers">
182
183 <span class="subtitle">Methods</span>
184
185 <li data-name="LuCI.dom#append"><a href="LuCI.dom.html#append">append</a></li>
186
187 <li data-name="LuCI.dom#attr"><a href="LuCI.dom.html#attr">attr</a></li>
188
189 <li data-name="LuCI.dom#bindClassInstance"><a href="LuCI.dom.html#bindClassInstance">bindClassInstance</a></li>
190
191 <li data-name="LuCI.dom#callClassMethod"><a href="LuCI.dom.html#callClassMethod">callClassMethod</a></li>
192
193 <li data-name="LuCI.dom#content"><a href="LuCI.dom.html#content">content</a></li>
194
195 <li data-name="LuCI.dom#create"><a href="LuCI.dom.html#create">create</a></li>
196
197 <li data-name="LuCI.dom#data"><a href="LuCI.dom.html#data">data</a></li>
198
199 <li data-name="LuCI.dom#elem"><a href="LuCI.dom.html#elem">elem</a></li>
200
201 <li data-name="LuCI.dom#findClassInstance"><a href="LuCI.dom.html#findClassInstance">findClassInstance</a></li>
202
203 <li data-name="LuCI.dom#isEmpty"><a href="LuCI.dom.html#isEmpty">isEmpty</a></li>
204
205 <li data-name="LuCI.dom#matches"><a href="LuCI.dom.html#matches">matches</a></li>
206
207 <li data-name="LuCI.dom#parent"><a href="LuCI.dom.html#parent">parent</a></li>
208
209 <li data-name="LuCI.dom#parse"><a href="LuCI.dom.html#parse">parse</a></li>
210
211 </ul>
212 <ul class="events itemMembers">
213
214 </ul>
215 </li>
216
217 <li class="item" data-name="LuCI.form">
218 <span class="title">
219 <a href="LuCI.form.html">LuCI.form</a>
220
221 </span>
222 <ul class="members itemMembers">
223
224 </ul>
225 <ul class="typedefs itemMembers">
226
227 </ul>
228 <ul class="typedefs itemMembers">
229
230 </ul>
231 <ul class="methods itemMembers">
232
233 </ul>
234 <ul class="events itemMembers">
235
236 </ul>
237 </li>
238
239 <li class="item" data-name="LuCI.form.AbstractElement">
240 <span class="title">
241 <a href="LuCI.form.AbstractElement.html">LuCI.form.AbstractElement</a>
242
243 </span>
244 <ul class="members itemMembers">
245
246 </ul>
247 <ul class="typedefs itemMembers">
248
249 </ul>
250 <ul class="typedefs itemMembers">
251
252 </ul>
253 <ul class="methods itemMembers">
254
255 <span class="subtitle">Methods</span>
256
257 <li data-name="LuCI.form.AbstractElement#append"><a href="LuCI.form.AbstractElement.html#append">append</a></li>
258
259 <li data-name="LuCI.form.AbstractElement#parse"><a href="LuCI.form.AbstractElement.html#parse">parse</a></li>
260
261 <li data-name="LuCI.form.AbstractElement#render"><a href="LuCI.form.AbstractElement.html#render">render</a></li>
262
263 <li data-name="LuCI.form.AbstractElement#stripTags"><a href="LuCI.form.AbstractElement.html#stripTags">stripTags</a></li>
264
265 <li data-name="LuCI.form.AbstractElement#titleFn"><a href="LuCI.form.AbstractElement.html#titleFn">titleFn</a></li>
266
267 </ul>
268 <ul class="events itemMembers">
269
270 </ul>
271 </li>
272
273 <li class="item" data-name="LuCI.form.AbstractSection">
274 <span class="title">
275 <a href="LuCI.form.AbstractSection.html">LuCI.form.AbstractSection</a>
276
277 </span>
278 <ul class="members itemMembers">
279
280 <span class="subtitle">Members</span>
281
282 <li data-name="LuCI.form.AbstractSection##parentoption"><a href="LuCI.form.AbstractSection.html#parentoption">parentoption</a></li>
283
284 </ul>
285 <ul class="typedefs itemMembers">
286
287 </ul>
288 <ul class="typedefs itemMembers">
289
290 </ul>
291 <ul class="methods itemMembers">
292
293 <span class="subtitle">Methods</span>
294
295 <li data-name="LuCI.form.AbstractSection#append"><a href="LuCI.form.AbstractSection.html#append">append</a></li>
296
297 <li data-name="LuCI.form.AbstractSection#cfgsections"><a href="LuCI.form.AbstractSection.html#cfgsections">cfgsections</a></li>
298
299 <li data-name="LuCI.form.AbstractSection#cfgvalue"><a href="LuCI.form.AbstractSection.html#cfgvalue">cfgvalue</a></li>
300
301 <li data-name="LuCI.form.AbstractSection#filter"><a href="LuCI.form.AbstractSection.html#filter">filter</a></li>
302
303 <li data-name="LuCI.form.AbstractSection#formvalue"><a href="LuCI.form.AbstractSection.html#formvalue">formvalue</a></li>
304
305 <li data-name="LuCI.form.AbstractSection#getOption"><a href="LuCI.form.AbstractSection.html#getOption">getOption</a></li>
306
307 <li data-name="LuCI.form.AbstractSection#getUIElement"><a href="LuCI.form.AbstractSection.html#getUIElement">getUIElement</a></li>
308
309 <li data-name="LuCI.form.AbstractSection#load"><a href="LuCI.form.AbstractSection.html#load">load</a></li>
310
311 <li data-name="LuCI.form.AbstractSection#option"><a href="LuCI.form.AbstractSection.html#option">option</a></li>
312
313 <li data-name="LuCI.form.AbstractSection#parse"><a href="LuCI.form.AbstractSection.html#parse">parse</a></li>
314
315 <li data-name="LuCI.form.AbstractSection#render"><a href="LuCI.form.AbstractSection.html#render">render</a></li>
316
317 <li data-name="LuCI.form.AbstractSection#stripTags"><a href="LuCI.form.AbstractSection.html#stripTags">stripTags</a></li>
318
319 <li data-name="LuCI.form.AbstractSection#tab"><a href="LuCI.form.AbstractSection.html#tab">tab</a></li>
320
321 <li data-name="LuCI.form.AbstractSection#taboption"><a href="LuCI.form.AbstractSection.html#taboption">taboption</a></li>
322
323 <li data-name="LuCI.form.AbstractSection#titleFn"><a href="LuCI.form.AbstractSection.html#titleFn">titleFn</a></li>
324
325 </ul>
326 <ul class="events itemMembers">
327
328 </ul>
329 </li>
330
331 <li class="item" data-name="LuCI.form.AbstractValue">
332 <span class="title">
333 <a href="LuCI.form.AbstractValue.html">LuCI.form.AbstractValue</a>
334
335 </span>
336 <ul class="members itemMembers">
337
338 <span class="subtitle">Members</span>
339
340 <li data-name="LuCI.form.AbstractValue##datatype"><a href="LuCI.form.AbstractValue.html#datatype">datatype</a></li>
341
342 <li data-name="LuCI.form.AbstractValue##default"><a href="LuCI.form.AbstractValue.html#default">default</a></li>
343
344 <li data-name="LuCI.form.AbstractValue##editable"><a href="LuCI.form.AbstractValue.html#editable">editable</a></li>
345
346 <li data-name="LuCI.form.AbstractValue##modalonly"><a href="LuCI.form.AbstractValue.html#modalonly">modalonly</a></li>
347
348 <li data-name="LuCI.form.AbstractValue##onchange"><a href="LuCI.form.AbstractValue.html#onchange">onchange</a></li>
349
350 <li data-name="LuCI.form.AbstractValue##optional"><a href="LuCI.form.AbstractValue.html#optional">optional</a></li>
351
352 <li data-name="LuCI.form.AbstractValue##readonly"><a href="LuCI.form.AbstractValue.html#readonly">readonly</a></li>
353
354 <li data-name="LuCI.form.AbstractValue##retain"><a href="LuCI.form.AbstractValue.html#retain">retain</a></li>
355
356 <li data-name="LuCI.form.AbstractValue##rmempty"><a href="LuCI.form.AbstractValue.html#rmempty">rmempty</a></li>
357
358 <li data-name="LuCI.form.AbstractValue##uciconfig"><a href="LuCI.form.AbstractValue.html#uciconfig">uciconfig</a></li>
359
360 <li data-name="LuCI.form.AbstractValue##ucioption"><a href="LuCI.form.AbstractValue.html#ucioption">ucioption</a></li>
361
362 <li data-name="LuCI.form.AbstractValue##ucisection"><a href="LuCI.form.AbstractValue.html#ucisection">ucisection</a></li>
363
364 <li data-name="LuCI.form.AbstractValue##validate"><a href="LuCI.form.AbstractValue.html#validate">validate</a></li>
365
366 <li data-name="LuCI.form.AbstractValue##width"><a href="LuCI.form.AbstractValue.html#width">width</a></li>
367
368 </ul>
369 <ul class="typedefs itemMembers">
370
371 </ul>
372 <ul class="typedefs itemMembers">
373
374 </ul>
375 <ul class="methods itemMembers">
376
377 <span class="subtitle">Methods</span>
378
379 <li data-name="LuCI.form.AbstractValue#append"><a href="LuCI.form.AbstractValue.html#append">append</a></li>
380
381 <li data-name="LuCI.form.AbstractValue#cbid"><a href="LuCI.form.AbstractValue.html#cbid">cbid</a></li>
382
383 <li data-name="LuCI.form.AbstractValue#cfgvalue"><a href="LuCI.form.AbstractValue.html#cfgvalue">cfgvalue</a></li>
384
385 <li data-name="LuCI.form.AbstractValue#depends"><a href="LuCI.form.AbstractValue.html#depends">depends</a></li>
386
387 <li data-name="LuCI.form.AbstractValue#formvalue"><a href="LuCI.form.AbstractValue.html#formvalue">formvalue</a></li>
388
389 <li data-name="LuCI.form.AbstractValue#getUIElement"><a href="LuCI.form.AbstractValue.html#getUIElement">getUIElement</a></li>
390
391 <li data-name="LuCI.form.AbstractValue#getValidationError"><a href="LuCI.form.AbstractValue.html#getValidationError">getValidationError</a></li>
392
393 <li data-name="LuCI.form.AbstractValue#isActive"><a href="LuCI.form.AbstractValue.html#isActive">isActive</a></li>
394
395 <li data-name="LuCI.form.AbstractValue#isValid"><a href="LuCI.form.AbstractValue.html#isValid">isValid</a></li>
396
397 <li data-name="LuCI.form.AbstractValue#load"><a href="LuCI.form.AbstractValue.html#load">load</a></li>
398
399 <li data-name="LuCI.form.AbstractValue#parse"><a href="LuCI.form.AbstractValue.html#parse">parse</a></li>
400
401 <li data-name="LuCI.form.AbstractValue#remove"><a href="LuCI.form.AbstractValue.html#remove">remove</a></li>
402
403 <li data-name="LuCI.form.AbstractValue#render"><a href="LuCI.form.AbstractValue.html#render">render</a></li>
404
405 <li data-name="LuCI.form.AbstractValue#stripTags"><a href="LuCI.form.AbstractValue.html#stripTags">stripTags</a></li>
406
407 <li data-name="LuCI.form.AbstractValue#textvalue"><a href="LuCI.form.AbstractValue.html#textvalue">textvalue</a></li>
408
409 <li data-name="LuCI.form.AbstractValue#titleFn"><a href="LuCI.form.AbstractValue.html#titleFn">titleFn</a></li>
410
411 <li data-name="LuCI.form.AbstractValue#validate"><a href="LuCI.form.AbstractValue.html#validate">validate</a></li>
412
413 <li data-name="LuCI.form.AbstractValue#write"><a href="LuCI.form.AbstractValue.html#write">write</a></li>
414
415 </ul>
416 <ul class="events itemMembers">
417
418 </ul>
419 </li>
420
421 <li class="item" data-name="LuCI.form.ButtonValue">
422 <span class="title">
423 <a href="LuCI.form.ButtonValue.html">LuCI.form.ButtonValue</a>
424
425 </span>
426 <ul class="members itemMembers">
427
428 <span class="subtitle">Members</span>
429
430 <li data-name="LuCI.form.ButtonValue##inputstyle"><a href="LuCI.form.ButtonValue.html#inputstyle">inputstyle</a></li>
431
432 <li data-name="LuCI.form.ButtonValue##inputtitle"><a href="LuCI.form.ButtonValue.html#inputtitle">inputtitle</a></li>
433
434 <li data-name="LuCI.form.ButtonValue##onclick"><a href="LuCI.form.ButtonValue.html#onclick">onclick</a></li>
435
436 <li data-name="LuCI.form.ButtonValue#datatype"><a href="LuCI.form.ButtonValue.html#datatype">datatype</a></li>
437
438 <li data-name="LuCI.form.ButtonValue#default"><a href="LuCI.form.ButtonValue.html#default">default</a></li>
439
440 <li data-name="LuCI.form.ButtonValue#editable"><a href="LuCI.form.ButtonValue.html#editable">editable</a></li>
441
442 <li data-name="LuCI.form.ButtonValue#modalonly"><a href="LuCI.form.ButtonValue.html#modalonly">modalonly</a></li>
443
444 <li data-name="LuCI.form.ButtonValue#onchange"><a href="LuCI.form.ButtonValue.html#onchange">onchange</a></li>
445
446 <li data-name="LuCI.form.ButtonValue#optional"><a href="LuCI.form.ButtonValue.html#optional">optional</a></li>
447
448 <li data-name="LuCI.form.ButtonValue#password"><a href="LuCI.form.ButtonValue.html#password">password</a></li>
449
450 <li data-name="LuCI.form.ButtonValue#placeholder"><a href="LuCI.form.ButtonValue.html#placeholder">placeholder</a></li>
451
452 <li data-name="LuCI.form.ButtonValue#readonly"><a href="LuCI.form.ButtonValue.html#readonly">readonly</a></li>
453
454 <li data-name="LuCI.form.ButtonValue#retain"><a href="LuCI.form.ButtonValue.html#retain">retain</a></li>
455
456 <li data-name="LuCI.form.ButtonValue#rmempty"><a href="LuCI.form.ButtonValue.html#rmempty">rmempty</a></li>
457
458 <li data-name="LuCI.form.ButtonValue#uciconfig"><a href="LuCI.form.ButtonValue.html#uciconfig">uciconfig</a></li>
459
460 <li data-name="LuCI.form.ButtonValue#ucioption"><a href="LuCI.form.ButtonValue.html#ucioption">ucioption</a></li>
461
462 <li data-name="LuCI.form.ButtonValue#ucisection"><a href="LuCI.form.ButtonValue.html#ucisection">ucisection</a></li>
463
464 <li data-name="LuCI.form.ButtonValue#validate"><a href="LuCI.form.ButtonValue.html#validate">validate</a></li>
465
466 <li data-name="LuCI.form.ButtonValue#width"><a href="LuCI.form.ButtonValue.html#width">width</a></li>
467
468 </ul>
469 <ul class="typedefs itemMembers">
470
471 </ul>
472 <ul class="typedefs itemMembers">
473
474 </ul>
475 <ul class="methods itemMembers">
476
477 <span class="subtitle">Methods</span>
478
479 <li data-name="LuCI.form.ButtonValue#append"><a href="LuCI.form.ButtonValue.html#append">append</a></li>
480
481 <li data-name="LuCI.form.ButtonValue#cbid"><a href="LuCI.form.ButtonValue.html#cbid">cbid</a></li>
482
483 <li data-name="LuCI.form.ButtonValue#cfgvalue"><a href="LuCI.form.ButtonValue.html#cfgvalue">cfgvalue</a></li>
484
485 <li data-name="LuCI.form.ButtonValue#depends"><a href="LuCI.form.ButtonValue.html#depends">depends</a></li>
486
487 <li data-name="LuCI.form.ButtonValue#formvalue"><a href="LuCI.form.ButtonValue.html#formvalue">formvalue</a></li>
488
489 <li data-name="LuCI.form.ButtonValue#getUIElement"><a href="LuCI.form.ButtonValue.html#getUIElement">getUIElement</a></li>
490
491 <li data-name="LuCI.form.ButtonValue#getValidationError"><a href="LuCI.form.ButtonValue.html#getValidationError">getValidationError</a></li>
492
493 <li data-name="LuCI.form.ButtonValue#isActive"><a href="LuCI.form.ButtonValue.html#isActive">isActive</a></li>
494
495 <li data-name="LuCI.form.ButtonValue#isValid"><a href="LuCI.form.ButtonValue.html#isValid">isValid</a></li>
496
497 <li data-name="LuCI.form.ButtonValue#load"><a href="LuCI.form.ButtonValue.html#load">load</a></li>
498
499 <li data-name="LuCI.form.ButtonValue#parse"><a href="LuCI.form.ButtonValue.html#parse">parse</a></li>
500
501 <li data-name="LuCI.form.ButtonValue#remove"><a href="LuCI.form.ButtonValue.html#remove">remove</a></li>
502
503 <li data-name="LuCI.form.ButtonValue#stripTags"><a href="LuCI.form.ButtonValue.html#stripTags">stripTags</a></li>
504
505 <li data-name="LuCI.form.ButtonValue#textvalue"><a href="LuCI.form.ButtonValue.html#textvalue">textvalue</a></li>
506
507 <li data-name="LuCI.form.ButtonValue#titleFn"><a href="LuCI.form.ButtonValue.html#titleFn">titleFn</a></li>
508
509 <li data-name="LuCI.form.ButtonValue#value"><a href="LuCI.form.ButtonValue.html#value">value</a></li>
510
511 <li data-name="LuCI.form.ButtonValue#write"><a href="LuCI.form.ButtonValue.html#write">write</a></li>
512
513 </ul>
514 <ul class="events itemMembers">
515
516 </ul>
517 </li>
518
519 <li class="item" data-name="LuCI.form.DummyValue">
520 <span class="title">
521 <a href="LuCI.form.DummyValue.html">LuCI.form.DummyValue</a>
522
523 </span>
524 <ul class="members itemMembers">
525
526 <span class="subtitle">Members</span>
527
528 <li data-name="LuCI.form.DummyValue##hidden"><a href="LuCI.form.DummyValue.html#hidden">hidden</a></li>
529
530 <li data-name="LuCI.form.DummyValue##href"><a href="LuCI.form.DummyValue.html#href">href</a></li>
531
532 <li data-name="LuCI.form.DummyValue##rawhtml"><a href="LuCI.form.DummyValue.html#rawhtml">rawhtml</a></li>
533
534 <li data-name="LuCI.form.DummyValue#datatype"><a href="LuCI.form.DummyValue.html#datatype">datatype</a></li>
535
536 <li data-name="LuCI.form.DummyValue#default"><a href="LuCI.form.DummyValue.html#default">default</a></li>
537
538 <li data-name="LuCI.form.DummyValue#editable"><a href="LuCI.form.DummyValue.html#editable">editable</a></li>
539
540 <li data-name="LuCI.form.DummyValue#modalonly"><a href="LuCI.form.DummyValue.html#modalonly">modalonly</a></li>
541
542 <li data-name="LuCI.form.DummyValue#onchange"><a href="LuCI.form.DummyValue.html#onchange">onchange</a></li>
543
544 <li data-name="LuCI.form.DummyValue#optional"><a href="LuCI.form.DummyValue.html#optional">optional</a></li>
545
546 <li data-name="LuCI.form.DummyValue#password"><a href="LuCI.form.DummyValue.html#password">password</a></li>
547
548 <li data-name="LuCI.form.DummyValue#placeholder"><a href="LuCI.form.DummyValue.html#placeholder">placeholder</a></li>
549
550 <li data-name="LuCI.form.DummyValue#readonly"><a href="LuCI.form.DummyValue.html#readonly">readonly</a></li>
551
552 <li data-name="LuCI.form.DummyValue#retain"><a href="LuCI.form.DummyValue.html#retain">retain</a></li>
553
554 <li data-name="LuCI.form.DummyValue#rmempty"><a href="LuCI.form.DummyValue.html#rmempty">rmempty</a></li>
555
556 <li data-name="LuCI.form.DummyValue#uciconfig"><a href="LuCI.form.DummyValue.html#uciconfig">uciconfig</a></li>
557
558 <li data-name="LuCI.form.DummyValue#ucioption"><a href="LuCI.form.DummyValue.html#ucioption">ucioption</a></li>
559
560 <li data-name="LuCI.form.DummyValue#ucisection"><a href="LuCI.form.DummyValue.html#ucisection">ucisection</a></li>
561
562 <li data-name="LuCI.form.DummyValue#validate"><a href="LuCI.form.DummyValue.html#validate">validate</a></li>
563
564 <li data-name="LuCI.form.DummyValue#width"><a href="LuCI.form.DummyValue.html#width">width</a></li>
565
566 </ul>
567 <ul class="typedefs itemMembers">
568
569 </ul>
570 <ul class="typedefs itemMembers">
571
572 </ul>
573 <ul class="methods itemMembers">
574
575 <span class="subtitle">Methods</span>
576
577 <li data-name="LuCI.form.DummyValue#append"><a href="LuCI.form.DummyValue.html#append">append</a></li>
578
579 <li data-name="LuCI.form.DummyValue#cbid"><a href="LuCI.form.DummyValue.html#cbid">cbid</a></li>
580
581 <li data-name="LuCI.form.DummyValue#cfgvalue"><a href="LuCI.form.DummyValue.html#cfgvalue">cfgvalue</a></li>
582
583 <li data-name="LuCI.form.DummyValue#depends"><a href="LuCI.form.DummyValue.html#depends">depends</a></li>
584
585 <li data-name="LuCI.form.DummyValue#formvalue"><a href="LuCI.form.DummyValue.html#formvalue">formvalue</a></li>
586
587 <li data-name="LuCI.form.DummyValue#getUIElement"><a href="LuCI.form.DummyValue.html#getUIElement">getUIElement</a></li>
588
589 <li data-name="LuCI.form.DummyValue#getValidationError"><a href="LuCI.form.DummyValue.html#getValidationError">getValidationError</a></li>
590
591 <li data-name="LuCI.form.DummyValue#isActive"><a href="LuCI.form.DummyValue.html#isActive">isActive</a></li>
592
593 <li data-name="LuCI.form.DummyValue#isValid"><a href="LuCI.form.DummyValue.html#isValid">isValid</a></li>
594
595 <li data-name="LuCI.form.DummyValue#load"><a href="LuCI.form.DummyValue.html#load">load</a></li>
596
597 <li data-name="LuCI.form.DummyValue#parse"><a href="LuCI.form.DummyValue.html#parse">parse</a></li>
598
599 <li data-name="LuCI.form.DummyValue#remove"><a href="LuCI.form.DummyValue.html#remove">remove</a></li>
600
601 <li data-name="LuCI.form.DummyValue#stripTags"><a href="LuCI.form.DummyValue.html#stripTags">stripTags</a></li>
602
603 <li data-name="LuCI.form.DummyValue#textvalue"><a href="LuCI.form.DummyValue.html#textvalue">textvalue</a></li>
604
605 <li data-name="LuCI.form.DummyValue#titleFn"><a href="LuCI.form.DummyValue.html#titleFn">titleFn</a></li>
606
607 <li data-name="LuCI.form.DummyValue#value"><a href="LuCI.form.DummyValue.html#value">value</a></li>
608
609 <li data-name="LuCI.form.DummyValue#write"><a href="LuCI.form.DummyValue.html#write">write</a></li>
610
611 </ul>
612 <ul class="events itemMembers">
613
614 </ul>
615 </li>
616
617 <li class="item" data-name="LuCI.form.DynamicList">
618 <span class="title">
619 <a href="LuCI.form.DynamicList.html">LuCI.form.DynamicList</a>
620
621 </span>
622 <ul class="members itemMembers">
623
624 <span class="subtitle">Members</span>
625
626 <li data-name="LuCI.form.DynamicList#datatype"><a href="LuCI.form.DynamicList.html#datatype">datatype</a></li>
627
628 <li data-name="LuCI.form.DynamicList#default"><a href="LuCI.form.DynamicList.html#default">default</a></li>
629
630 <li data-name="LuCI.form.DynamicList#editable"><a href="LuCI.form.DynamicList.html#editable">editable</a></li>
631
632 <li data-name="LuCI.form.DynamicList#modalonly"><a href="LuCI.form.DynamicList.html#modalonly">modalonly</a></li>
633
634 <li data-name="LuCI.form.DynamicList#onchange"><a href="LuCI.form.DynamicList.html#onchange">onchange</a></li>
635
636 <li data-name="LuCI.form.DynamicList#optional"><a href="LuCI.form.DynamicList.html#optional">optional</a></li>
637
638 <li data-name="LuCI.form.DynamicList#password"><a href="LuCI.form.DynamicList.html#password">password</a></li>
639
640 <li data-name="LuCI.form.DynamicList#placeholder"><a href="LuCI.form.DynamicList.html#placeholder">placeholder</a></li>
641
642 <li data-name="LuCI.form.DynamicList#readonly"><a href="LuCI.form.DynamicList.html#readonly">readonly</a></li>
643
644 <li data-name="LuCI.form.DynamicList#retain"><a href="LuCI.form.DynamicList.html#retain">retain</a></li>
645
646 <li data-name="LuCI.form.DynamicList#rmempty"><a href="LuCI.form.DynamicList.html#rmempty">rmempty</a></li>
647
648 <li data-name="LuCI.form.DynamicList#uciconfig"><a href="LuCI.form.DynamicList.html#uciconfig">uciconfig</a></li>
649
650 <li data-name="LuCI.form.DynamicList#ucioption"><a href="LuCI.form.DynamicList.html#ucioption">ucioption</a></li>
651
652 <li data-name="LuCI.form.DynamicList#ucisection"><a href="LuCI.form.DynamicList.html#ucisection">ucisection</a></li>
653
654 <li data-name="LuCI.form.DynamicList#validate"><a href="LuCI.form.DynamicList.html#validate">validate</a></li>
655
656 <li data-name="LuCI.form.DynamicList#width"><a href="LuCI.form.DynamicList.html#width">width</a></li>
657
658 </ul>
659 <ul class="typedefs itemMembers">
660
661 </ul>
662 <ul class="typedefs itemMembers">
663
664 </ul>
665 <ul class="methods itemMembers">
666
667 <span class="subtitle">Methods</span>
668
669 <li data-name="LuCI.form.DynamicList#append"><a href="LuCI.form.DynamicList.html#append">append</a></li>
670
671 <li data-name="LuCI.form.DynamicList#cbid"><a href="LuCI.form.DynamicList.html#cbid">cbid</a></li>
672
673 <li data-name="LuCI.form.DynamicList#cfgvalue"><a href="LuCI.form.DynamicList.html#cfgvalue">cfgvalue</a></li>
674
675 <li data-name="LuCI.form.DynamicList#depends"><a href="LuCI.form.DynamicList.html#depends">depends</a></li>
676
677 <li data-name="LuCI.form.DynamicList#formvalue"><a href="LuCI.form.DynamicList.html#formvalue">formvalue</a></li>
678
679 <li data-name="LuCI.form.DynamicList#getUIElement"><a href="LuCI.form.DynamicList.html#getUIElement">getUIElement</a></li>
680
681 <li data-name="LuCI.form.DynamicList#getValidationError"><a href="LuCI.form.DynamicList.html#getValidationError">getValidationError</a></li>
682
683 <li data-name="LuCI.form.DynamicList#isActive"><a href="LuCI.form.DynamicList.html#isActive">isActive</a></li>
684
685 <li data-name="LuCI.form.DynamicList#isValid"><a href="LuCI.form.DynamicList.html#isValid">isValid</a></li>
686
687 <li data-name="LuCI.form.DynamicList#load"><a href="LuCI.form.DynamicList.html#load">load</a></li>
688
689 <li data-name="LuCI.form.DynamicList#parse"><a href="LuCI.form.DynamicList.html#parse">parse</a></li>
690
691 <li data-name="LuCI.form.DynamicList#remove"><a href="LuCI.form.DynamicList.html#remove">remove</a></li>
692
693 <li data-name="LuCI.form.DynamicList#stripTags"><a href="LuCI.form.DynamicList.html#stripTags">stripTags</a></li>
694
695 <li data-name="LuCI.form.DynamicList#textvalue"><a href="LuCI.form.DynamicList.html#textvalue">textvalue</a></li>
696
697 <li data-name="LuCI.form.DynamicList#titleFn"><a href="LuCI.form.DynamicList.html#titleFn">titleFn</a></li>
698
699 <li data-name="LuCI.form.DynamicList#value"><a href="LuCI.form.DynamicList.html#value">value</a></li>
700
701 <li data-name="LuCI.form.DynamicList#write"><a href="LuCI.form.DynamicList.html#write">write</a></li>
702
703 </ul>
704 <ul class="events itemMembers">
705
706 </ul>
707 </li>
708
709 <li class="item" data-name="LuCI.form.FileUpload">
710 <span class="title">
711 <a href="LuCI.form.FileUpload.html">LuCI.form.FileUpload</a>
712
713 </span>
714 <ul class="members itemMembers">
715
716 <span class="subtitle">Members</span>
717
718 <li data-name="LuCI.form.FileUpload##enable_remove"><a href="LuCI.form.FileUpload.html#enable_remove">enable_remove</a></li>
719
720 <li data-name="LuCI.form.FileUpload##enable_upload"><a href="LuCI.form.FileUpload.html#enable_upload">enable_upload</a></li>
721
722 <li data-name="LuCI.form.FileUpload##root_directory"><a href="LuCI.form.FileUpload.html#root_directory">root_directory</a></li>
723
724 <li data-name="LuCI.form.FileUpload##show_hidden"><a href="LuCI.form.FileUpload.html#show_hidden">show_hidden</a></li>
725
726 <li data-name="LuCI.form.FileUpload#datatype"><a href="LuCI.form.FileUpload.html#datatype">datatype</a></li>
727
728 <li data-name="LuCI.form.FileUpload#default"><a href="LuCI.form.FileUpload.html#default">default</a></li>
729
730 <li data-name="LuCI.form.FileUpload#editable"><a href="LuCI.form.FileUpload.html#editable">editable</a></li>
731
732 <li data-name="LuCI.form.FileUpload#modalonly"><a href="LuCI.form.FileUpload.html#modalonly">modalonly</a></li>
733
734 <li data-name="LuCI.form.FileUpload#onchange"><a href="LuCI.form.FileUpload.html#onchange">onchange</a></li>
735
736 <li data-name="LuCI.form.FileUpload#optional"><a href="LuCI.form.FileUpload.html#optional">optional</a></li>
737
738 <li data-name="LuCI.form.FileUpload#password"><a href="LuCI.form.FileUpload.html#password">password</a></li>
739
740 <li data-name="LuCI.form.FileUpload#placeholder"><a href="LuCI.form.FileUpload.html#placeholder">placeholder</a></li>
741
742 <li data-name="LuCI.form.FileUpload#readonly"><a href="LuCI.form.FileUpload.html#readonly">readonly</a></li>
743
744 <li data-name="LuCI.form.FileUpload#retain"><a href="LuCI.form.FileUpload.html#retain">retain</a></li>
745
746 <li data-name="LuCI.form.FileUpload#rmempty"><a href="LuCI.form.FileUpload.html#rmempty">rmempty</a></li>
747
748 <li data-name="LuCI.form.FileUpload#uciconfig"><a href="LuCI.form.FileUpload.html#uciconfig">uciconfig</a></li>
749
750 <li data-name="LuCI.form.FileUpload#ucioption"><a href="LuCI.form.FileUpload.html#ucioption">ucioption</a></li>
751
752 <li data-name="LuCI.form.FileUpload#ucisection"><a href="LuCI.form.FileUpload.html#ucisection">ucisection</a></li>
753
754 <li data-name="LuCI.form.FileUpload#validate"><a href="LuCI.form.FileUpload.html#validate">validate</a></li>
755
756 <li data-name="LuCI.form.FileUpload#width"><a href="LuCI.form.FileUpload.html#width">width</a></li>
757
758 </ul>
759 <ul class="typedefs itemMembers">
760
761 </ul>
762 <ul class="typedefs itemMembers">
763
764 </ul>
765 <ul class="methods itemMembers">
766
767 <span class="subtitle">Methods</span>
768
769 <li data-name="LuCI.form.FileUpload#append"><a href="LuCI.form.FileUpload.html#append">append</a></li>
770
771 <li data-name="LuCI.form.FileUpload#cbid"><a href="LuCI.form.FileUpload.html#cbid">cbid</a></li>
772
773 <li data-name="LuCI.form.FileUpload#cfgvalue"><a href="LuCI.form.FileUpload.html#cfgvalue">cfgvalue</a></li>
774
775 <li data-name="LuCI.form.FileUpload#depends"><a href="LuCI.form.FileUpload.html#depends">depends</a></li>
776
777 <li data-name="LuCI.form.FileUpload#formvalue"><a href="LuCI.form.FileUpload.html#formvalue">formvalue</a></li>
778
779 <li data-name="LuCI.form.FileUpload#getUIElement"><a href="LuCI.form.FileUpload.html#getUIElement">getUIElement</a></li>
780
781 <li data-name="LuCI.form.FileUpload#getValidationError"><a href="LuCI.form.FileUpload.html#getValidationError">getValidationError</a></li>
782
783 <li data-name="LuCI.form.FileUpload#isActive"><a href="LuCI.form.FileUpload.html#isActive">isActive</a></li>
784
785 <li data-name="LuCI.form.FileUpload#isValid"><a href="LuCI.form.FileUpload.html#isValid">isValid</a></li>
786
787 <li data-name="LuCI.form.FileUpload#load"><a href="LuCI.form.FileUpload.html#load">load</a></li>
788
789 <li data-name="LuCI.form.FileUpload#parse"><a href="LuCI.form.FileUpload.html#parse">parse</a></li>
790
791 <li data-name="LuCI.form.FileUpload#remove"><a href="LuCI.form.FileUpload.html#remove">remove</a></li>
792
793 <li data-name="LuCI.form.FileUpload#stripTags"><a href="LuCI.form.FileUpload.html#stripTags">stripTags</a></li>
794
795 <li data-name="LuCI.form.FileUpload#textvalue"><a href="LuCI.form.FileUpload.html#textvalue">textvalue</a></li>
796
797 <li data-name="LuCI.form.FileUpload#titleFn"><a href="LuCI.form.FileUpload.html#titleFn">titleFn</a></li>
798
799 <li data-name="LuCI.form.FileUpload#value"><a href="LuCI.form.FileUpload.html#value">value</a></li>
800
801 <li data-name="LuCI.form.FileUpload#write"><a href="LuCI.form.FileUpload.html#write">write</a></li>
802
803 </ul>
804 <ul class="events itemMembers">
805
806 </ul>
807 </li>
808
809 <li class="item" data-name="LuCI.form.FlagValue">
810 <span class="title">
811 <a href="LuCI.form.FlagValue.html">LuCI.form.FlagValue</a>
812
813 </span>
814 <ul class="members itemMembers">
815
816 <span class="subtitle">Members</span>
817
818 <li data-name="LuCI.form.FlagValue##disabled"><a href="LuCI.form.FlagValue.html#disabled">disabled</a></li>
819
820 <li data-name="LuCI.form.FlagValue##enabled"><a href="LuCI.form.FlagValue.html#enabled">enabled</a></li>
821
822 <li data-name="LuCI.form.FlagValue#datatype"><a href="LuCI.form.FlagValue.html#datatype">datatype</a></li>
823
824 <li data-name="LuCI.form.FlagValue#default"><a href="LuCI.form.FlagValue.html#default">default</a></li>
825
826 <li data-name="LuCI.form.FlagValue#editable"><a href="LuCI.form.FlagValue.html#editable">editable</a></li>
827
828 <li data-name="LuCI.form.FlagValue#modalonly"><a href="LuCI.form.FlagValue.html#modalonly">modalonly</a></li>
829
830 <li data-name="LuCI.form.FlagValue#onchange"><a href="LuCI.form.FlagValue.html#onchange">onchange</a></li>
831
832 <li data-name="LuCI.form.FlagValue#optional"><a href="LuCI.form.FlagValue.html#optional">optional</a></li>
833
834 <li data-name="LuCI.form.FlagValue#password"><a href="LuCI.form.FlagValue.html#password">password</a></li>
835
836 <li data-name="LuCI.form.FlagValue#placeholder"><a href="LuCI.form.FlagValue.html#placeholder">placeholder</a></li>
837
838 <li data-name="LuCI.form.FlagValue#readonly"><a href="LuCI.form.FlagValue.html#readonly">readonly</a></li>
839
840 <li data-name="LuCI.form.FlagValue#retain"><a href="LuCI.form.FlagValue.html#retain">retain</a></li>
841
842 <li data-name="LuCI.form.FlagValue#rmempty"><a href="LuCI.form.FlagValue.html#rmempty">rmempty</a></li>
843
844 <li data-name="LuCI.form.FlagValue#uciconfig"><a href="LuCI.form.FlagValue.html#uciconfig">uciconfig</a></li>
845
846 <li data-name="LuCI.form.FlagValue#ucioption"><a href="LuCI.form.FlagValue.html#ucioption">ucioption</a></li>
847
848 <li data-name="LuCI.form.FlagValue#ucisection"><a href="LuCI.form.FlagValue.html#ucisection">ucisection</a></li>
849
850 <li data-name="LuCI.form.FlagValue#validate"><a href="LuCI.form.FlagValue.html#validate">validate</a></li>
851
852 <li data-name="LuCI.form.FlagValue#width"><a href="LuCI.form.FlagValue.html#width">width</a></li>
853
854 </ul>
855 <ul class="typedefs itemMembers">
856
857 </ul>
858 <ul class="typedefs itemMembers">
859
860 </ul>
861 <ul class="methods itemMembers">
862
863 <span class="subtitle">Methods</span>
864
865 <li data-name="LuCI.form.FlagValue#append"><a href="LuCI.form.FlagValue.html#append">append</a></li>
866
867 <li data-name="LuCI.form.FlagValue#cbid"><a href="LuCI.form.FlagValue.html#cbid">cbid</a></li>
868
869 <li data-name="LuCI.form.FlagValue#cfgvalue"><a href="LuCI.form.FlagValue.html#cfgvalue">cfgvalue</a></li>
870
871 <li data-name="LuCI.form.FlagValue#depends"><a href="LuCI.form.FlagValue.html#depends">depends</a></li>
872
873 <li data-name="LuCI.form.FlagValue#formvalue"><a href="LuCI.form.FlagValue.html#formvalue">formvalue</a></li>
874
875 <li data-name="LuCI.form.FlagValue#getUIElement"><a href="LuCI.form.FlagValue.html#getUIElement">getUIElement</a></li>
876
877 <li data-name="LuCI.form.FlagValue#getValidationError"><a href="LuCI.form.FlagValue.html#getValidationError">getValidationError</a></li>
878
879 <li data-name="LuCI.form.FlagValue#isActive"><a href="LuCI.form.FlagValue.html#isActive">isActive</a></li>
880
881 <li data-name="LuCI.form.FlagValue#isValid"><a href="LuCI.form.FlagValue.html#isValid">isValid</a></li>
882
883 <li data-name="LuCI.form.FlagValue#load"><a href="LuCI.form.FlagValue.html#load">load</a></li>
884
885 <li data-name="LuCI.form.FlagValue#parse"><a href="LuCI.form.FlagValue.html#parse">parse</a></li>
886
887 <li data-name="LuCI.form.FlagValue#remove"><a href="LuCI.form.FlagValue.html#remove">remove</a></li>
888
889 <li data-name="LuCI.form.FlagValue#stripTags"><a href="LuCI.form.FlagValue.html#stripTags">stripTags</a></li>
890
891 <li data-name="LuCI.form.FlagValue#textvalue"><a href="LuCI.form.FlagValue.html#textvalue">textvalue</a></li>
892
893 <li data-name="LuCI.form.FlagValue#titleFn"><a href="LuCI.form.FlagValue.html#titleFn">titleFn</a></li>
894
895 <li data-name="LuCI.form.FlagValue#value"><a href="LuCI.form.FlagValue.html#value">value</a></li>
896
897 <li data-name="LuCI.form.FlagValue#write"><a href="LuCI.form.FlagValue.html#write">write</a></li>
898
899 </ul>
900 <ul class="events itemMembers">
901
902 </ul>
903 </li>
904
905 <li class="item" data-name="LuCI.form.GridSection">
906 <span class="title">
907 <a href="LuCI.form.GridSection.html">LuCI.form.GridSection</a>
908
909 </span>
910 <ul class="members itemMembers">
911
912 <span class="subtitle">Members</span>
913
914 <li data-name="LuCI.form.GridSection#addbtntitle"><a href="LuCI.form.GridSection.html#addbtntitle">addbtntitle</a></li>
915
916 <li data-name="LuCI.form.GridSection#addremove"><a href="LuCI.form.GridSection.html#addremove">addremove</a></li>
917
918 <li data-name="LuCI.form.GridSection#anonymous"><a href="LuCI.form.GridSection.html#anonymous">anonymous</a></li>
919
920 <li data-name="LuCI.form.GridSection#extedit"><a href="LuCI.form.GridSection.html#extedit">extedit</a></li>
921
922 <li data-name="LuCI.form.GridSection#max_cols"><a href="LuCI.form.GridSection.html#max_cols">max_cols</a></li>
923
924 <li data-name="LuCI.form.GridSection#modaltitle"><a href="LuCI.form.GridSection.html#modaltitle">modaltitle</a></li>
925
926 <li data-name="LuCI.form.GridSection#nodescriptions"><a href="LuCI.form.GridSection.html#nodescriptions">nodescriptions</a></li>
927
928 <li data-name="LuCI.form.GridSection#parentoption"><a href="LuCI.form.GridSection.html#parentoption">parentoption</a></li>
929
930 <li data-name="LuCI.form.GridSection#rowcolors"><a href="LuCI.form.GridSection.html#rowcolors">rowcolors</a></li>
931
932 <li data-name="LuCI.form.GridSection#sectiontitle"><a href="LuCI.form.GridSection.html#sectiontitle">sectiontitle</a></li>
933
934 <li data-name="LuCI.form.GridSection#sortable"><a href="LuCI.form.GridSection.html#sortable">sortable</a></li>
935
936 <li data-name="LuCI.form.GridSection#tabbed"><a href="LuCI.form.GridSection.html#tabbed">tabbed</a></li>
937
938 <li data-name="LuCI.form.GridSection#tooltip"><a href="LuCI.form.GridSection.html#tooltip">tooltip</a></li>
939
940 <li data-name="LuCI.form.GridSection#tooltipicon"><a href="LuCI.form.GridSection.html#tooltipicon">tooltipicon</a></li>
941
942 <li data-name="LuCI.form.GridSection#uciconfig"><a href="LuCI.form.GridSection.html#uciconfig">uciconfig</a></li>
943
944 </ul>
945 <ul class="typedefs itemMembers">
946
947 </ul>
948 <ul class="typedefs itemMembers">
949
950 </ul>
951 <ul class="methods itemMembers">
952
953 <span class="subtitle">Methods</span>
954
955 <li data-name="LuCI.form.GridSection#addModalOptions"><a href="LuCI.form.GridSection.html#addModalOptions">addModalOptions</a></li>
956
957 <li data-name="LuCI.form.GridSection#append"><a href="LuCI.form.GridSection.html#append">append</a></li>
958
959 <li data-name="LuCI.form.GridSection#cfgvalue"><a href="LuCI.form.GridSection.html#cfgvalue">cfgvalue</a></li>
960
961 <li data-name="LuCI.form.GridSection#filter"><a href="LuCI.form.GridSection.html#filter">filter</a></li>
962
963 <li data-name="LuCI.form.GridSection#formvalue"><a href="LuCI.form.GridSection.html#formvalue">formvalue</a></li>
964
965 <li data-name="LuCI.form.GridSection#getOption"><a href="LuCI.form.GridSection.html#getOption">getOption</a></li>
966
967 <li data-name="LuCI.form.GridSection#getUIElement"><a href="LuCI.form.GridSection.html#getUIElement">getUIElement</a></li>
968
969 <li data-name="LuCI.form.GridSection#load"><a href="LuCI.form.GridSection.html#load">load</a></li>
970
971 <li data-name="LuCI.form.GridSection#option"><a href="LuCI.form.GridSection.html#option">option</a></li>
972
973 <li data-name="LuCI.form.GridSection#parse"><a href="LuCI.form.GridSection.html#parse">parse</a></li>
974
975 <li data-name="LuCI.form.GridSection#stripTags"><a href="LuCI.form.GridSection.html#stripTags">stripTags</a></li>
976
977 <li data-name="LuCI.form.GridSection#tab"><a href="LuCI.form.GridSection.html#tab">tab</a></li>
978
979 <li data-name="LuCI.form.GridSection#taboption"><a href="LuCI.form.GridSection.html#taboption">taboption</a></li>
980
981 <li data-name="LuCI.form.GridSection#titleFn"><a href="LuCI.form.GridSection.html#titleFn">titleFn</a></li>
982
983 </ul>
984 <ul class="events itemMembers">
985
986 </ul>
987 </li>
988
989 <li class="item" data-name="LuCI.form.HiddenValue">
990 <span class="title">
991 <a href="LuCI.form.HiddenValue.html">LuCI.form.HiddenValue</a>
992
993 </span>
994 <ul class="members itemMembers">
995
996 <span class="subtitle">Members</span>
997
998 <li data-name="LuCI.form.HiddenValue#datatype"><a href="LuCI.form.HiddenValue.html#datatype">datatype</a></li>
999
1000 <li data-name="LuCI.form.HiddenValue#default"><a href="LuCI.form.HiddenValue.html#default">default</a></li>
1001
1002 <li data-name="LuCI.form.HiddenValue#editable"><a href="LuCI.form.HiddenValue.html#editable">editable</a></li>
1003
1004 <li data-name="LuCI.form.HiddenValue#modalonly"><a href="LuCI.form.HiddenValue.html#modalonly">modalonly</a></li>
1005
1006 <li data-name="LuCI.form.HiddenValue#onchange"><a href="LuCI.form.HiddenValue.html#onchange">onchange</a></li>
1007
1008 <li data-name="LuCI.form.HiddenValue#optional"><a href="LuCI.form.HiddenValue.html#optional">optional</a></li>
1009
1010 <li data-name="LuCI.form.HiddenValue#password"><a href="LuCI.form.HiddenValue.html#password">password</a></li>
1011
1012 <li data-name="LuCI.form.HiddenValue#placeholder"><a href="LuCI.form.HiddenValue.html#placeholder">placeholder</a></li>
1013
1014 <li data-name="LuCI.form.HiddenValue#readonly"><a href="LuCI.form.HiddenValue.html#readonly">readonly</a></li>
1015
1016 <li data-name="LuCI.form.HiddenValue#retain"><a href="LuCI.form.HiddenValue.html#retain">retain</a></li>
1017
1018 <li data-name="LuCI.form.HiddenValue#rmempty"><a href="LuCI.form.HiddenValue.html#rmempty">rmempty</a></li>
1019
1020 <li data-name="LuCI.form.HiddenValue#uciconfig"><a href="LuCI.form.HiddenValue.html#uciconfig">uciconfig</a></li>
1021
1022 <li data-name="LuCI.form.HiddenValue#ucioption"><a href="LuCI.form.HiddenValue.html#ucioption">ucioption</a></li>
1023
1024 <li data-name="LuCI.form.HiddenValue#ucisection"><a href="LuCI.form.HiddenValue.html#ucisection">ucisection</a></li>
1025
1026 <li data-name="LuCI.form.HiddenValue#validate"><a href="LuCI.form.HiddenValue.html#validate">validate</a></li>
1027
1028 <li data-name="LuCI.form.HiddenValue#width"><a href="LuCI.form.HiddenValue.html#width">width</a></li>
1029
1030 </ul>
1031 <ul class="typedefs itemMembers">
1032
1033 </ul>
1034 <ul class="typedefs itemMembers">
1035
1036 </ul>
1037 <ul class="methods itemMembers">
1038
1039 <span class="subtitle">Methods</span>
1040
1041 <li data-name="LuCI.form.HiddenValue#append"><a href="LuCI.form.HiddenValue.html#append">append</a></li>
1042
1043 <li data-name="LuCI.form.HiddenValue#cbid"><a href="LuCI.form.HiddenValue.html#cbid">cbid</a></li>
1044
1045 <li data-name="LuCI.form.HiddenValue#cfgvalue"><a href="LuCI.form.HiddenValue.html#cfgvalue">cfgvalue</a></li>
1046
1047 <li data-name="LuCI.form.HiddenValue#depends"><a href="LuCI.form.HiddenValue.html#depends">depends</a></li>
1048
1049 <li data-name="LuCI.form.HiddenValue#formvalue"><a href="LuCI.form.HiddenValue.html#formvalue">formvalue</a></li>
1050
1051 <li data-name="LuCI.form.HiddenValue#getUIElement"><a href="LuCI.form.HiddenValue.html#getUIElement">getUIElement</a></li>
1052
1053 <li data-name="LuCI.form.HiddenValue#getValidationError"><a href="LuCI.form.HiddenValue.html#getValidationError">getValidationError</a></li>
1054
1055 <li data-name="LuCI.form.HiddenValue#isActive"><a href="LuCI.form.HiddenValue.html#isActive">isActive</a></li>
1056
1057 <li data-name="LuCI.form.HiddenValue#isValid"><a href="LuCI.form.HiddenValue.html#isValid">isValid</a></li>
1058
1059 <li data-name="LuCI.form.HiddenValue#load"><a href="LuCI.form.HiddenValue.html#load">load</a></li>
1060
1061 <li data-name="LuCI.form.HiddenValue#parse"><a href="LuCI.form.HiddenValue.html#parse">parse</a></li>
1062
1063 <li data-name="LuCI.form.HiddenValue#remove"><a href="LuCI.form.HiddenValue.html#remove">remove</a></li>
1064
1065 <li data-name="LuCI.form.HiddenValue#stripTags"><a href="LuCI.form.HiddenValue.html#stripTags">stripTags</a></li>
1066
1067 <li data-name="LuCI.form.HiddenValue#textvalue"><a href="LuCI.form.HiddenValue.html#textvalue">textvalue</a></li>
1068
1069 <li data-name="LuCI.form.HiddenValue#titleFn"><a href="LuCI.form.HiddenValue.html#titleFn">titleFn</a></li>
1070
1071 <li data-name="LuCI.form.HiddenValue#value"><a href="LuCI.form.HiddenValue.html#value">value</a></li>
1072
1073 <li data-name="LuCI.form.HiddenValue#write"><a href="LuCI.form.HiddenValue.html#write">write</a></li>
1074
1075 </ul>
1076 <ul class="events itemMembers">
1077
1078 </ul>
1079 </li>
1080
1081 <li class="item" data-name="LuCI.form.JSONMap">
1082 <span class="title">
1083 <a href="LuCI.form.JSONMap.html">LuCI.form.JSONMap</a>
1084
1085 </span>
1086 <ul class="members itemMembers">
1087
1088 <span class="subtitle">Members</span>
1089
1090 <li data-name="LuCI.form.JSONMap#readonly"><a href="LuCI.form.JSONMap.html#readonly">readonly</a></li>
1091
1092 </ul>
1093 <ul class="typedefs itemMembers">
1094
1095 </ul>
1096 <ul class="typedefs itemMembers">
1097
1098 </ul>
1099 <ul class="methods itemMembers">
1100
1101 <span class="subtitle">Methods</span>
1102
1103 <li data-name="LuCI.form.JSONMap#append"><a href="LuCI.form.JSONMap.html#append">append</a></li>
1104
1105 <li data-name="LuCI.form.JSONMap#chain"><a href="LuCI.form.JSONMap.html#chain">chain</a></li>
1106
1107 <li data-name="LuCI.form.JSONMap#findElement"><a href="LuCI.form.JSONMap.html#findElement">findElement</a></li>
1108
1109 <li data-name="LuCI.form.JSONMap#findElements"><a href="LuCI.form.JSONMap.html#findElements">findElements</a></li>
1110
1111 <li data-name="LuCI.form.JSONMap#load"><a href="LuCI.form.JSONMap.html#load">load</a></li>
1112
1113 <li data-name="LuCI.form.JSONMap#lookupOption"><a href="LuCI.form.JSONMap.html#lookupOption">lookupOption</a></li>
1114
1115 <li data-name="LuCI.form.JSONMap#parse"><a href="LuCI.form.JSONMap.html#parse">parse</a></li>
1116
1117 <li data-name="LuCI.form.JSONMap#render"><a href="LuCI.form.JSONMap.html#render">render</a></li>
1118
1119 <li data-name="LuCI.form.JSONMap#reset"><a href="LuCI.form.JSONMap.html#reset">reset</a></li>
1120
1121 <li data-name="LuCI.form.JSONMap#save"><a href="LuCI.form.JSONMap.html#save">save</a></li>
1122
1123 <li data-name="LuCI.form.JSONMap#section"><a href="LuCI.form.JSONMap.html#section">section</a></li>
1124
1125 <li data-name="LuCI.form.JSONMap#stripTags"><a href="LuCI.form.JSONMap.html#stripTags">stripTags</a></li>
1126
1127 <li data-name="LuCI.form.JSONMap#titleFn"><a href="LuCI.form.JSONMap.html#titleFn">titleFn</a></li>
1128
1129 </ul>
1130 <ul class="events itemMembers">
1131
1132 </ul>
1133 </li>
1134
1135 <li class="item" data-name="LuCI.form.ListValue">
1136 <span class="title">
1137 <a href="LuCI.form.ListValue.html">LuCI.form.ListValue</a>
1138
1139 </span>
1140 <ul class="members itemMembers">
1141
1142 <span class="subtitle">Members</span>
1143
1144 <li data-name="LuCI.form.ListValue##orientation"><a href="LuCI.form.ListValue.html#orientation">orientation</a></li>
1145
1146 <li data-name="LuCI.form.ListValue##size"><a href="LuCI.form.ListValue.html#size">size</a></li>
1147
1148 <li data-name="LuCI.form.ListValue##widget"><a href="LuCI.form.ListValue.html#widget">widget</a></li>
1149
1150 <li data-name="LuCI.form.ListValue#datatype"><a href="LuCI.form.ListValue.html#datatype">datatype</a></li>
1151
1152 <li data-name="LuCI.form.ListValue#default"><a href="LuCI.form.ListValue.html#default">default</a></li>
1153
1154 <li data-name="LuCI.form.ListValue#editable"><a href="LuCI.form.ListValue.html#editable">editable</a></li>
1155
1156 <li data-name="LuCI.form.ListValue#modalonly"><a href="LuCI.form.ListValue.html#modalonly">modalonly</a></li>
1157
1158 <li data-name="LuCI.form.ListValue#onchange"><a href="LuCI.form.ListValue.html#onchange">onchange</a></li>
1159
1160 <li data-name="LuCI.form.ListValue#optional"><a href="LuCI.form.ListValue.html#optional">optional</a></li>
1161
1162 <li data-name="LuCI.form.ListValue#password"><a href="LuCI.form.ListValue.html#password">password</a></li>
1163
1164 <li data-name="LuCI.form.ListValue#placeholder"><a href="LuCI.form.ListValue.html#placeholder">placeholder</a></li>
1165
1166 <li data-name="LuCI.form.ListValue#readonly"><a href="LuCI.form.ListValue.html#readonly">readonly</a></li>
1167
1168 <li data-name="LuCI.form.ListValue#retain"><a href="LuCI.form.ListValue.html#retain">retain</a></li>
1169
1170 <li data-name="LuCI.form.ListValue#rmempty"><a href="LuCI.form.ListValue.html#rmempty">rmempty</a></li>
1171
1172 <li data-name="LuCI.form.ListValue#uciconfig"><a href="LuCI.form.ListValue.html#uciconfig">uciconfig</a></li>
1173
1174 <li data-name="LuCI.form.ListValue#ucioption"><a href="LuCI.form.ListValue.html#ucioption">ucioption</a></li>
1175
1176 <li data-name="LuCI.form.ListValue#ucisection"><a href="LuCI.form.ListValue.html#ucisection">ucisection</a></li>
1177
1178 <li data-name="LuCI.form.ListValue#validate"><a href="LuCI.form.ListValue.html#validate">validate</a></li>
1179
1180 <li data-name="LuCI.form.ListValue#width"><a href="LuCI.form.ListValue.html#width">width</a></li>
1181
1182 </ul>
1183 <ul class="typedefs itemMembers">
1184
1185 </ul>
1186 <ul class="typedefs itemMembers">
1187
1188 </ul>
1189 <ul class="methods itemMembers">
1190
1191 <span class="subtitle">Methods</span>
1192
1193 <li data-name="LuCI.form.ListValue#append"><a href="LuCI.form.ListValue.html#append">append</a></li>
1194
1195 <li data-name="LuCI.form.ListValue#cbid"><a href="LuCI.form.ListValue.html#cbid">cbid</a></li>
1196
1197 <li data-name="LuCI.form.ListValue#cfgvalue"><a href="LuCI.form.ListValue.html#cfgvalue">cfgvalue</a></li>
1198
1199 <li data-name="LuCI.form.ListValue#depends"><a href="LuCI.form.ListValue.html#depends">depends</a></li>
1200
1201 <li data-name="LuCI.form.ListValue#formvalue"><a href="LuCI.form.ListValue.html#formvalue">formvalue</a></li>
1202
1203 <li data-name="LuCI.form.ListValue#getUIElement"><a href="LuCI.form.ListValue.html#getUIElement">getUIElement</a></li>
1204
1205 <li data-name="LuCI.form.ListValue#getValidationError"><a href="LuCI.form.ListValue.html#getValidationError">getValidationError</a></li>
1206
1207 <li data-name="LuCI.form.ListValue#isActive"><a href="LuCI.form.ListValue.html#isActive">isActive</a></li>
1208
1209 <li data-name="LuCI.form.ListValue#isValid"><a href="LuCI.form.ListValue.html#isValid">isValid</a></li>
1210
1211 <li data-name="LuCI.form.ListValue#load"><a href="LuCI.form.ListValue.html#load">load</a></li>
1212
1213 <li data-name="LuCI.form.ListValue#parse"><a href="LuCI.form.ListValue.html#parse">parse</a></li>
1214
1215 <li data-name="LuCI.form.ListValue#remove"><a href="LuCI.form.ListValue.html#remove">remove</a></li>
1216
1217 <li data-name="LuCI.form.ListValue#stripTags"><a href="LuCI.form.ListValue.html#stripTags">stripTags</a></li>
1218
1219 <li data-name="LuCI.form.ListValue#textvalue"><a href="LuCI.form.ListValue.html#textvalue">textvalue</a></li>
1220
1221 <li data-name="LuCI.form.ListValue#titleFn"><a href="LuCI.form.ListValue.html#titleFn">titleFn</a></li>
1222
1223 <li data-name="LuCI.form.ListValue#value"><a href="LuCI.form.ListValue.html#value">value</a></li>
1224
1225 <li data-name="LuCI.form.ListValue#write"><a href="LuCI.form.ListValue.html#write">write</a></li>
1226
1227 </ul>
1228 <ul class="events itemMembers">
1229
1230 </ul>
1231 </li>
1232
1233 <li class="item" data-name="LuCI.form.Map">
1234 <span class="title">
1235 <a href="LuCI.form.Map.html">LuCI.form.Map</a>
1236
1237 </span>
1238 <ul class="members itemMembers">
1239
1240 <span class="subtitle">Members</span>
1241
1242 <li data-name="LuCI.form.Map##readonly"><a href="LuCI.form.Map.html#readonly">readonly</a></li>
1243
1244 </ul>
1245 <ul class="typedefs itemMembers">
1246
1247 </ul>
1248 <ul class="typedefs itemMembers">
1249
1250 </ul>
1251 <ul class="methods itemMembers">
1252
1253 <span class="subtitle">Methods</span>
1254
1255 <li data-name="LuCI.form.Map#append"><a href="LuCI.form.Map.html#append">append</a></li>
1256
1257 <li data-name="LuCI.form.Map#chain"><a href="LuCI.form.Map.html#chain">chain</a></li>
1258
1259 <li data-name="LuCI.form.Map#findElement"><a href="LuCI.form.Map.html#findElement">findElement</a></li>
1260
1261 <li data-name="LuCI.form.Map#findElements"><a href="LuCI.form.Map.html#findElements">findElements</a></li>
1262
1263 <li data-name="LuCI.form.Map#load"><a href="LuCI.form.Map.html#load">load</a></li>
1264
1265 <li data-name="LuCI.form.Map#lookupOption"><a href="LuCI.form.Map.html#lookupOption">lookupOption</a></li>
1266
1267 <li data-name="LuCI.form.Map#parse"><a href="LuCI.form.Map.html#parse">parse</a></li>
1268
1269 <li data-name="LuCI.form.Map#render"><a href="LuCI.form.Map.html#render">render</a></li>
1270
1271 <li data-name="LuCI.form.Map#reset"><a href="LuCI.form.Map.html#reset">reset</a></li>
1272
1273 <li data-name="LuCI.form.Map#save"><a href="LuCI.form.Map.html#save">save</a></li>
1274
1275 <li data-name="LuCI.form.Map#section"><a href="LuCI.form.Map.html#section">section</a></li>
1276
1277 <li data-name="LuCI.form.Map#stripTags"><a href="LuCI.form.Map.html#stripTags">stripTags</a></li>
1278
1279 <li data-name="LuCI.form.Map#titleFn"><a href="LuCI.form.Map.html#titleFn">titleFn</a></li>
1280
1281 </ul>
1282 <ul class="events itemMembers">
1283
1284 </ul>
1285 </li>
1286
1287 <li class="item" data-name="LuCI.form.MultiValue">
1288 <span class="title">
1289 <a href="LuCI.form.MultiValue.html">LuCI.form.MultiValue</a>
1290
1291 </span>
1292 <ul class="members itemMembers">
1293
1294 <span class="subtitle">Members</span>
1295
1296 <li data-name="LuCI.form.MultiValue##display_size"><a href="LuCI.form.MultiValue.html#display_size">display_size</a></li>
1297
1298 <li data-name="LuCI.form.MultiValue##dropdown_size"><a href="LuCI.form.MultiValue.html#dropdown_size">dropdown_size</a></li>
1299
1300 <li data-name="LuCI.form.MultiValue#datatype"><a href="LuCI.form.MultiValue.html#datatype">datatype</a></li>
1301
1302 <li data-name="LuCI.form.MultiValue#default"><a href="LuCI.form.MultiValue.html#default">default</a></li>
1303
1304 <li data-name="LuCI.form.MultiValue#editable"><a href="LuCI.form.MultiValue.html#editable">editable</a></li>
1305
1306 <li data-name="LuCI.form.MultiValue#modalonly"><a href="LuCI.form.MultiValue.html#modalonly">modalonly</a></li>
1307
1308 <li data-name="LuCI.form.MultiValue#onchange"><a href="LuCI.form.MultiValue.html#onchange">onchange</a></li>
1309
1310 <li data-name="LuCI.form.MultiValue#optional"><a href="LuCI.form.MultiValue.html#optional">optional</a></li>
1311
1312 <li data-name="LuCI.form.MultiValue#password"><a href="LuCI.form.MultiValue.html#password">password</a></li>
1313
1314 <li data-name="LuCI.form.MultiValue#placeholder"><a href="LuCI.form.MultiValue.html#placeholder">placeholder</a></li>
1315
1316 <li data-name="LuCI.form.MultiValue#readonly"><a href="LuCI.form.MultiValue.html#readonly">readonly</a></li>
1317
1318 <li data-name="LuCI.form.MultiValue#retain"><a href="LuCI.form.MultiValue.html#retain">retain</a></li>
1319
1320 <li data-name="LuCI.form.MultiValue#rmempty"><a href="LuCI.form.MultiValue.html#rmempty">rmempty</a></li>
1321
1322 <li data-name="LuCI.form.MultiValue#uciconfig"><a href="LuCI.form.MultiValue.html#uciconfig">uciconfig</a></li>
1323
1324 <li data-name="LuCI.form.MultiValue#ucioption"><a href="LuCI.form.MultiValue.html#ucioption">ucioption</a></li>
1325
1326 <li data-name="LuCI.form.MultiValue#ucisection"><a href="LuCI.form.MultiValue.html#ucisection">ucisection</a></li>
1327
1328 <li data-name="LuCI.form.MultiValue#validate"><a href="LuCI.form.MultiValue.html#validate">validate</a></li>
1329
1330 <li data-name="LuCI.form.MultiValue#width"><a href="LuCI.form.MultiValue.html#width">width</a></li>
1331
1332 </ul>
1333 <ul class="typedefs itemMembers">
1334
1335 </ul>
1336 <ul class="typedefs itemMembers">
1337
1338 </ul>
1339 <ul class="methods itemMembers">
1340
1341 <span class="subtitle">Methods</span>
1342
1343 <li data-name="LuCI.form.MultiValue#append"><a href="LuCI.form.MultiValue.html#append">append</a></li>
1344
1345 <li data-name="LuCI.form.MultiValue#cbid"><a href="LuCI.form.MultiValue.html#cbid">cbid</a></li>
1346
1347 <li data-name="LuCI.form.MultiValue#cfgvalue"><a href="LuCI.form.MultiValue.html#cfgvalue">cfgvalue</a></li>
1348
1349 <li data-name="LuCI.form.MultiValue#depends"><a href="LuCI.form.MultiValue.html#depends">depends</a></li>
1350
1351 <li data-name="LuCI.form.MultiValue#formvalue"><a href="LuCI.form.MultiValue.html#formvalue">formvalue</a></li>
1352
1353 <li data-name="LuCI.form.MultiValue#getUIElement"><a href="LuCI.form.MultiValue.html#getUIElement">getUIElement</a></li>
1354
1355 <li data-name="LuCI.form.MultiValue#getValidationError"><a href="LuCI.form.MultiValue.html#getValidationError">getValidationError</a></li>
1356
1357 <li data-name="LuCI.form.MultiValue#isActive"><a href="LuCI.form.MultiValue.html#isActive">isActive</a></li>
1358
1359 <li data-name="LuCI.form.MultiValue#isValid"><a href="LuCI.form.MultiValue.html#isValid">isValid</a></li>
1360
1361 <li data-name="LuCI.form.MultiValue#load"><a href="LuCI.form.MultiValue.html#load">load</a></li>
1362
1363 <li data-name="LuCI.form.MultiValue#parse"><a href="LuCI.form.MultiValue.html#parse">parse</a></li>
1364
1365 <li data-name="LuCI.form.MultiValue#remove"><a href="LuCI.form.MultiValue.html#remove">remove</a></li>
1366
1367 <li data-name="LuCI.form.MultiValue#stripTags"><a href="LuCI.form.MultiValue.html#stripTags">stripTags</a></li>
1368
1369 <li data-name="LuCI.form.MultiValue#textvalue"><a href="LuCI.form.MultiValue.html#textvalue">textvalue</a></li>
1370
1371 <li data-name="LuCI.form.MultiValue#titleFn"><a href="LuCI.form.MultiValue.html#titleFn">titleFn</a></li>
1372
1373 <li data-name="LuCI.form.MultiValue#value"><a href="LuCI.form.MultiValue.html#value">value</a></li>
1374
1375 <li data-name="LuCI.form.MultiValue#write"><a href="LuCI.form.MultiValue.html#write">write</a></li>
1376
1377 </ul>
1378 <ul class="events itemMembers">
1379
1380 </ul>
1381 </li>
1382
1383 <li class="item" data-name="LuCI.form.NamedSection">
1384 <span class="title">
1385 <a href="LuCI.form.NamedSection.html">LuCI.form.NamedSection</a>
1386
1387 </span>
1388 <ul class="members itemMembers">
1389
1390 <span class="subtitle">Members</span>
1391
1392 <li data-name="LuCI.form.NamedSection##addremove"><a href="LuCI.form.NamedSection.html#addremove">addremove</a></li>
1393
1394 <li data-name="LuCI.form.NamedSection##uciconfig"><a href="LuCI.form.NamedSection.html#uciconfig">uciconfig</a></li>
1395
1396 <li data-name="LuCI.form.NamedSection#parentoption"><a href="LuCI.form.NamedSection.html#parentoption">parentoption</a></li>
1397
1398 </ul>
1399 <ul class="typedefs itemMembers">
1400
1401 </ul>
1402 <ul class="typedefs itemMembers">
1403
1404 </ul>
1405 <ul class="methods itemMembers">
1406
1407 <span class="subtitle">Methods</span>
1408
1409 <li data-name="LuCI.form.NamedSection#append"><a href="LuCI.form.NamedSection.html#append">append</a></li>
1410
1411 <li data-name="LuCI.form.NamedSection#cfgsections"><a href="LuCI.form.NamedSection.html#cfgsections">cfgsections</a></li>
1412
1413 <li data-name="LuCI.form.NamedSection#cfgvalue"><a href="LuCI.form.NamedSection.html#cfgvalue">cfgvalue</a></li>
1414
1415 <li data-name="LuCI.form.NamedSection#filter"><a href="LuCI.form.NamedSection.html#filter">filter</a></li>
1416
1417 <li data-name="LuCI.form.NamedSection#formvalue"><a href="LuCI.form.NamedSection.html#formvalue">formvalue</a></li>
1418
1419 <li data-name="LuCI.form.NamedSection#getOption"><a href="LuCI.form.NamedSection.html#getOption">getOption</a></li>
1420
1421 <li data-name="LuCI.form.NamedSection#getUIElement"><a href="LuCI.form.NamedSection.html#getUIElement">getUIElement</a></li>
1422
1423 <li data-name="LuCI.form.NamedSection#load"><a href="LuCI.form.NamedSection.html#load">load</a></li>
1424
1425 <li data-name="LuCI.form.NamedSection#option"><a href="LuCI.form.NamedSection.html#option">option</a></li>
1426
1427 <li data-name="LuCI.form.NamedSection#parse"><a href="LuCI.form.NamedSection.html#parse">parse</a></li>
1428
1429 <li data-name="LuCI.form.NamedSection#render"><a href="LuCI.form.NamedSection.html#render">render</a></li>
1430
1431 <li data-name="LuCI.form.NamedSection#stripTags"><a href="LuCI.form.NamedSection.html#stripTags">stripTags</a></li>
1432
1433 <li data-name="LuCI.form.NamedSection#tab"><a href="LuCI.form.NamedSection.html#tab">tab</a></li>
1434
1435 <li data-name="LuCI.form.NamedSection#taboption"><a href="LuCI.form.NamedSection.html#taboption">taboption</a></li>
1436
1437 <li data-name="LuCI.form.NamedSection#titleFn"><a href="LuCI.form.NamedSection.html#titleFn">titleFn</a></li>
1438
1439 </ul>
1440 <ul class="events itemMembers">
1441
1442 </ul>
1443 </li>
1444
1445 <li class="item" data-name="LuCI.form.SectionValue">
1446 <span class="title">
1447 <a href="LuCI.form.SectionValue.html">LuCI.form.SectionValue</a>
1448
1449 </span>
1450 <ul class="members itemMembers">
1451
1452 <span class="subtitle">Members</span>
1453
1454 <li data-name="LuCI.form.SectionValue##subsection"><a href="LuCI.form.SectionValue.html#subsection">subsection</a></li>
1455
1456 <li data-name="LuCI.form.SectionValue#datatype"><a href="LuCI.form.SectionValue.html#datatype">datatype</a></li>
1457
1458 <li data-name="LuCI.form.SectionValue#default"><a href="LuCI.form.SectionValue.html#default">default</a></li>
1459
1460 <li data-name="LuCI.form.SectionValue#editable"><a href="LuCI.form.SectionValue.html#editable">editable</a></li>
1461
1462 <li data-name="LuCI.form.SectionValue#modalonly"><a href="LuCI.form.SectionValue.html#modalonly">modalonly</a></li>
1463
1464 <li data-name="LuCI.form.SectionValue#onchange"><a href="LuCI.form.SectionValue.html#onchange">onchange</a></li>
1465
1466 <li data-name="LuCI.form.SectionValue#optional"><a href="LuCI.form.SectionValue.html#optional">optional</a></li>
1467
1468 <li data-name="LuCI.form.SectionValue#password"><a href="LuCI.form.SectionValue.html#password">password</a></li>
1469
1470 <li data-name="LuCI.form.SectionValue#placeholder"><a href="LuCI.form.SectionValue.html#placeholder">placeholder</a></li>
1471
1472 <li data-name="LuCI.form.SectionValue#readonly"><a href="LuCI.form.SectionValue.html#readonly">readonly</a></li>
1473
1474 <li data-name="LuCI.form.SectionValue#retain"><a href="LuCI.form.SectionValue.html#retain">retain</a></li>
1475
1476 <li data-name="LuCI.form.SectionValue#rmempty"><a href="LuCI.form.SectionValue.html#rmempty">rmempty</a></li>
1477
1478 <li data-name="LuCI.form.SectionValue#uciconfig"><a href="LuCI.form.SectionValue.html#uciconfig">uciconfig</a></li>
1479
1480 <li data-name="LuCI.form.SectionValue#ucioption"><a href="LuCI.form.SectionValue.html#ucioption">ucioption</a></li>
1481
1482 <li data-name="LuCI.form.SectionValue#ucisection"><a href="LuCI.form.SectionValue.html#ucisection">ucisection</a></li>
1483
1484 <li data-name="LuCI.form.SectionValue#validate"><a href="LuCI.form.SectionValue.html#validate">validate</a></li>
1485
1486 <li data-name="LuCI.form.SectionValue#width"><a href="LuCI.form.SectionValue.html#width">width</a></li>
1487
1488 </ul>
1489 <ul class="typedefs itemMembers">
1490
1491 </ul>
1492 <ul class="typedefs itemMembers">
1493
1494 </ul>
1495 <ul class="methods itemMembers">
1496
1497 <span class="subtitle">Methods</span>
1498
1499 <li data-name="LuCI.form.SectionValue#append"><a href="LuCI.form.SectionValue.html#append">append</a></li>
1500
1501 <li data-name="LuCI.form.SectionValue#cbid"><a href="LuCI.form.SectionValue.html#cbid">cbid</a></li>
1502
1503 <li data-name="LuCI.form.SectionValue#cfgvalue"><a href="LuCI.form.SectionValue.html#cfgvalue">cfgvalue</a></li>
1504
1505 <li data-name="LuCI.form.SectionValue#depends"><a href="LuCI.form.SectionValue.html#depends">depends</a></li>
1506
1507 <li data-name="LuCI.form.SectionValue#formvalue"><a href="LuCI.form.SectionValue.html#formvalue">formvalue</a></li>
1508
1509 <li data-name="LuCI.form.SectionValue#getUIElement"><a href="LuCI.form.SectionValue.html#getUIElement">getUIElement</a></li>
1510
1511 <li data-name="LuCI.form.SectionValue#getValidationError"><a href="LuCI.form.SectionValue.html#getValidationError">getValidationError</a></li>
1512
1513 <li data-name="LuCI.form.SectionValue#isActive"><a href="LuCI.form.SectionValue.html#isActive">isActive</a></li>
1514
1515 <li data-name="LuCI.form.SectionValue#isValid"><a href="LuCI.form.SectionValue.html#isValid">isValid</a></li>
1516
1517 <li data-name="LuCI.form.SectionValue#load"><a href="LuCI.form.SectionValue.html#load">load</a></li>
1518
1519 <li data-name="LuCI.form.SectionValue#parse"><a href="LuCI.form.SectionValue.html#parse">parse</a></li>
1520
1521 <li data-name="LuCI.form.SectionValue#remove"><a href="LuCI.form.SectionValue.html#remove">remove</a></li>
1522
1523 <li data-name="LuCI.form.SectionValue#stripTags"><a href="LuCI.form.SectionValue.html#stripTags">stripTags</a></li>
1524
1525 <li data-name="LuCI.form.SectionValue#textvalue"><a href="LuCI.form.SectionValue.html#textvalue">textvalue</a></li>
1526
1527 <li data-name="LuCI.form.SectionValue#titleFn"><a href="LuCI.form.SectionValue.html#titleFn">titleFn</a></li>
1528
1529 <li data-name="LuCI.form.SectionValue#value"><a href="LuCI.form.SectionValue.html#value">value</a></li>
1530
1531 <li data-name="LuCI.form.SectionValue#write"><a href="LuCI.form.SectionValue.html#write">write</a></li>
1532
1533 </ul>
1534 <ul class="events itemMembers">
1535
1536 </ul>
1537 </li>
1538
1539 <li class="item" data-name="LuCI.form.TableSection">
1540 <span class="title">
1541 <a href="LuCI.form.TableSection.html">LuCI.form.TableSection</a>
1542
1543 </span>
1544 <ul class="members itemMembers">
1545
1546 <span class="subtitle">Members</span>
1547
1548 <li data-name="LuCI.form.TableSection##addbtntitle"><a href="LuCI.form.TableSection.html#addbtntitle">addbtntitle</a></li>
1549
1550 <li data-name="LuCI.form.TableSection##addremove"><a href="LuCI.form.TableSection.html#addremove">addremove</a></li>
1551
1552 <li data-name="LuCI.form.TableSection##anonymous"><a href="LuCI.form.TableSection.html#anonymous">anonymous</a></li>
1553
1554 <li data-name="LuCI.form.TableSection##extedit"><a href="LuCI.form.TableSection.html#extedit">extedit</a></li>
1555
1556 <li data-name="LuCI.form.TableSection##max_cols"><a href="LuCI.form.TableSection.html#max_cols">max_cols</a></li>
1557
1558 <li data-name="LuCI.form.TableSection##modaltitle"><a href="LuCI.form.TableSection.html#modaltitle">modaltitle</a></li>
1559
1560 <li data-name="LuCI.form.TableSection##nodescriptions"><a href="LuCI.form.TableSection.html#nodescriptions">nodescriptions</a></li>
1561
1562 <li data-name="LuCI.form.TableSection##rowcolors"><a href="LuCI.form.TableSection.html#rowcolors">rowcolors</a></li>
1563
1564 <li data-name="LuCI.form.TableSection##sectiontitle"><a href="LuCI.form.TableSection.html#sectiontitle">sectiontitle</a></li>
1565
1566 <li data-name="LuCI.form.TableSection##sortable"><a href="LuCI.form.TableSection.html#sortable">sortable</a></li>
1567
1568 <li data-name="LuCI.form.TableSection##uciconfig"><a href="LuCI.form.TableSection.html#uciconfig">uciconfig</a></li>
1569
1570 <li data-name="LuCI.form.TableSection#addbtntitle"><a href="LuCI.form.TableSection.html#addbtntitle">addbtntitle</a></li>
1571
1572 <li data-name="LuCI.form.TableSection#addremove"><a href="LuCI.form.TableSection.html#addremove">addremove</a></li>
1573
1574 <li data-name="LuCI.form.TableSection#anonymous"><a href="LuCI.form.TableSection.html#anonymous">anonymous</a></li>
1575
1576 <li data-name="LuCI.form.TableSection#parentoption"><a href="LuCI.form.TableSection.html#parentoption">parentoption</a></li>
1577
1578 <li data-name="LuCI.form.TableSection#tabbed"><a href="LuCI.form.TableSection.html#tabbed">tabbed</a></li>
1579
1580 <li data-name="LuCI.form.TableSection#tooltip"><a href="LuCI.form.TableSection.html#tooltip">tooltip</a></li>
1581
1582 <li data-name="LuCI.form.TableSection#tooltipicon"><a href="LuCI.form.TableSection.html#tooltipicon">tooltipicon</a></li>
1583
1584 <li data-name="LuCI.form.TableSection#uciconfig"><a href="LuCI.form.TableSection.html#uciconfig">uciconfig</a></li>
1585
1586 </ul>
1587 <ul class="typedefs itemMembers">
1588
1589 </ul>
1590 <ul class="typedefs itemMembers">
1591
1592 </ul>
1593 <ul class="methods itemMembers">
1594
1595 <span class="subtitle">Methods</span>
1596
1597 <li data-name="LuCI.form.TableSection#addModalOptions"><a href="LuCI.form.TableSection.html#addModalOptions">addModalOptions</a></li>
1598
1599 <li data-name="LuCI.form.TableSection#append"><a href="LuCI.form.TableSection.html#append">append</a></li>
1600
1601 <li data-name="LuCI.form.TableSection#cfgvalue"><a href="LuCI.form.TableSection.html#cfgvalue">cfgvalue</a></li>
1602
1603 <li data-name="LuCI.form.TableSection#filter"><a href="LuCI.form.TableSection.html#filter">filter</a></li>
1604
1605 <li data-name="LuCI.form.TableSection#formvalue"><a href="LuCI.form.TableSection.html#formvalue">formvalue</a></li>
1606
1607 <li data-name="LuCI.form.TableSection#getOption"><a href="LuCI.form.TableSection.html#getOption">getOption</a></li>
1608
1609 <li data-name="LuCI.form.TableSection#getUIElement"><a href="LuCI.form.TableSection.html#getUIElement">getUIElement</a></li>
1610
1611 <li data-name="LuCI.form.TableSection#load"><a href="LuCI.form.TableSection.html#load">load</a></li>
1612
1613 <li data-name="LuCI.form.TableSection#option"><a href="LuCI.form.TableSection.html#option">option</a></li>
1614
1615 <li data-name="LuCI.form.TableSection#parse"><a href="LuCI.form.TableSection.html#parse">parse</a></li>
1616
1617 <li data-name="LuCI.form.TableSection#stripTags"><a href="LuCI.form.TableSection.html#stripTags">stripTags</a></li>
1618
1619 <li data-name="LuCI.form.TableSection#tab"><a href="LuCI.form.TableSection.html#tab">tab</a></li>
1620
1621 <li data-name="LuCI.form.TableSection#taboption"><a href="LuCI.form.TableSection.html#taboption">taboption</a></li>
1622
1623 <li data-name="LuCI.form.TableSection#titleFn"><a href="LuCI.form.TableSection.html#titleFn">titleFn</a></li>
1624
1625 </ul>
1626 <ul class="events itemMembers">
1627
1628 </ul>
1629 </li>
1630
1631 <li class="item" data-name="LuCI.form.TextValue">
1632 <span class="title">
1633 <a href="LuCI.form.TextValue.html">LuCI.form.TextValue</a>
1634
1635 </span>
1636 <ul class="members itemMembers">
1637
1638 <span class="subtitle">Members</span>
1639
1640 <li data-name="LuCI.form.TextValue##cols"><a href="LuCI.form.TextValue.html#cols">cols</a></li>
1641
1642 <li data-name="LuCI.form.TextValue##monospace"><a href="LuCI.form.TextValue.html#monospace">monospace</a></li>
1643
1644 <li data-name="LuCI.form.TextValue##rows"><a href="LuCI.form.TextValue.html#rows">rows</a></li>
1645
1646 <li data-name="LuCI.form.TextValue##wrap"><a href="LuCI.form.TextValue.html#wrap">wrap</a></li>
1647
1648 <li data-name="LuCI.form.TextValue#datatype"><a href="LuCI.form.TextValue.html#datatype">datatype</a></li>
1649
1650 <li data-name="LuCI.form.TextValue#default"><a href="LuCI.form.TextValue.html#default">default</a></li>
1651
1652 <li data-name="LuCI.form.TextValue#editable"><a href="LuCI.form.TextValue.html#editable">editable</a></li>
1653
1654 <li data-name="LuCI.form.TextValue#modalonly"><a href="LuCI.form.TextValue.html#modalonly">modalonly</a></li>
1655
1656 <li data-name="LuCI.form.TextValue#onchange"><a href="LuCI.form.TextValue.html#onchange">onchange</a></li>
1657
1658 <li data-name="LuCI.form.TextValue#optional"><a href="LuCI.form.TextValue.html#optional">optional</a></li>
1659
1660 <li data-name="LuCI.form.TextValue#password"><a href="LuCI.form.TextValue.html#password">password</a></li>
1661
1662 <li data-name="LuCI.form.TextValue#placeholder"><a href="LuCI.form.TextValue.html#placeholder">placeholder</a></li>
1663
1664 <li data-name="LuCI.form.TextValue#readonly"><a href="LuCI.form.TextValue.html#readonly">readonly</a></li>
1665
1666 <li data-name="LuCI.form.TextValue#retain"><a href="LuCI.form.TextValue.html#retain">retain</a></li>
1667
1668 <li data-name="LuCI.form.TextValue#rmempty"><a href="LuCI.form.TextValue.html#rmempty">rmempty</a></li>
1669
1670 <li data-name="LuCI.form.TextValue#uciconfig"><a href="LuCI.form.TextValue.html#uciconfig">uciconfig</a></li>
1671
1672 <li data-name="LuCI.form.TextValue#ucioption"><a href="LuCI.form.TextValue.html#ucioption">ucioption</a></li>
1673
1674 <li data-name="LuCI.form.TextValue#ucisection"><a href="LuCI.form.TextValue.html#ucisection">ucisection</a></li>
1675
1676 <li data-name="LuCI.form.TextValue#validate"><a href="LuCI.form.TextValue.html#validate">validate</a></li>
1677
1678 <li data-name="LuCI.form.TextValue#width"><a href="LuCI.form.TextValue.html#width">width</a></li>
1679
1680 </ul>
1681 <ul class="typedefs itemMembers">
1682
1683 </ul>
1684 <ul class="typedefs itemMembers">
1685
1686 </ul>
1687 <ul class="methods itemMembers">
1688
1689 <span class="subtitle">Methods</span>
1690
1691 <li data-name="LuCI.form.TextValue#append"><a href="LuCI.form.TextValue.html#append">append</a></li>
1692
1693 <li data-name="LuCI.form.TextValue#cbid"><a href="LuCI.form.TextValue.html#cbid">cbid</a></li>
1694
1695 <li data-name="LuCI.form.TextValue#cfgvalue"><a href="LuCI.form.TextValue.html#cfgvalue">cfgvalue</a></li>
1696
1697 <li data-name="LuCI.form.TextValue#depends"><a href="LuCI.form.TextValue.html#depends">depends</a></li>
1698
1699 <li data-name="LuCI.form.TextValue#formvalue"><a href="LuCI.form.TextValue.html#formvalue">formvalue</a></li>
1700
1701 <li data-name="LuCI.form.TextValue#getUIElement"><a href="LuCI.form.TextValue.html#getUIElement">getUIElement</a></li>
1702
1703 <li data-name="LuCI.form.TextValue#getValidationError"><a href="LuCI.form.TextValue.html#getValidationError">getValidationError</a></li>
1704
1705 <li data-name="LuCI.form.TextValue#isActive"><a href="LuCI.form.TextValue.html#isActive">isActive</a></li>
1706
1707 <li data-name="LuCI.form.TextValue#isValid"><a href="LuCI.form.TextValue.html#isValid">isValid</a></li>
1708
1709 <li data-name="LuCI.form.TextValue#load"><a href="LuCI.form.TextValue.html#load">load</a></li>
1710
1711 <li data-name="LuCI.form.TextValue#parse"><a href="LuCI.form.TextValue.html#parse">parse</a></li>
1712
1713 <li data-name="LuCI.form.TextValue#remove"><a href="LuCI.form.TextValue.html#remove">remove</a></li>
1714
1715 <li data-name="LuCI.form.TextValue#stripTags"><a href="LuCI.form.TextValue.html#stripTags">stripTags</a></li>
1716
1717 <li data-name="LuCI.form.TextValue#textvalue"><a href="LuCI.form.TextValue.html#textvalue">textvalue</a></li>
1718
1719 <li data-name="LuCI.form.TextValue#titleFn"><a href="LuCI.form.TextValue.html#titleFn">titleFn</a></li>
1720
1721 <li data-name="LuCI.form.TextValue#write"><a href="LuCI.form.TextValue.html#write">write</a></li>
1722
1723 </ul>
1724 <ul class="events itemMembers">
1725
1726 </ul>
1727 </li>
1728
1729 <li class="item" data-name="LuCI.form.TypedSection">
1730 <span class="title">
1731 <a href="LuCI.form.TypedSection.html">LuCI.form.TypedSection</a>
1732
1733 </span>
1734 <ul class="members itemMembers">
1735
1736 <span class="subtitle">Members</span>
1737
1738 <li data-name="LuCI.form.TypedSection##addbtntitle"><a href="LuCI.form.TypedSection.html#addbtntitle">addbtntitle</a></li>
1739
1740 <li data-name="LuCI.form.TypedSection##addremove"><a href="LuCI.form.TypedSection.html#addremove">addremove</a></li>
1741
1742 <li data-name="LuCI.form.TypedSection##anonymous"><a href="LuCI.form.TypedSection.html#anonymous">anonymous</a></li>
1743
1744 <li data-name="LuCI.form.TypedSection##tabbed"><a href="LuCI.form.TypedSection.html#tabbed">tabbed</a></li>
1745
1746 <li data-name="LuCI.form.TypedSection##tooltip"><a href="LuCI.form.TypedSection.html#tooltip">tooltip</a></li>
1747
1748 <li data-name="LuCI.form.TypedSection##tooltipicon"><a href="LuCI.form.TypedSection.html#tooltipicon">tooltipicon</a></li>
1749
1750 <li data-name="LuCI.form.TypedSection##uciconfig"><a href="LuCI.form.TypedSection.html#uciconfig">uciconfig</a></li>
1751
1752 <li data-name="LuCI.form.TypedSection#parentoption"><a href="LuCI.form.TypedSection.html#parentoption">parentoption</a></li>
1753
1754 </ul>
1755 <ul class="typedefs itemMembers">
1756
1757 </ul>
1758 <ul class="typedefs itemMembers">
1759
1760 </ul>
1761 <ul class="methods itemMembers">
1762
1763 <span class="subtitle">Methods</span>
1764
1765 <li data-name="LuCI.form.TypedSection#append"><a href="LuCI.form.TypedSection.html#append">append</a></li>
1766
1767 <li data-name="LuCI.form.TypedSection#cfgsections"><a href="LuCI.form.TypedSection.html#cfgsections">cfgsections</a></li>
1768
1769 <li data-name="LuCI.form.TypedSection#cfgvalue"><a href="LuCI.form.TypedSection.html#cfgvalue">cfgvalue</a></li>
1770
1771 <li data-name="LuCI.form.TypedSection#filter"><a href="LuCI.form.TypedSection.html#filter">filter</a></li>
1772
1773 <li data-name="LuCI.form.TypedSection#formvalue"><a href="LuCI.form.TypedSection.html#formvalue">formvalue</a></li>
1774
1775 <li data-name="LuCI.form.TypedSection#getOption"><a href="LuCI.form.TypedSection.html#getOption">getOption</a></li>
1776
1777 <li data-name="LuCI.form.TypedSection#getUIElement"><a href="LuCI.form.TypedSection.html#getUIElement">getUIElement</a></li>
1778
1779 <li data-name="LuCI.form.TypedSection#load"><a href="LuCI.form.TypedSection.html#load">load</a></li>
1780
1781 <li data-name="LuCI.form.TypedSection#option"><a href="LuCI.form.TypedSection.html#option">option</a></li>
1782
1783 <li data-name="LuCI.form.TypedSection#parse"><a href="LuCI.form.TypedSection.html#parse">parse</a></li>
1784
1785 <li data-name="LuCI.form.TypedSection#render"><a href="LuCI.form.TypedSection.html#render">render</a></li>
1786
1787 <li data-name="LuCI.form.TypedSection#stripTags"><a href="LuCI.form.TypedSection.html#stripTags">stripTags</a></li>
1788
1789 <li data-name="LuCI.form.TypedSection#tab"><a href="LuCI.form.TypedSection.html#tab">tab</a></li>
1790
1791 <li data-name="LuCI.form.TypedSection#taboption"><a href="LuCI.form.TypedSection.html#taboption">taboption</a></li>
1792
1793 <li data-name="LuCI.form.TypedSection#titleFn"><a href="LuCI.form.TypedSection.html#titleFn">titleFn</a></li>
1794
1795 </ul>
1796 <ul class="events itemMembers">
1797
1798 </ul>
1799 </li>
1800
1801 <li class="item" data-name="LuCI.form.Value">
1802 <span class="title">
1803 <a href="LuCI.form.Value.html">LuCI.form.Value</a>
1804
1805 </span>
1806 <ul class="members itemMembers">
1807
1808 <span class="subtitle">Members</span>
1809
1810 <li data-name="LuCI.form.Value##password"><a href="LuCI.form.Value.html#password">password</a></li>
1811
1812 <li data-name="LuCI.form.Value##placeholder"><a href="LuCI.form.Value.html#placeholder">placeholder</a></li>
1813
1814 <li data-name="LuCI.form.Value#datatype"><a href="LuCI.form.Value.html#datatype">datatype</a></li>
1815
1816 <li data-name="LuCI.form.Value#default"><a href="LuCI.form.Value.html#default">default</a></li>
1817
1818 <li data-name="LuCI.form.Value#editable"><a href="LuCI.form.Value.html#editable">editable</a></li>
1819
1820 <li data-name="LuCI.form.Value#modalonly"><a href="LuCI.form.Value.html#modalonly">modalonly</a></li>
1821
1822 <li data-name="LuCI.form.Value#onchange"><a href="LuCI.form.Value.html#onchange">onchange</a></li>
1823
1824 <li data-name="LuCI.form.Value#optional"><a href="LuCI.form.Value.html#optional">optional</a></li>
1825
1826 <li data-name="LuCI.form.Value#readonly"><a href="LuCI.form.Value.html#readonly">readonly</a></li>
1827
1828 <li data-name="LuCI.form.Value#retain"><a href="LuCI.form.Value.html#retain">retain</a></li>
1829
1830 <li data-name="LuCI.form.Value#rmempty"><a href="LuCI.form.Value.html#rmempty">rmempty</a></li>
1831
1832 <li data-name="LuCI.form.Value#uciconfig"><a href="LuCI.form.Value.html#uciconfig">uciconfig</a></li>
1833
1834 <li data-name="LuCI.form.Value#ucioption"><a href="LuCI.form.Value.html#ucioption">ucioption</a></li>
1835
1836 <li data-name="LuCI.form.Value#ucisection"><a href="LuCI.form.Value.html#ucisection">ucisection</a></li>
1837
1838 <li data-name="LuCI.form.Value#validate"><a href="LuCI.form.Value.html#validate">validate</a></li>
1839
1840 <li data-name="LuCI.form.Value#width"><a href="LuCI.form.Value.html#width">width</a></li>
1841
1842 </ul>
1843 <ul class="typedefs itemMembers">
1844
1845 </ul>
1846 <ul class="typedefs itemMembers">
1847
1848 </ul>
1849 <ul class="methods itemMembers">
1850
1851 <span class="subtitle">Methods</span>
1852
1853 <li data-name="LuCI.form.Value#append"><a href="LuCI.form.Value.html#append">append</a></li>
1854
1855 <li data-name="LuCI.form.Value#cbid"><a href="LuCI.form.Value.html#cbid">cbid</a></li>
1856
1857 <li data-name="LuCI.form.Value#cfgvalue"><a href="LuCI.form.Value.html#cfgvalue">cfgvalue</a></li>
1858
1859 <li data-name="LuCI.form.Value#depends"><a href="LuCI.form.Value.html#depends">depends</a></li>
1860
1861 <li data-name="LuCI.form.Value#formvalue"><a href="LuCI.form.Value.html#formvalue">formvalue</a></li>
1862
1863 <li data-name="LuCI.form.Value#getUIElement"><a href="LuCI.form.Value.html#getUIElement">getUIElement</a></li>
1864
1865 <li data-name="LuCI.form.Value#getValidationError"><a href="LuCI.form.Value.html#getValidationError">getValidationError</a></li>
1866
1867 <li data-name="LuCI.form.Value#isActive"><a href="LuCI.form.Value.html#isActive">isActive</a></li>
1868
1869 <li data-name="LuCI.form.Value#isValid"><a href="LuCI.form.Value.html#isValid">isValid</a></li>
1870
1871 <li data-name="LuCI.form.Value#load"><a href="LuCI.form.Value.html#load">load</a></li>
1872
1873 <li data-name="LuCI.form.Value#parse"><a href="LuCI.form.Value.html#parse">parse</a></li>
1874
1875 <li data-name="LuCI.form.Value#remove"><a href="LuCI.form.Value.html#remove">remove</a></li>
1876
1877 <li data-name="LuCI.form.Value#render"><a href="LuCI.form.Value.html#render">render</a></li>
1878
1879 <li data-name="LuCI.form.Value#stripTags"><a href="LuCI.form.Value.html#stripTags">stripTags</a></li>
1880
1881 <li data-name="LuCI.form.Value#textvalue"><a href="LuCI.form.Value.html#textvalue">textvalue</a></li>
1882
1883 <li data-name="LuCI.form.Value#titleFn"><a href="LuCI.form.Value.html#titleFn">titleFn</a></li>
1884
1885 <li data-name="LuCI.form.Value#value"><a href="LuCI.form.Value.html#value">value</a></li>
1886
1887 <li data-name="LuCI.form.Value#write"><a href="LuCI.form.Value.html#write">write</a></li>
1888
1889 </ul>
1890 <ul class="events itemMembers">
1891
1892 </ul>
1893 </li>
1894
1895 <li class="item" data-name="LuCI.fs">
1896 <span class="title">
1897 <a href="LuCI.fs.html">LuCI.fs</a>
1898
1899 </span>
1900 <ul class="members itemMembers">
1901
1902 </ul>
1903 <ul class="typedefs itemMembers">
1904
1905 <span class="subtitle">Typedefs</span>
1906
1907 <li data-name="LuCI.fs.FileExecResult"><a href="LuCI.fs.html#.FileExecResult">FileExecResult</a></li>
1908
1909 <li data-name="LuCI.fs.FileStatEntry"><a href="LuCI.fs.html#.FileStatEntry">FileStatEntry</a></li>
1910
1911 </ul>
1912 <ul class="typedefs itemMembers">
1913
1914 </ul>
1915 <ul class="methods itemMembers">
1916
1917 <span class="subtitle">Methods</span>
1918
1919 <li data-name="LuCI.fs#exec"><a href="LuCI.fs.html#exec">exec</a></li>
1920
1921 <li data-name="LuCI.fs#exec_direct"><a href="LuCI.fs.html#exec_direct">exec_direct</a></li>
1922
1923 <li data-name="LuCI.fs#lines"><a href="LuCI.fs.html#lines">lines</a></li>
1924
1925 <li data-name="LuCI.fs#list"><a href="LuCI.fs.html#list">list</a></li>
1926
1927 <li data-name="LuCI.fs#read"><a href="LuCI.fs.html#read">read</a></li>
1928
1929 <li data-name="LuCI.fs#read_direct"><a href="LuCI.fs.html#read_direct">read_direct</a></li>
1930
1931 <li data-name="LuCI.fs#remove"><a href="LuCI.fs.html#remove">remove</a></li>
1932
1933 <li data-name="LuCI.fs#stat"><a href="LuCI.fs.html#stat">stat</a></li>
1934
1935 <li data-name="LuCI.fs#trimmed"><a href="LuCI.fs.html#trimmed">trimmed</a></li>
1936
1937 <li data-name="LuCI.fs#write"><a href="LuCI.fs.html#write">write</a></li>
1938
1939 </ul>
1940 <ul class="events itemMembers">
1941
1942 </ul>
1943 </li>
1944
1945 <li class="item" data-name="LuCI.headers">
1946 <span class="title">
1947 <a href="LuCI.headers.html">LuCI.headers</a>
1948
1949 </span>
1950 <ul class="members itemMembers">
1951
1952 </ul>
1953 <ul class="typedefs itemMembers">
1954
1955 </ul>
1956 <ul class="typedefs itemMembers">
1957
1958 </ul>
1959 <ul class="methods itemMembers">
1960
1961 <span class="subtitle">Methods</span>
1962
1963 <li data-name="LuCI.headers#get"><a href="LuCI.headers.html#get">get</a></li>
1964
1965 <li data-name="LuCI.headers#has"><a href="LuCI.headers.html#has">has</a></li>
1966
1967 </ul>
1968 <ul class="events itemMembers">
1969
1970 </ul>
1971 </li>
1972
1973 <li class="item" data-name="LuCI.network">
1974 <span class="title">
1975 <a href="LuCI.network.html">LuCI.network</a>
1976
1977 </span>
1978 <ul class="members itemMembers">
1979
1980 </ul>
1981 <ul class="typedefs itemMembers">
1982
1983 <span class="subtitle">Typedefs</span>
1984
1985 <li data-name="LuCI.network.SwitchTopology"><a href="LuCI.network.html#.SwitchTopology">SwitchTopology</a></li>
1986
1987 <li data-name="LuCI.network.WifiEncryption"><a href="LuCI.network.html#.WifiEncryption">WifiEncryption</a></li>
1988
1989 <li data-name="LuCI.network.WifiPeerEntry"><a href="LuCI.network.html#.WifiPeerEntry">WifiPeerEntry</a></li>
1990
1991 <li data-name="LuCI.network.WifiRateEntry"><a href="LuCI.network.html#.WifiRateEntry">WifiRateEntry</a></li>
1992
1993 <li data-name="LuCI.network.WifiScanResult"><a href="LuCI.network.html#.WifiScanResult">WifiScanResult</a></li>
1994
1995 </ul>
1996 <ul class="typedefs itemMembers">
1997
1998 </ul>
1999 <ul class="methods itemMembers">
2000
2001 <span class="subtitle">Methods</span>
2002
2003 <li data-name="LuCI.network#addNetwork"><a href="LuCI.network.html#addNetwork">addNetwork</a></li>
2004
2005 <li data-name="LuCI.network#addWifiNetwork"><a href="LuCI.network.html#addWifiNetwork">addWifiNetwork</a></li>
2006
2007 <li data-name="LuCI.network#deleteNetwork"><a href="LuCI.network.html#deleteNetwork">deleteNetwork</a></li>
2008
2009 <li data-name="LuCI.network#deleteWifiNetwork"><a href="LuCI.network.html#deleteWifiNetwork">deleteWifiNetwork</a></li>
2010
2011 <li data-name="LuCI.network#flushCache"><a href="LuCI.network.html#flushCache">flushCache</a></li>
2012
2013 <li data-name="LuCI.network#formatWifiEncryption"><a href="LuCI.network.html#formatWifiEncryption">formatWifiEncryption</a></li>
2014
2015 <li data-name="LuCI.network#getDevice"><a href="LuCI.network.html#getDevice">getDevice</a></li>
2016
2017 <li data-name="LuCI.network#getDevices"><a href="LuCI.network.html#getDevices">getDevices</a></li>
2018
2019 <li data-name="LuCI.network#getDSLModemType"><a href="LuCI.network.html#getDSLModemType">getDSLModemType</a></li>
2020
2021 <li data-name="LuCI.network#getHostHints"><a href="LuCI.network.html#getHostHints">getHostHints</a></li>
2022
2023 <li data-name="LuCI.network#getIfnameOf"><a href="LuCI.network.html#getIfnameOf">getIfnameOf</a></li>
2024
2025 <li data-name="LuCI.network#getNetwork"><a href="LuCI.network.html#getNetwork">getNetwork</a></li>
2026
2027 <li data-name="LuCI.network#getNetworks"><a href="LuCI.network.html#getNetworks">getNetworks</a></li>
2028
2029 <li data-name="LuCI.network#getProtocol"><a href="LuCI.network.html#getProtocol">getProtocol</a></li>
2030
2031 <li data-name="LuCI.network#getProtocols"><a href="LuCI.network.html#getProtocols">getProtocols</a></li>
2032
2033 <li data-name="LuCI.network#getSwitchTopologies"><a href="LuCI.network.html#getSwitchTopologies">getSwitchTopologies</a></li>
2034
2035 <li data-name="LuCI.network#getWAN6Networks"><a href="LuCI.network.html#getWAN6Networks">getWAN6Networks</a></li>
2036
2037 <li data-name="LuCI.network#getWANNetworks"><a href="LuCI.network.html#getWANNetworks">getWANNetworks</a></li>
2038
2039 <li data-name="LuCI.network#getWifiDevice"><a href="LuCI.network.html#getWifiDevice">getWifiDevice</a></li>
2040
2041 <li data-name="LuCI.network#getWifiDevices"><a href="LuCI.network.html#getWifiDevices">getWifiDevices</a></li>
2042
2043 <li data-name="LuCI.network#getWifiNetwork"><a href="LuCI.network.html#getWifiNetwork">getWifiNetwork</a></li>
2044
2045 <li data-name="LuCI.network#getWifiNetworks"><a href="LuCI.network.html#getWifiNetworks">getWifiNetworks</a></li>
2046
2047 <li data-name="LuCI.network#isIgnoredDevice"><a href="LuCI.network.html#isIgnoredDevice">isIgnoredDevice</a></li>
2048
2049 <li data-name="LuCI.network#maskToPrefix"><a href="LuCI.network.html#maskToPrefix">maskToPrefix</a></li>
2050
2051 <li data-name="LuCI.network#prefixToMask"><a href="LuCI.network.html#prefixToMask">prefixToMask</a></li>
2052
2053 <li data-name="LuCI.network#registerErrorCode"><a href="LuCI.network.html#registerErrorCode">registerErrorCode</a></li>
2054
2055 <li data-name="LuCI.network#registerPatternVirtual"><a href="LuCI.network.html#registerPatternVirtual">registerPatternVirtual</a></li>
2056
2057 <li data-name="LuCI.network#registerProtocol"><a href="LuCI.network.html#registerProtocol">registerProtocol</a></li>
2058
2059 <li data-name="LuCI.network#renameNetwork"><a href="LuCI.network.html#renameNetwork">renameNetwork</a></li>
2060
2061 </ul>
2062 <ul class="events itemMembers">
2063
2064 </ul>
2065 </li>
2066
2067 <li class="item" data-name="LuCI.network.Device">
2068 <span class="title">
2069 <a href="LuCI.network.Device.html">LuCI.network.Device</a>
2070
2071 </span>
2072 <ul class="members itemMembers">
2073
2074 </ul>
2075 <ul class="typedefs itemMembers">
2076
2077 </ul>
2078 <ul class="typedefs itemMembers">
2079
2080 </ul>
2081 <ul class="methods itemMembers">
2082
2083 <span class="subtitle">Methods</span>
2084
2085 <li data-name="LuCI.network.Device#getBridgeID"><a href="LuCI.network.Device.html#getBridgeID">getBridgeID</a></li>
2086
2087 <li data-name="LuCI.network.Device#getBridgeSTP"><a href="LuCI.network.Device.html#getBridgeSTP">getBridgeSTP</a></li>
2088
2089 <li data-name="LuCI.network.Device#getCarrier"><a href="LuCI.network.Device.html#getCarrier">getCarrier</a></li>
2090
2091 <li data-name="LuCI.network.Device#getDuplex"><a href="LuCI.network.Device.html#getDuplex">getDuplex</a></li>
2092
2093 <li data-name="LuCI.network.Device#getI18n"><a href="LuCI.network.Device.html#getI18n">getI18n</a></li>
2094
2095 <li data-name="LuCI.network.Device#getIP6Addrs"><a href="LuCI.network.Device.html#getIP6Addrs">getIP6Addrs</a></li>
2096
2097 <li data-name="LuCI.network.Device#getIPAddrs"><a href="LuCI.network.Device.html#getIPAddrs">getIPAddrs</a></li>
2098
2099 <li data-name="LuCI.network.Device#getMAC"><a href="LuCI.network.Device.html#getMAC">getMAC</a></li>
2100
2101 <li data-name="LuCI.network.Device#getMTU"><a href="LuCI.network.Device.html#getMTU">getMTU</a></li>
2102
2103 <li data-name="LuCI.network.Device#getName"><a href="LuCI.network.Device.html#getName">getName</a></li>
2104
2105 <li data-name="LuCI.network.Device#getNetwork"><a href="LuCI.network.Device.html#getNetwork">getNetwork</a></li>
2106
2107 <li data-name="LuCI.network.Device#getNetworks"><a href="LuCI.network.Device.html#getNetworks">getNetworks</a></li>
2108
2109 <li data-name="LuCI.network.Device#getParent"><a href="LuCI.network.Device.html#getParent">getParent</a></li>
2110
2111 <li data-name="LuCI.network.Device#getPorts"><a href="LuCI.network.Device.html#getPorts">getPorts</a></li>
2112
2113 <li data-name="LuCI.network.Device#getRXBytes"><a href="LuCI.network.Device.html#getRXBytes">getRXBytes</a></li>
2114
2115 <li data-name="LuCI.network.Device#getRXPackets"><a href="LuCI.network.Device.html#getRXPackets">getRXPackets</a></li>
2116
2117 <li data-name="LuCI.network.Device#getShortName"><a href="LuCI.network.Device.html#getShortName">getShortName</a></li>
2118
2119 <li data-name="LuCI.network.Device#getSpeed"><a href="LuCI.network.Device.html#getSpeed">getSpeed</a></li>
2120
2121 <li data-name="LuCI.network.Device#getTXBytes"><a href="LuCI.network.Device.html#getTXBytes">getTXBytes</a></li>
2122
2123 <li data-name="LuCI.network.Device#getTXPackets"><a href="LuCI.network.Device.html#getTXPackets">getTXPackets</a></li>
2124
2125 <li data-name="LuCI.network.Device#getType"><a href="LuCI.network.Device.html#getType">getType</a></li>
2126
2127 <li data-name="LuCI.network.Device#getTypeI18n"><a href="LuCI.network.Device.html#getTypeI18n">getTypeI18n</a></li>
2128
2129 <li data-name="LuCI.network.Device#getWifiNetwork"><a href="LuCI.network.Device.html#getWifiNetwork">getWifiNetwork</a></li>
2130
2131 <li data-name="LuCI.network.Device#isBridge"><a href="LuCI.network.Device.html#isBridge">isBridge</a></li>
2132
2133 <li data-name="LuCI.network.Device#isBridgePort"><a href="LuCI.network.Device.html#isBridgePort">isBridgePort</a></li>
2134
2135 <li data-name="LuCI.network.Device#isUp"><a href="LuCI.network.Device.html#isUp">isUp</a></li>
2136
2137 </ul>
2138 <ul class="events itemMembers">
2139
2140 </ul>
2141 </li>
2142
2143 <li class="item" data-name="LuCI.network.Hosts">
2144 <span class="title">
2145 <a href="LuCI.network.Hosts.html">LuCI.network.Hosts</a>
2146
2147 </span>
2148 <ul class="members itemMembers">
2149
2150 </ul>
2151 <ul class="typedefs itemMembers">
2152
2153 </ul>
2154 <ul class="typedefs itemMembers">
2155
2156 </ul>
2157 <ul class="methods itemMembers">
2158
2159 <span class="subtitle">Methods</span>
2160
2161 <li data-name="LuCI.network.Hosts#getHostnameByIP6Addr"><a href="LuCI.network.Hosts.html#getHostnameByIP6Addr">getHostnameByIP6Addr</a></li>
2162
2163 <li data-name="LuCI.network.Hosts#getHostnameByIPAddr"><a href="LuCI.network.Hosts.html#getHostnameByIPAddr">getHostnameByIPAddr</a></li>
2164
2165 <li data-name="LuCI.network.Hosts#getHostnameByMACAddr"><a href="LuCI.network.Hosts.html#getHostnameByMACAddr">getHostnameByMACAddr</a></li>
2166
2167 <li data-name="LuCI.network.Hosts#getIP6AddrByMACAddr"><a href="LuCI.network.Hosts.html#getIP6AddrByMACAddr">getIP6AddrByMACAddr</a></li>
2168
2169 <li data-name="LuCI.network.Hosts#getIPAddrByMACAddr"><a href="LuCI.network.Hosts.html#getIPAddrByMACAddr">getIPAddrByMACAddr</a></li>
2170
2171 <li data-name="LuCI.network.Hosts#getMACAddrByIP6Addr"><a href="LuCI.network.Hosts.html#getMACAddrByIP6Addr">getMACAddrByIP6Addr</a></li>
2172
2173 <li data-name="LuCI.network.Hosts#getMACAddrByIPAddr"><a href="LuCI.network.Hosts.html#getMACAddrByIPAddr">getMACAddrByIPAddr</a></li>
2174
2175 <li data-name="LuCI.network.Hosts#getMACHints"><a href="LuCI.network.Hosts.html#getMACHints">getMACHints</a></li>
2176
2177 </ul>
2178 <ul class="events itemMembers">
2179
2180 </ul>
2181 </li>
2182
2183 <li class="item" data-name="LuCI.network.Protocol">
2184 <span class="title">
2185 <a href="LuCI.network.Protocol.html">LuCI.network.Protocol</a>
2186
2187 </span>
2188 <ul class="members itemMembers">
2189
2190 </ul>
2191 <ul class="typedefs itemMembers">
2192
2193 </ul>
2194 <ul class="typedefs itemMembers">
2195
2196 </ul>
2197 <ul class="methods itemMembers">
2198
2199 <span class="subtitle">Methods</span>
2200
2201 <li data-name="LuCI.network.Protocol#addDevice"><a href="LuCI.network.Protocol.html#addDevice">addDevice</a></li>
2202
2203 <li data-name="LuCI.network.Protocol#containsDevice"><a href="LuCI.network.Protocol.html#containsDevice">containsDevice</a></li>
2204
2205 <li data-name="LuCI.network.Protocol#deleteConfiguration"><a href="LuCI.network.Protocol.html#deleteConfiguration">deleteConfiguration</a></li>
2206
2207 <li data-name="LuCI.network.Protocol#deleteDevice"><a href="LuCI.network.Protocol.html#deleteDevice">deleteDevice</a></li>
2208
2209 <li data-name="LuCI.network.Protocol#get"><a href="LuCI.network.Protocol.html#get">get</a></li>
2210
2211 <li data-name="LuCI.network.Protocol#getDevice"><a href="LuCI.network.Protocol.html#getDevice">getDevice</a></li>
2212
2213 <li data-name="LuCI.network.Protocol#getDevices"><a href="LuCI.network.Protocol.html#getDevices">getDevices</a></li>
2214
2215 <li data-name="LuCI.network.Protocol#getDNS6Addrs"><a href="LuCI.network.Protocol.html#getDNS6Addrs">getDNS6Addrs</a></li>
2216
2217 <li data-name="LuCI.network.Protocol#getDNSAddrs"><a href="LuCI.network.Protocol.html#getDNSAddrs">getDNSAddrs</a></li>
2218
2219 <li data-name="LuCI.network.Protocol#getErrors"><a href="LuCI.network.Protocol.html#getErrors">getErrors</a></li>
2220
2221 <li data-name="LuCI.network.Protocol#getExpiry"><a href="LuCI.network.Protocol.html#getExpiry">getExpiry</a></li>
2222
2223 <li data-name="LuCI.network.Protocol#getGateway6Addr"><a href="LuCI.network.Protocol.html#getGateway6Addr">getGateway6Addr</a></li>
2224
2225 <li data-name="LuCI.network.Protocol#getGatewayAddr"><a href="LuCI.network.Protocol.html#getGatewayAddr">getGatewayAddr</a></li>
2226
2227 <li data-name="LuCI.network.Protocol#getI18n"><a href="LuCI.network.Protocol.html#getI18n">getI18n</a></li>
2228
2229 <li data-name="LuCI.network.Protocol#getIfname"><a href="LuCI.network.Protocol.html#getIfname">getIfname</a></li>
2230
2231 <li data-name="LuCI.network.Protocol#getIP6Addr"><a href="LuCI.network.Protocol.html#getIP6Addr">getIP6Addr</a></li>
2232
2233 <li data-name="LuCI.network.Protocol#getIP6Addrs"><a href="LuCI.network.Protocol.html#getIP6Addrs">getIP6Addrs</a></li>
2234
2235 <li data-name="LuCI.network.Protocol#getIP6Prefix"><a href="LuCI.network.Protocol.html#getIP6Prefix">getIP6Prefix</a></li>
2236
2237 <li data-name="LuCI.network.Protocol#getIPAddr"><a href="LuCI.network.Protocol.html#getIPAddr">getIPAddr</a></li>
2238
2239 <li data-name="LuCI.network.Protocol#getIPAddrs"><a href="LuCI.network.Protocol.html#getIPAddrs">getIPAddrs</a></li>
2240
2241 <li data-name="LuCI.network.Protocol#getL2Device"><a href="LuCI.network.Protocol.html#getL2Device">getL2Device</a></li>
2242
2243 <li data-name="LuCI.network.Protocol#getL3Device"><a href="LuCI.network.Protocol.html#getL3Device">getL3Device</a></li>
2244
2245 <li data-name="LuCI.network.Protocol#getMetric"><a href="LuCI.network.Protocol.html#getMetric">getMetric</a></li>
2246
2247 <li data-name="LuCI.network.Protocol#getName"><a href="LuCI.network.Protocol.html#getName">getName</a></li>
2248
2249 <li data-name="LuCI.network.Protocol#getNetmask"><a href="LuCI.network.Protocol.html#getNetmask">getNetmask</a></li>
2250
2251 <li data-name="LuCI.network.Protocol#getOpkgPackage"><a href="LuCI.network.Protocol.html#getOpkgPackage">getOpkgPackage</a></li>
2252
2253 <li data-name="LuCI.network.Protocol#getProtocol"><a href="LuCI.network.Protocol.html#getProtocol">getProtocol</a></li>
2254
2255 <li data-name="LuCI.network.Protocol#getType"><a href="LuCI.network.Protocol.html#getType">getType</a></li>
2256
2257 <li data-name="LuCI.network.Protocol#getUptime"><a href="LuCI.network.Protocol.html#getUptime">getUptime</a></li>
2258
2259 <li data-name="LuCI.network.Protocol#getZoneName"><a href="LuCI.network.Protocol.html#getZoneName">getZoneName</a></li>
2260
2261 <li data-name="LuCI.network.Protocol#isAlias"><a href="LuCI.network.Protocol.html#isAlias">isAlias</a></li>
2262
2263 <li data-name="LuCI.network.Protocol#isBridge"><a href="LuCI.network.Protocol.html#isBridge">isBridge</a></li>
2264
2265 <li data-name="LuCI.network.Protocol#isCreateable"><a href="LuCI.network.Protocol.html#isCreateable">isCreateable</a></li>
2266
2267 <li data-name="LuCI.network.Protocol#isDynamic"><a href="LuCI.network.Protocol.html#isDynamic">isDynamic</a></li>
2268
2269 <li data-name="LuCI.network.Protocol#isEmpty"><a href="LuCI.network.Protocol.html#isEmpty">isEmpty</a></li>
2270
2271 <li data-name="LuCI.network.Protocol#isFloating"><a href="LuCI.network.Protocol.html#isFloating">isFloating</a></li>
2272
2273 <li data-name="LuCI.network.Protocol#isInstalled"><a href="LuCI.network.Protocol.html#isInstalled">isInstalled</a></li>
2274
2275 <li data-name="LuCI.network.Protocol#isUp"><a href="LuCI.network.Protocol.html#isUp">isUp</a></li>
2276
2277 <li data-name="LuCI.network.Protocol#isVirtual"><a href="LuCI.network.Protocol.html#isVirtual">isVirtual</a></li>
2278
2279 <li data-name="LuCI.network.Protocol#set"><a href="LuCI.network.Protocol.html#set">set</a></li>
2280
2281 </ul>
2282 <ul class="events itemMembers">
2283
2284 </ul>
2285 </li>
2286
2287 <li class="item" data-name="LuCI.network.WifiDevice">
2288 <span class="title">
2289 <a href="LuCI.network.WifiDevice.html">LuCI.network.WifiDevice</a>
2290
2291 </span>
2292 <ul class="members itemMembers">
2293
2294 </ul>
2295 <ul class="typedefs itemMembers">
2296
2297 </ul>
2298 <ul class="typedefs itemMembers">
2299
2300 </ul>
2301 <ul class="methods itemMembers">
2302
2303 <span class="subtitle">Methods</span>
2304
2305 <li data-name="LuCI.network.WifiDevice#addWifiNetwork"><a href="LuCI.network.WifiDevice.html#addWifiNetwork">addWifiNetwork</a></li>
2306
2307 <li data-name="LuCI.network.WifiDevice#deleteWifiNetwork"><a href="LuCI.network.WifiDevice.html#deleteWifiNetwork">deleteWifiNetwork</a></li>
2308
2309 <li data-name="LuCI.network.WifiDevice#get"><a href="LuCI.network.WifiDevice.html#get">get</a></li>
2310
2311 <li data-name="LuCI.network.WifiDevice#getHTModes"><a href="LuCI.network.WifiDevice.html#getHTModes">getHTModes</a></li>
2312
2313 <li data-name="LuCI.network.WifiDevice#getHWModes"><a href="LuCI.network.WifiDevice.html#getHWModes">getHWModes</a></li>
2314
2315 <li data-name="LuCI.network.WifiDevice#getI18n"><a href="LuCI.network.WifiDevice.html#getI18n">getI18n</a></li>
2316
2317 <li data-name="LuCI.network.WifiDevice#getName"><a href="LuCI.network.WifiDevice.html#getName">getName</a></li>
2318
2319 <li data-name="LuCI.network.WifiDevice#getScanList"><a href="LuCI.network.WifiDevice.html#getScanList">getScanList</a></li>
2320
2321 <li data-name="LuCI.network.WifiDevice#getWifiNetwork"><a href="LuCI.network.WifiDevice.html#getWifiNetwork">getWifiNetwork</a></li>
2322
2323 <li data-name="LuCI.network.WifiDevice#getWifiNetworks"><a href="LuCI.network.WifiDevice.html#getWifiNetworks">getWifiNetworks</a></li>
2324
2325 <li data-name="LuCI.network.WifiDevice#isDisabled"><a href="LuCI.network.WifiDevice.html#isDisabled">isDisabled</a></li>
2326
2327 <li data-name="LuCI.network.WifiDevice#isUp"><a href="LuCI.network.WifiDevice.html#isUp">isUp</a></li>
2328
2329 <li data-name="LuCI.network.WifiDevice#set"><a href="LuCI.network.WifiDevice.html#set">set</a></li>
2330
2331 </ul>
2332 <ul class="events itemMembers">
2333
2334 </ul>
2335 </li>
2336
2337 <li class="item" data-name="LuCI.network.WifiNetwork">
2338 <span class="title">
2339 <a href="LuCI.network.WifiNetwork.html">LuCI.network.WifiNetwork</a>
2340
2341 </span>
2342 <ul class="members itemMembers">
2343
2344 </ul>
2345 <ul class="typedefs itemMembers">
2346
2347 </ul>
2348 <ul class="typedefs itemMembers">
2349
2350 </ul>
2351 <ul class="methods itemMembers">
2352
2353 <span class="subtitle">Methods</span>
2354
2355 <li data-name="LuCI.network.WifiNetwork#disconnectClient"><a href="LuCI.network.WifiNetwork.html#disconnectClient">disconnectClient</a></li>
2356
2357 <li data-name="LuCI.network.WifiNetwork#get"><a href="LuCI.network.WifiNetwork.html#get">get</a></li>
2358
2359 <li data-name="LuCI.network.WifiNetwork#getActiveBSSID"><a href="LuCI.network.WifiNetwork.html#getActiveBSSID">getActiveBSSID</a></li>
2360
2361 <li data-name="LuCI.network.WifiNetwork#getActiveEncryption"><a href="LuCI.network.WifiNetwork.html#getActiveEncryption">getActiveEncryption</a></li>
2362
2363 <li data-name="LuCI.network.WifiNetwork#getActiveMode"><a href="LuCI.network.WifiNetwork.html#getActiveMode">getActiveMode</a></li>
2364
2365 <li data-name="LuCI.network.WifiNetwork#getActiveModeI18n"><a href="LuCI.network.WifiNetwork.html#getActiveModeI18n">getActiveModeI18n</a></li>
2366
2367 <li data-name="LuCI.network.WifiNetwork#getActiveSSID"><a href="LuCI.network.WifiNetwork.html#getActiveSSID">getActiveSSID</a></li>
2368
2369 <li data-name="LuCI.network.WifiNetwork#getAssocList"><a href="LuCI.network.WifiNetwork.html#getAssocList">getAssocList</a></li>
2370
2371 <li data-name="LuCI.network.WifiNetwork#getBitRate"><a href="LuCI.network.WifiNetwork.html#getBitRate">getBitRate</a></li>
2372
2373 <li data-name="LuCI.network.WifiNetwork#getBSSID"><a href="LuCI.network.WifiNetwork.html#getBSSID">getBSSID</a></li>
2374
2375 <li data-name="LuCI.network.WifiNetwork#getChannel"><a href="LuCI.network.WifiNetwork.html#getChannel">getChannel</a></li>
2376
2377 <li data-name="LuCI.network.WifiNetwork#getCountryCode"><a href="LuCI.network.WifiNetwork.html#getCountryCode">getCountryCode</a></li>
2378
2379 <li data-name="LuCI.network.WifiNetwork#getDevice"><a href="LuCI.network.WifiNetwork.html#getDevice">getDevice</a></li>
2380
2381 <li data-name="LuCI.network.WifiNetwork#getFrequency"><a href="LuCI.network.WifiNetwork.html#getFrequency">getFrequency</a></li>
2382
2383 <li data-name="LuCI.network.WifiNetwork#getI18n"><a href="LuCI.network.WifiNetwork.html#getI18n">getI18n</a></li>
2384
2385 <li data-name="LuCI.network.WifiNetwork#getID"><a href="LuCI.network.WifiNetwork.html#getID">getID</a></li>
2386
2387 <li data-name="LuCI.network.WifiNetwork#getIfname"><a href="LuCI.network.WifiNetwork.html#getIfname">getIfname</a></li>
2388
2389 <li data-name="LuCI.network.WifiNetwork#getMeshID"><a href="LuCI.network.WifiNetwork.html#getMeshID">getMeshID</a></li>
2390
2391 <li data-name="LuCI.network.WifiNetwork#getMode"><a href="LuCI.network.WifiNetwork.html#getMode">getMode</a></li>
2392
2393 <li data-name="LuCI.network.WifiNetwork#getName"><a href="LuCI.network.WifiNetwork.html#getName">getName</a></li>
2394
2395 <li data-name="LuCI.network.WifiNetwork#getNetwork"><a href="LuCI.network.WifiNetwork.html#getNetwork">getNetwork</a></li>
2396
2397 <li data-name="LuCI.network.WifiNetwork#getNetworkNames"><a href="LuCI.network.WifiNetwork.html#getNetworkNames">getNetworkNames</a></li>
2398
2399 <li data-name="LuCI.network.WifiNetwork#getNetworks"><a href="LuCI.network.WifiNetwork.html#getNetworks">getNetworks</a></li>
2400
2401 <li data-name="LuCI.network.WifiNetwork#getNoise"><a href="LuCI.network.WifiNetwork.html#getNoise">getNoise</a></li>
2402
2403 <li data-name="LuCI.network.WifiNetwork#getShortName"><a href="LuCI.network.WifiNetwork.html#getShortName">getShortName</a></li>
2404
2405 <li data-name="LuCI.network.WifiNetwork#getSignal"><a href="LuCI.network.WifiNetwork.html#getSignal">getSignal</a></li>
2406
2407 <li data-name="LuCI.network.WifiNetwork#getSignalLevel"><a href="LuCI.network.WifiNetwork.html#getSignalLevel">getSignalLevel</a></li>
2408
2409 <li data-name="LuCI.network.WifiNetwork#getSignalPercent"><a href="LuCI.network.WifiNetwork.html#getSignalPercent">getSignalPercent</a></li>
2410
2411 <li data-name="LuCI.network.WifiNetwork#getSSID"><a href="LuCI.network.WifiNetwork.html#getSSID">getSSID</a></li>
2412
2413 <li data-name="LuCI.network.WifiNetwork#getTXPower"><a href="LuCI.network.WifiNetwork.html#getTXPower">getTXPower</a></li>
2414
2415 <li data-name="LuCI.network.WifiNetwork#getTXPowerOffset"><a href="LuCI.network.WifiNetwork.html#getTXPowerOffset">getTXPowerOffset</a></li>
2416
2417 <li data-name="LuCI.network.WifiNetwork#getVlanIfnames"><a href="LuCI.network.WifiNetwork.html#getVlanIfnames">getVlanIfnames</a></li>
2418
2419 <li data-name="LuCI.network.WifiNetwork#getWifiDevice"><a href="LuCI.network.WifiNetwork.html#getWifiDevice">getWifiDevice</a></li>
2420
2421 <li data-name="LuCI.network.WifiNetwork#getWifiDeviceName"><a href="LuCI.network.WifiNetwork.html#getWifiDeviceName">getWifiDeviceName</a></li>
2422
2423 <li data-name="LuCI.network.WifiNetwork#isClientDisconnectSupported"><a href="LuCI.network.WifiNetwork.html#isClientDisconnectSupported">isClientDisconnectSupported</a></li>
2424
2425 <li data-name="LuCI.network.WifiNetwork#isDisabled"><a href="LuCI.network.WifiNetwork.html#isDisabled">isDisabled</a></li>
2426
2427 <li data-name="LuCI.network.WifiNetwork#isUp"><a href="LuCI.network.WifiNetwork.html#isUp">isUp</a></li>
2428
2429 <li data-name="LuCI.network.WifiNetwork#set"><a href="LuCI.network.WifiNetwork.html#set">set</a></li>
2430
2431 </ul>
2432 <ul class="events itemMembers">
2433
2434 </ul>
2435 </li>
2436
2437 <li class="item" data-name="LuCI.poll">
2438 <span class="title">
2439 <a href="LuCI.poll.html">LuCI.poll</a>
2440
2441 </span>
2442 <ul class="members itemMembers">
2443
2444 </ul>
2445 <ul class="typedefs itemMembers">
2446
2447 </ul>
2448 <ul class="typedefs itemMembers">
2449
2450 </ul>
2451 <ul class="methods itemMembers">
2452
2453 <span class="subtitle">Methods</span>
2454
2455 <li data-name="LuCI.poll#active"><a href="LuCI.poll.html#active">active</a></li>
2456
2457 <li data-name="LuCI.poll#add"><a href="LuCI.poll.html#add">add</a></li>
2458
2459 <li data-name="LuCI.poll#remove"><a href="LuCI.poll.html#remove">remove</a></li>
2460
2461 <li data-name="LuCI.poll#start"><a href="LuCI.poll.html#start">start</a></li>
2462
2463 <li data-name="LuCI.poll#stop"><a href="LuCI.poll.html#stop">stop</a></li>
2464
2465 </ul>
2466 <ul class="events itemMembers">
2467
2468 </ul>
2469 </li>
2470
2471 <li class="item" data-name="LuCI.request">
2472 <span class="title">
2473 <a href="LuCI.request.html">LuCI.request</a>
2474
2475 </span>
2476 <ul class="members itemMembers">
2477
2478 </ul>
2479 <ul class="typedefs itemMembers">
2480
2481 <span class="subtitle">Typedefs</span>
2482
2483 <li data-name="LuCI.request.interceptorFn"><a href="LuCI.request.html#.interceptorFn">interceptorFn</a></li>
2484
2485 <li data-name="LuCI.request.RequestOptions"><a href="LuCI.request.html#.RequestOptions">RequestOptions</a></li>
2486
2487 </ul>
2488 <ul class="typedefs itemMembers">
2489
2490 </ul>
2491 <ul class="methods itemMembers">
2492
2493 <span class="subtitle">Methods</span>
2494
2495 <li data-name="LuCI.request#addInterceptor"><a href="LuCI.request.html#addInterceptor">addInterceptor</a></li>
2496
2497 <li data-name="LuCI.request#expandURL"><a href="LuCI.request.html#expandURL">expandURL</a></li>
2498
2499 <li data-name="LuCI.request#get"><a href="LuCI.request.html#get">get</a></li>
2500
2501 <li data-name="LuCI.request#post"><a href="LuCI.request.html#post">post</a></li>
2502
2503 <li data-name="LuCI.request#removeInterceptor"><a href="LuCI.request.html#removeInterceptor">removeInterceptor</a></li>
2504
2505 <li data-name="LuCI.request#request"><a href="LuCI.request.html#request">request</a></li>
2506
2507 </ul>
2508 <ul class="events itemMembers">
2509
2510 </ul>
2511 </li>
2512
2513 <li class="item" data-name="LuCI.request.poll">
2514 <span class="title">
2515 <a href="LuCI.request.poll.html">LuCI.request.poll</a>
2516
2517 </span>
2518 <ul class="members itemMembers">
2519
2520 </ul>
2521 <ul class="typedefs itemMembers">
2522
2523 <span class="subtitle">Typedefs</span>
2524
2525 <li data-name="LuCI.request.poll~callbackFn"><a href="LuCI.request.poll.html#~callbackFn">callbackFn</a></li>
2526
2527 </ul>
2528 <ul class="typedefs itemMembers">
2529
2530 </ul>
2531 <ul class="methods itemMembers">
2532
2533 <span class="subtitle">Methods</span>
2534
2535 <li data-name="LuCI.request.poll#active"><a href="LuCI.request.poll.html#active">active</a></li>
2536
2537 <li data-name="LuCI.request.poll#add"><a href="LuCI.request.poll.html#add">add</a></li>
2538
2539 <li data-name="LuCI.request.poll#remove"><a href="LuCI.request.poll.html#remove">remove</a></li>
2540
2541 <li data-name="LuCI.request.poll#start"><a href="LuCI.request.poll.html#start">start</a></li>
2542
2543 <li data-name="LuCI.request.poll#stop"><a href="LuCI.request.poll.html#stop">stop</a></li>
2544
2545 </ul>
2546 <ul class="events itemMembers">
2547
2548 </ul>
2549 </li>
2550
2551 <li class="item" data-name="LuCI.response">
2552 <span class="title">
2553 <a href="LuCI.response.html">LuCI.response</a>
2554
2555 </span>
2556 <ul class="members itemMembers">
2557
2558 <span class="subtitle">Members</span>
2559
2560 <li data-name="LuCI.response#duration"><a href="LuCI.response.html#duration">duration</a></li>
2561
2562 <li data-name="LuCI.response#headers"><a href="LuCI.response.html#headers">headers</a></li>
2563
2564 <li data-name="LuCI.response#ok"><a href="LuCI.response.html#ok">ok</a></li>
2565
2566 <li data-name="LuCI.response#status"><a href="LuCI.response.html#status">status</a></li>
2567
2568 <li data-name="LuCI.response#statusText"><a href="LuCI.response.html#statusText">statusText</a></li>
2569
2570 <li data-name="LuCI.response#url"><a href="LuCI.response.html#url">url</a></li>
2571
2572 </ul>
2573 <ul class="typedefs itemMembers">
2574
2575 </ul>
2576 <ul class="typedefs itemMembers">
2577
2578 </ul>
2579 <ul class="methods itemMembers">
2580
2581 <span class="subtitle">Methods</span>
2582
2583 <li data-name="LuCI.response#blob"><a href="LuCI.response.html#blob">blob</a></li>
2584
2585 <li data-name="LuCI.response#clone"><a href="LuCI.response.html#clone">clone</a></li>
2586
2587 <li data-name="LuCI.response#json"><a href="LuCI.response.html#json">json</a></li>
2588
2589 <li data-name="LuCI.response#text"><a href="LuCI.response.html#text">text</a></li>
2590
2591 </ul>
2592 <ul class="events itemMembers">
2593
2594 </ul>
2595 </li>
2596
2597 <li class="item" data-name="LuCI.rpc">
2598 <span class="title">
2599 <a href="LuCI.rpc.html">LuCI.rpc</a>
2600
2601 </span>
2602 <ul class="members itemMembers">
2603
2604 </ul>
2605 <ul class="typedefs itemMembers">
2606
2607 <span class="subtitle">Typedefs</span>
2608
2609 <li data-name="LuCI.rpc.DeclareOptions"><a href="LuCI.rpc.html#.DeclareOptions">DeclareOptions</a></li>
2610
2611 <li data-name="LuCI.rpc~filterFn"><a href="LuCI.rpc.html#~filterFn">filterFn</a></li>
2612
2613 <li data-name="LuCI.rpc~interceptorFn"><a href="LuCI.rpc.html#~interceptorFn">interceptorFn</a></li>
2614
2615 <li data-name="LuCI.rpc~invokeFn"><a href="LuCI.rpc.html#~invokeFn">invokeFn</a></li>
2616
2617 </ul>
2618 <ul class="typedefs itemMembers">
2619
2620 </ul>
2621 <ul class="methods itemMembers">
2622
2623 <span class="subtitle">Methods</span>
2624
2625 <li data-name="LuCI.rpc#addInterceptor"><a href="LuCI.rpc.html#addInterceptor">addInterceptor</a></li>
2626
2627 <li data-name="LuCI.rpc#declare"><a href="LuCI.rpc.html#declare">declare</a></li>
2628
2629 <li data-name="LuCI.rpc#getBaseURL"><a href="LuCI.rpc.html#getBaseURL">getBaseURL</a></li>
2630
2631 <li data-name="LuCI.rpc#getSessionID"><a href="LuCI.rpc.html#getSessionID">getSessionID</a></li>
2632
2633 <li data-name="LuCI.rpc#getStatusText"><a href="LuCI.rpc.html#getStatusText">getStatusText</a></li>
2634
2635 <li data-name="LuCI.rpc#list"><a href="LuCI.rpc.html#list">list</a></li>
2636
2637 <li data-name="LuCI.rpc#removeInterceptor"><a href="LuCI.rpc.html#removeInterceptor">removeInterceptor</a></li>
2638
2639 <li data-name="LuCI.rpc#setBaseURL"><a href="LuCI.rpc.html#setBaseURL">setBaseURL</a></li>
2640
2641 <li data-name="LuCI.rpc#setSessionID"><a href="LuCI.rpc.html#setSessionID">setSessionID</a></li>
2642
2643 </ul>
2644 <ul class="events itemMembers">
2645
2646 </ul>
2647 </li>
2648
2649 <li class="item" data-name="LuCI.session">
2650 <span class="title">
2651 <a href="LuCI.session.html">LuCI.session</a>
2652
2653 </span>
2654 <ul class="members itemMembers">
2655
2656 </ul>
2657 <ul class="typedefs itemMembers">
2658
2659 </ul>
2660 <ul class="typedefs itemMembers">
2661
2662 </ul>
2663 <ul class="methods itemMembers">
2664
2665 <span class="subtitle">Methods</span>
2666
2667 <li data-name="LuCI.session#getID"><a href="LuCI.session.html#getID">getID</a></li>
2668
2669 <li data-name="LuCI.session#getLocalData"><a href="LuCI.session.html#getLocalData">getLocalData</a></li>
2670
2671 <li data-name="LuCI.session#getToken"><a href="LuCI.session.html#getToken">getToken</a></li>
2672
2673 <li data-name="LuCI.session#setLocalData"><a href="LuCI.session.html#setLocalData">setLocalData</a></li>
2674
2675 </ul>
2676 <ul class="events itemMembers">
2677
2678 </ul>
2679 </li>
2680
2681 <li class="item" data-name="LuCI.uci">
2682 <span class="title">
2683 <a href="LuCI.uci.html">LuCI.uci</a>
2684
2685 </span>
2686 <ul class="members itemMembers">
2687
2688 </ul>
2689 <ul class="typedefs itemMembers">
2690
2691 <span class="subtitle">Typedefs</span>
2692
2693 <li data-name="LuCI.uci.ChangeRecord"><a href="LuCI.uci.html#.ChangeRecord">ChangeRecord</a></li>
2694
2695 <li data-name="LuCI.uci.SectionObject"><a href="LuCI.uci.html#.SectionObject">SectionObject</a></li>
2696
2697 <li data-name="LuCI.uci~sectionsFn"><a href="LuCI.uci.html#~sectionsFn">sectionsFn</a></li>
2698
2699 </ul>
2700 <ul class="typedefs itemMembers">
2701
2702 </ul>
2703 <ul class="methods itemMembers">
2704
2705 <span class="subtitle">Methods</span>
2706
2707 <li data-name="LuCI.uci#add"><a href="LuCI.uci.html#add">add</a></li>
2708
2709 <li data-name="LuCI.uci#apply"><a href="LuCI.uci.html#apply">apply</a></li>
2710
2711 <li data-name="LuCI.uci#changes"><a href="LuCI.uci.html#changes">changes</a></li>
2712
2713 <li data-name="LuCI.uci#createSID"><a href="LuCI.uci.html#createSID">createSID</a></li>
2714
2715 <li data-name="LuCI.uci#get"><a href="LuCI.uci.html#get">get</a></li>
2716
2717 <li data-name="LuCI.uci#get_first"><a href="LuCI.uci.html#get_first">get_first</a></li>
2718
2719 <li data-name="LuCI.uci#load"><a href="LuCI.uci.html#load">load</a></li>
2720
2721 <li data-name="LuCI.uci#move"><a href="LuCI.uci.html#move">move</a></li>
2722
2723 <li data-name="LuCI.uci#remove"><a href="LuCI.uci.html#remove">remove</a></li>
2724
2725 <li data-name="LuCI.uci#resolveSID"><a href="LuCI.uci.html#resolveSID">resolveSID</a></li>
2726
2727 <li data-name="LuCI.uci#save"><a href="LuCI.uci.html#save">save</a></li>
2728
2729 <li data-name="LuCI.uci#sections"><a href="LuCI.uci.html#sections">sections</a></li>
2730
2731 <li data-name="LuCI.uci#set"><a href="LuCI.uci.html#set">set</a></li>
2732
2733 <li data-name="LuCI.uci#set_first"><a href="LuCI.uci.html#set_first">set_first</a></li>
2734
2735 <li data-name="LuCI.uci#unload"><a href="LuCI.uci.html#unload">unload</a></li>
2736
2737 <li data-name="LuCI.uci#unset"><a href="LuCI.uci.html#unset">unset</a></li>
2738
2739 <li data-name="LuCI.uci#unset_first"><a href="LuCI.uci.html#unset_first">unset_first</a></li>
2740
2741 </ul>
2742 <ul class="events itemMembers">
2743
2744 </ul>
2745 </li>
2746
2747 <li class="item" data-name="LuCI.ui">
2748 <span class="title">
2749 <a href="LuCI.ui.html">LuCI.ui</a>
2750
2751 </span>
2752 <ul class="members itemMembers">
2753
2754 </ul>
2755 <ul class="typedefs itemMembers">
2756
2757 <span class="subtitle">Typedefs</span>
2758
2759 <li data-name="LuCI.ui.FileUploadReply"><a href="LuCI.ui.html#.FileUploadReply">FileUploadReply</a></li>
2760
2761 </ul>
2762 <ul class="typedefs itemMembers">
2763
2764 </ul>
2765 <ul class="methods itemMembers">
2766
2767 <span class="subtitle">Methods</span>
2768
2769 <li data-name="LuCI.ui#addNotification"><a href="LuCI.ui.html#addNotification">addNotification</a></li>
2770
2771 <li data-name="LuCI.ui#addValidator"><a href="LuCI.ui.html#addValidator">addValidator</a></li>
2772
2773 <li data-name="LuCI.ui#awaitReconnect"><a href="LuCI.ui.html#awaitReconnect">awaitReconnect</a></li>
2774
2775 <li data-name="LuCI.ui#createHandlerFn"><a href="LuCI.ui.html#createHandlerFn">createHandlerFn</a></li>
2776
2777 <li data-name="LuCI.ui#hideIndicator"><a href="LuCI.ui.html#hideIndicator">hideIndicator</a></li>
2778
2779 <li data-name="LuCI.ui#hideModal"><a href="LuCI.ui.html#hideModal">hideModal</a></li>
2780
2781 <li data-name="LuCI.ui#instantiateView"><a href="LuCI.ui.html#instantiateView">instantiateView</a></li>
2782
2783 <li data-name="LuCI.ui#itemlist"><a href="LuCI.ui.html#itemlist">itemlist</a></li>
2784
2785 <li data-name="LuCI.ui#pingDevice"><a href="LuCI.ui.html#pingDevice">pingDevice</a></li>
2786
2787 <li data-name="LuCI.ui#showIndicator"><a href="LuCI.ui.html#showIndicator">showIndicator</a></li>
2788
2789 <li data-name="LuCI.ui#showModal"><a href="LuCI.ui.html#showModal">showModal</a></li>
2790
2791 <li data-name="LuCI.ui#uploadFile"><a href="LuCI.ui.html#uploadFile">uploadFile</a></li>
2792
2793 </ul>
2794 <ul class="events itemMembers">
2795
2796 </ul>
2797 </li>
2798
2799 <li class="item" data-name="LuCI.ui.AbstractElement">
2800 <span class="title">
2801 <a href="LuCI.ui.AbstractElement.html">LuCI.ui.AbstractElement</a>
2802
2803 </span>
2804 <ul class="members itemMembers">
2805
2806 </ul>
2807 <ul class="typedefs itemMembers">
2808
2809 <span class="subtitle">Typedefs</span>
2810
2811 <li data-name="LuCI.ui.AbstractElement.InitOptions"><a href="LuCI.ui.AbstractElement.html#.InitOptions">InitOptions</a></li>
2812
2813 </ul>
2814 <ul class="typedefs itemMembers">
2815
2816 </ul>
2817 <ul class="methods itemMembers">
2818
2819 <span class="subtitle">Methods</span>
2820
2821 <li data-name="LuCI.ui.AbstractElement#getValidationError"><a href="LuCI.ui.AbstractElement.html#getValidationError">getValidationError</a></li>
2822
2823 <li data-name="LuCI.ui.AbstractElement#getValue"><a href="LuCI.ui.AbstractElement.html#getValue">getValue</a></li>
2824
2825 <li data-name="LuCI.ui.AbstractElement#isChanged"><a href="LuCI.ui.AbstractElement.html#isChanged">isChanged</a></li>
2826
2827 <li data-name="LuCI.ui.AbstractElement#isValid"><a href="LuCI.ui.AbstractElement.html#isValid">isValid</a></li>
2828
2829 <li data-name="LuCI.ui.AbstractElement#registerEvents"><a href="LuCI.ui.AbstractElement.html#registerEvents">registerEvents</a></li>
2830
2831 <li data-name="LuCI.ui.AbstractElement#render"><a href="LuCI.ui.AbstractElement.html#render">render</a></li>
2832
2833 <li data-name="LuCI.ui.AbstractElement#setChangeEvents"><a href="LuCI.ui.AbstractElement.html#setChangeEvents">setChangeEvents</a></li>
2834
2835 <li data-name="LuCI.ui.AbstractElement#setPlaceholder"><a href="LuCI.ui.AbstractElement.html#setPlaceholder">setPlaceholder</a></li>
2836
2837 <li data-name="LuCI.ui.AbstractElement#setUpdateEvents"><a href="LuCI.ui.AbstractElement.html#setUpdateEvents">setUpdateEvents</a></li>
2838
2839 <li data-name="LuCI.ui.AbstractElement#setValue"><a href="LuCI.ui.AbstractElement.html#setValue">setValue</a></li>
2840
2841 <li data-name="LuCI.ui.AbstractElement#triggerValidation"><a href="LuCI.ui.AbstractElement.html#triggerValidation">triggerValidation</a></li>
2842
2843 </ul>
2844 <ul class="events itemMembers">
2845
2846 </ul>
2847 </li>
2848
2849 <li class="item" data-name="LuCI.ui.changes">
2850 <span class="title">
2851 <a href="LuCI.ui.changes.html">LuCI.ui.changes</a>
2852
2853 </span>
2854 <ul class="members itemMembers">
2855
2856 </ul>
2857 <ul class="typedefs itemMembers">
2858
2859 </ul>
2860 <ul class="typedefs itemMembers">
2861
2862 </ul>
2863 <ul class="methods itemMembers">
2864
2865 <span class="subtitle">Methods</span>
2866
2867 <li data-name="LuCI.ui.changes#apply"><a href="LuCI.ui.changes.html#apply">apply</a></li>
2868
2869 <li data-name="LuCI.ui.changes#displayChanges"><a href="LuCI.ui.changes.html#displayChanges">displayChanges</a></li>
2870
2871 <li data-name="LuCI.ui.changes#renderChangeIndicator"><a href="LuCI.ui.changes.html#renderChangeIndicator">renderChangeIndicator</a></li>
2872
2873 <li data-name="LuCI.ui.changes#revert"><a href="LuCI.ui.changes.html#revert">revert</a></li>
2874
2875 <li data-name="LuCI.ui.changes#setIndicator"><a href="LuCI.ui.changes.html#setIndicator">setIndicator</a></li>
2876
2877 </ul>
2878 <ul class="events itemMembers">
2879
2880 </ul>
2881 </li>
2882
2883 <li class="item" data-name="LuCI.ui.Checkbox">
2884 <span class="title">
2885 <a href="LuCI.ui.Checkbox.html">LuCI.ui.Checkbox</a>
2886
2887 </span>
2888 <ul class="members itemMembers">
2889
2890 </ul>
2891 <ul class="typedefs itemMembers">
2892
2893 <span class="subtitle">Typedefs</span>
2894
2895 <li data-name="LuCI.ui.Checkbox.InitOptions"><a href="LuCI.ui.Checkbox.html#.InitOptions">InitOptions</a></li>
2896
2897 </ul>
2898 <ul class="typedefs itemMembers">
2899
2900 </ul>
2901 <ul class="methods itemMembers">
2902
2903 <span class="subtitle">Methods</span>
2904
2905 <li data-name="LuCI.ui.Checkbox#getValidationError"><a href="LuCI.ui.Checkbox.html#getValidationError">getValidationError</a></li>
2906
2907 <li data-name="LuCI.ui.Checkbox#getValue"><a href="LuCI.ui.Checkbox.html#getValue">getValue</a></li>
2908
2909 <li data-name="LuCI.ui.Checkbox#isChanged"><a href="LuCI.ui.Checkbox.html#isChanged">isChanged</a></li>
2910
2911 <li data-name="LuCI.ui.Checkbox#isChecked"><a href="LuCI.ui.Checkbox.html#isChecked">isChecked</a></li>
2912
2913 <li data-name="LuCI.ui.Checkbox#isValid"><a href="LuCI.ui.Checkbox.html#isValid">isValid</a></li>
2914
2915 <li data-name="LuCI.ui.Checkbox#registerEvents"><a href="LuCI.ui.Checkbox.html#registerEvents">registerEvents</a></li>
2916
2917 <li data-name="LuCI.ui.Checkbox#render"><a href="LuCI.ui.Checkbox.html#render">render</a></li>
2918
2919 <li data-name="LuCI.ui.Checkbox#setChangeEvents"><a href="LuCI.ui.Checkbox.html#setChangeEvents">setChangeEvents</a></li>
2920
2921 <li data-name="LuCI.ui.Checkbox#setPlaceholder"><a href="LuCI.ui.Checkbox.html#setPlaceholder">setPlaceholder</a></li>
2922
2923 <li data-name="LuCI.ui.Checkbox#setUpdateEvents"><a href="LuCI.ui.Checkbox.html#setUpdateEvents">setUpdateEvents</a></li>
2924
2925 <li data-name="LuCI.ui.Checkbox#setValue"><a href="LuCI.ui.Checkbox.html#setValue">setValue</a></li>
2926
2927 <li data-name="LuCI.ui.Checkbox#triggerValidation"><a href="LuCI.ui.Checkbox.html#triggerValidation">triggerValidation</a></li>
2928
2929 </ul>
2930 <ul class="events itemMembers">
2931
2932 </ul>
2933 </li>
2934
2935 <li class="item" data-name="LuCI.ui.Combobox">
2936 <span class="title">
2937 <a href="LuCI.ui.Combobox.html">LuCI.ui.Combobox</a>
2938
2939 </span>
2940 <ul class="members itemMembers">
2941
2942 </ul>
2943 <ul class="typedefs itemMembers">
2944
2945 <span class="subtitle">Typedefs</span>
2946
2947 <li data-name="LuCI.ui.Combobox.InitOptions"><a href="LuCI.ui.Combobox.html#.InitOptions">InitOptions</a></li>
2948
2949 </ul>
2950 <ul class="typedefs itemMembers">
2951
2952 </ul>
2953 <ul class="methods itemMembers">
2954
2955 <span class="subtitle">Methods</span>
2956
2957 <li data-name="LuCI.ui.Combobox#addChoices"><a href="LuCI.ui.Combobox.html#addChoices">addChoices</a></li>
2958
2959 <li data-name="LuCI.ui.Combobox#clearChoices"><a href="LuCI.ui.Combobox.html#clearChoices">clearChoices</a></li>
2960
2961 <li data-name="LuCI.ui.Combobox#closeAllDropdowns"><a href="LuCI.ui.Combobox.html#closeAllDropdowns">closeAllDropdowns</a></li>
2962
2963 <li data-name="LuCI.ui.Combobox#getValidationError"><a href="LuCI.ui.Combobox.html#getValidationError">getValidationError</a></li>
2964
2965 <li data-name="LuCI.ui.Combobox#isChanged"><a href="LuCI.ui.Combobox.html#isChanged">isChanged</a></li>
2966
2967 <li data-name="LuCI.ui.Combobox#isValid"><a href="LuCI.ui.Combobox.html#isValid">isValid</a></li>
2968
2969 <li data-name="LuCI.ui.Combobox#registerEvents"><a href="LuCI.ui.Combobox.html#registerEvents">registerEvents</a></li>
2970
2971 <li data-name="LuCI.ui.Combobox#setChangeEvents"><a href="LuCI.ui.Combobox.html#setChangeEvents">setChangeEvents</a></li>
2972
2973 <li data-name="LuCI.ui.Combobox#setPlaceholder"><a href="LuCI.ui.Combobox.html#setPlaceholder">setPlaceholder</a></li>
2974
2975 <li data-name="LuCI.ui.Combobox#setUpdateEvents"><a href="LuCI.ui.Combobox.html#setUpdateEvents">setUpdateEvents</a></li>
2976
2977 <li data-name="LuCI.ui.Combobox#triggerValidation"><a href="LuCI.ui.Combobox.html#triggerValidation">triggerValidation</a></li>
2978
2979 </ul>
2980 <ul class="events itemMembers">
2981
2982 </ul>
2983 </li>
2984
2985 <li class="item" data-name="LuCI.ui.ComboButton">
2986 <span class="title">
2987 <a href="LuCI.ui.ComboButton.html">LuCI.ui.ComboButton</a>
2988
2989 </span>
2990 <ul class="members itemMembers">
2991
2992 </ul>
2993 <ul class="typedefs itemMembers">
2994
2995 <span class="subtitle">Typedefs</span>
2996
2997 <li data-name="LuCI.ui.ComboButton.InitOptions"><a href="LuCI.ui.ComboButton.html#.InitOptions">InitOptions</a></li>
2998
2999 </ul>
3000 <ul class="typedefs itemMembers">
3001
3002 </ul>
3003 <ul class="methods itemMembers">
3004
3005 <span class="subtitle">Methods</span>
3006
3007 <li data-name="LuCI.ui.ComboButton#addChoices"><a href="LuCI.ui.ComboButton.html#addChoices">addChoices</a></li>
3008
3009 <li data-name="LuCI.ui.ComboButton#clearChoices"><a href="LuCI.ui.ComboButton.html#clearChoices">clearChoices</a></li>
3010
3011 <li data-name="LuCI.ui.ComboButton#closeAllDropdowns"><a href="LuCI.ui.ComboButton.html#closeAllDropdowns">closeAllDropdowns</a></li>
3012
3013 <li data-name="LuCI.ui.ComboButton#getValidationError"><a href="LuCI.ui.ComboButton.html#getValidationError">getValidationError</a></li>
3014
3015 <li data-name="LuCI.ui.ComboButton#isChanged"><a href="LuCI.ui.ComboButton.html#isChanged">isChanged</a></li>
3016
3017 <li data-name="LuCI.ui.ComboButton#isValid"><a href="LuCI.ui.ComboButton.html#isValid">isValid</a></li>
3018
3019 <li data-name="LuCI.ui.ComboButton#registerEvents"><a href="LuCI.ui.ComboButton.html#registerEvents">registerEvents</a></li>
3020
3021 <li data-name="LuCI.ui.ComboButton#setChangeEvents"><a href="LuCI.ui.ComboButton.html#setChangeEvents">setChangeEvents</a></li>
3022
3023 <li data-name="LuCI.ui.ComboButton#setPlaceholder"><a href="LuCI.ui.ComboButton.html#setPlaceholder">setPlaceholder</a></li>
3024
3025 <li data-name="LuCI.ui.ComboButton#setUpdateEvents"><a href="LuCI.ui.ComboButton.html#setUpdateEvents">setUpdateEvents</a></li>
3026
3027 <li data-name="LuCI.ui.ComboButton#triggerValidation"><a href="LuCI.ui.ComboButton.html#triggerValidation">triggerValidation</a></li>
3028
3029 </ul>
3030 <ul class="events itemMembers">
3031
3032 </ul>
3033 </li>
3034
3035 <li class="item" data-name="LuCI.ui.Dropdown">
3036 <span class="title">
3037 <a href="LuCI.ui.Dropdown.html">LuCI.ui.Dropdown</a>
3038
3039 </span>
3040 <ul class="members itemMembers">
3041
3042 </ul>
3043 <ul class="typedefs itemMembers">
3044
3045 <span class="subtitle">Typedefs</span>
3046
3047 <li data-name="LuCI.ui.Dropdown.InitOptions"><a href="LuCI.ui.Dropdown.html#.InitOptions">InitOptions</a></li>
3048
3049 </ul>
3050 <ul class="typedefs itemMembers">
3051
3052 </ul>
3053 <ul class="methods itemMembers">
3054
3055 <span class="subtitle">Methods</span>
3056
3057 <li data-name="LuCI.ui.Dropdown#addChoices"><a href="LuCI.ui.Dropdown.html#addChoices">addChoices</a></li>
3058
3059 <li data-name="LuCI.ui.Dropdown#clearChoices"><a href="LuCI.ui.Dropdown.html#clearChoices">clearChoices</a></li>
3060
3061 <li data-name="LuCI.ui.Dropdown#closeAllDropdowns"><a href="LuCI.ui.Dropdown.html#closeAllDropdowns">closeAllDropdowns</a></li>
3062
3063 <li data-name="LuCI.ui.Dropdown#getValidationError"><a href="LuCI.ui.Dropdown.html#getValidationError">getValidationError</a></li>
3064
3065 <li data-name="LuCI.ui.Dropdown#getValue"><a href="LuCI.ui.Dropdown.html#getValue">getValue</a></li>
3066
3067 <li data-name="LuCI.ui.Dropdown#isChanged"><a href="LuCI.ui.Dropdown.html#isChanged">isChanged</a></li>
3068
3069 <li data-name="LuCI.ui.Dropdown#isValid"><a href="LuCI.ui.Dropdown.html#isValid">isValid</a></li>
3070
3071 <li data-name="LuCI.ui.Dropdown#registerEvents"><a href="LuCI.ui.Dropdown.html#registerEvents">registerEvents</a></li>
3072
3073 <li data-name="LuCI.ui.Dropdown#render"><a href="LuCI.ui.Dropdown.html#render">render</a></li>
3074
3075 <li data-name="LuCI.ui.Dropdown#setChangeEvents"><a href="LuCI.ui.Dropdown.html#setChangeEvents">setChangeEvents</a></li>
3076
3077 <li data-name="LuCI.ui.Dropdown#setPlaceholder"><a href="LuCI.ui.Dropdown.html#setPlaceholder">setPlaceholder</a></li>
3078
3079 <li data-name="LuCI.ui.Dropdown#setUpdateEvents"><a href="LuCI.ui.Dropdown.html#setUpdateEvents">setUpdateEvents</a></li>
3080
3081 <li data-name="LuCI.ui.Dropdown#setValue"><a href="LuCI.ui.Dropdown.html#setValue">setValue</a></li>
3082
3083 <li data-name="LuCI.ui.Dropdown#triggerValidation"><a href="LuCI.ui.Dropdown.html#triggerValidation">triggerValidation</a></li>
3084
3085 </ul>
3086 <ul class="events itemMembers">
3087
3088 </ul>
3089 </li>
3090
3091 <li class="item" data-name="LuCI.ui.DynamicList">
3092 <span class="title">
3093 <a href="LuCI.ui.DynamicList.html">LuCI.ui.DynamicList</a>
3094
3095 </span>
3096 <ul class="members itemMembers">
3097
3098 </ul>
3099 <ul class="typedefs itemMembers">
3100
3101 <span class="subtitle">Typedefs</span>
3102
3103 <li data-name="LuCI.ui.DynamicList.InitOptions"><a href="LuCI.ui.DynamicList.html#.InitOptions">InitOptions</a></li>
3104
3105 </ul>
3106 <ul class="typedefs itemMembers">
3107
3108 </ul>
3109 <ul class="methods itemMembers">
3110
3111 <span class="subtitle">Methods</span>
3112
3113 <li data-name="LuCI.ui.DynamicList#addChoices"><a href="LuCI.ui.DynamicList.html#addChoices">addChoices</a></li>
3114
3115 <li data-name="LuCI.ui.DynamicList#clearChoices"><a href="LuCI.ui.DynamicList.html#clearChoices">clearChoices</a></li>
3116
3117 <li data-name="LuCI.ui.DynamicList#getValidationError"><a href="LuCI.ui.DynamicList.html#getValidationError">getValidationError</a></li>
3118
3119 <li data-name="LuCI.ui.DynamicList#getValue"><a href="LuCI.ui.DynamicList.html#getValue">getValue</a></li>
3120
3121 <li data-name="LuCI.ui.DynamicList#isChanged"><a href="LuCI.ui.DynamicList.html#isChanged">isChanged</a></li>
3122
3123 <li data-name="LuCI.ui.DynamicList#isValid"><a href="LuCI.ui.DynamicList.html#isValid">isValid</a></li>
3124
3125 <li data-name="LuCI.ui.DynamicList#registerEvents"><a href="LuCI.ui.DynamicList.html#registerEvents">registerEvents</a></li>
3126
3127 <li data-name="LuCI.ui.DynamicList#render"><a href="LuCI.ui.DynamicList.html#render">render</a></li>
3128
3129 <li data-name="LuCI.ui.DynamicList#setChangeEvents"><a href="LuCI.ui.DynamicList.html#setChangeEvents">setChangeEvents</a></li>
3130
3131 <li data-name="LuCI.ui.DynamicList#setPlaceholder"><a href="LuCI.ui.DynamicList.html#setPlaceholder">setPlaceholder</a></li>
3132
3133 <li data-name="LuCI.ui.DynamicList#setUpdateEvents"><a href="LuCI.ui.DynamicList.html#setUpdateEvents">setUpdateEvents</a></li>
3134
3135 <li data-name="LuCI.ui.DynamicList#setValue"><a href="LuCI.ui.DynamicList.html#setValue">setValue</a></li>
3136
3137 <li data-name="LuCI.ui.DynamicList#triggerValidation"><a href="LuCI.ui.DynamicList.html#triggerValidation">triggerValidation</a></li>
3138
3139 </ul>
3140 <ul class="events itemMembers">
3141
3142 </ul>
3143 </li>
3144
3145 <li class="item" data-name="LuCI.ui.FileUpload">
3146 <span class="title">
3147 <a href="LuCI.ui.FileUpload.html">LuCI.ui.FileUpload</a>
3148
3149 </span>
3150 <ul class="members itemMembers">
3151
3152 </ul>
3153 <ul class="typedefs itemMembers">
3154
3155 <span class="subtitle">Typedefs</span>
3156
3157 <li data-name="LuCI.ui.FileUpload.InitOptions"><a href="LuCI.ui.FileUpload.html#.InitOptions">InitOptions</a></li>
3158
3159 </ul>
3160 <ul class="typedefs itemMembers">
3161
3162 </ul>
3163 <ul class="methods itemMembers">
3164
3165 <span class="subtitle">Methods</span>
3166
3167 <li data-name="LuCI.ui.FileUpload#getValidationError"><a href="LuCI.ui.FileUpload.html#getValidationError">getValidationError</a></li>
3168
3169 <li data-name="LuCI.ui.FileUpload#getValue"><a href="LuCI.ui.FileUpload.html#getValue">getValue</a></li>
3170
3171 <li data-name="LuCI.ui.FileUpload#isChanged"><a href="LuCI.ui.FileUpload.html#isChanged">isChanged</a></li>
3172
3173 <li data-name="LuCI.ui.FileUpload#isValid"><a href="LuCI.ui.FileUpload.html#isValid">isValid</a></li>
3174
3175 <li data-name="LuCI.ui.FileUpload#registerEvents"><a href="LuCI.ui.FileUpload.html#registerEvents">registerEvents</a></li>
3176
3177 <li data-name="LuCI.ui.FileUpload#render"><a href="LuCI.ui.FileUpload.html#render">render</a></li>
3178
3179 <li data-name="LuCI.ui.FileUpload#setChangeEvents"><a href="LuCI.ui.FileUpload.html#setChangeEvents">setChangeEvents</a></li>
3180
3181 <li data-name="LuCI.ui.FileUpload#setPlaceholder"><a href="LuCI.ui.FileUpload.html#setPlaceholder">setPlaceholder</a></li>
3182
3183 <li data-name="LuCI.ui.FileUpload#setUpdateEvents"><a href="LuCI.ui.FileUpload.html#setUpdateEvents">setUpdateEvents</a></li>
3184
3185 <li data-name="LuCI.ui.FileUpload#setValue"><a href="LuCI.ui.FileUpload.html#setValue">setValue</a></li>
3186
3187 <li data-name="LuCI.ui.FileUpload#triggerValidation"><a href="LuCI.ui.FileUpload.html#triggerValidation">triggerValidation</a></li>
3188
3189 </ul>
3190 <ul class="events itemMembers">
3191
3192 </ul>
3193 </li>
3194
3195 <li class="item" data-name="LuCI.ui.Hiddenfield">
3196 <span class="title">
3197 <a href="LuCI.ui.Hiddenfield.html">LuCI.ui.Hiddenfield</a>
3198
3199 </span>
3200 <ul class="members itemMembers">
3201
3202 </ul>
3203 <ul class="typedefs itemMembers">
3204
3205 </ul>
3206 <ul class="typedefs itemMembers">
3207
3208 </ul>
3209 <ul class="methods itemMembers">
3210
3211 <span class="subtitle">Methods</span>
3212
3213 <li data-name="LuCI.ui.Hiddenfield#getValidationError"><a href="LuCI.ui.Hiddenfield.html#getValidationError">getValidationError</a></li>
3214
3215 <li data-name="LuCI.ui.Hiddenfield#getValue"><a href="LuCI.ui.Hiddenfield.html#getValue">getValue</a></li>
3216
3217 <li data-name="LuCI.ui.Hiddenfield#isChanged"><a href="LuCI.ui.Hiddenfield.html#isChanged">isChanged</a></li>
3218
3219 <li data-name="LuCI.ui.Hiddenfield#isValid"><a href="LuCI.ui.Hiddenfield.html#isValid">isValid</a></li>
3220
3221 <li data-name="LuCI.ui.Hiddenfield#registerEvents"><a href="LuCI.ui.Hiddenfield.html#registerEvents">registerEvents</a></li>
3222
3223 <li data-name="LuCI.ui.Hiddenfield#render"><a href="LuCI.ui.Hiddenfield.html#render">render</a></li>
3224
3225 <li data-name="LuCI.ui.Hiddenfield#setChangeEvents"><a href="LuCI.ui.Hiddenfield.html#setChangeEvents">setChangeEvents</a></li>
3226
3227 <li data-name="LuCI.ui.Hiddenfield#setPlaceholder"><a href="LuCI.ui.Hiddenfield.html#setPlaceholder">setPlaceholder</a></li>
3228
3229 <li data-name="LuCI.ui.Hiddenfield#setUpdateEvents"><a href="LuCI.ui.Hiddenfield.html#setUpdateEvents">setUpdateEvents</a></li>
3230
3231 <li data-name="LuCI.ui.Hiddenfield#setValue"><a href="LuCI.ui.Hiddenfield.html#setValue">setValue</a></li>
3232
3233 <li data-name="LuCI.ui.Hiddenfield#triggerValidation"><a href="LuCI.ui.Hiddenfield.html#triggerValidation">triggerValidation</a></li>
3234
3235 </ul>
3236 <ul class="events itemMembers">
3237
3238 </ul>
3239 </li>
3240
3241 <li class="item" data-name="LuCI.ui.menu">
3242 <span class="title">
3243 <a href="LuCI.ui.menu.html">LuCI.ui.menu</a>
3244
3245 </span>
3246 <ul class="members itemMembers">
3247
3248 </ul>
3249 <ul class="typedefs itemMembers">
3250
3251 <span class="subtitle">Typedefs</span>
3252
3253 <li data-name="LuCI.ui.menu.MenuNode"><a href="LuCI.ui.menu.html#.MenuNode">MenuNode</a></li>
3254
3255 </ul>
3256 <ul class="typedefs itemMembers">
3257
3258 </ul>
3259 <ul class="methods itemMembers">
3260
3261 <span class="subtitle">Methods</span>
3262
3263 <li data-name="LuCI.ui.menu#flushCache"><a href="LuCI.ui.menu.html#flushCache">flushCache</a></li>
3264
3265 <li data-name="LuCI.ui.menu#getChildren"><a href="LuCI.ui.menu.html#getChildren">getChildren</a></li>
3266
3267 <li data-name="LuCI.ui.menu#load"><a href="LuCI.ui.menu.html#load">load</a></li>
3268
3269 </ul>
3270 <ul class="events itemMembers">
3271
3272 </ul>
3273 </li>
3274
3275 <li class="item" data-name="LuCI.ui.Select">
3276 <span class="title">
3277 <a href="LuCI.ui.Select.html">LuCI.ui.Select</a>
3278
3279 </span>
3280 <ul class="members itemMembers">
3281
3282 </ul>
3283 <ul class="typedefs itemMembers">
3284
3285 <span class="subtitle">Typedefs</span>
3286
3287 <li data-name="LuCI.ui.Select.InitOptions"><a href="LuCI.ui.Select.html#.InitOptions">InitOptions</a></li>
3288
3289 </ul>
3290 <ul class="typedefs itemMembers">
3291
3292 </ul>
3293 <ul class="methods itemMembers">
3294
3295 <span class="subtitle">Methods</span>
3296
3297 <li data-name="LuCI.ui.Select#getValidationError"><a href="LuCI.ui.Select.html#getValidationError">getValidationError</a></li>
3298
3299 <li data-name="LuCI.ui.Select#getValue"><a href="LuCI.ui.Select.html#getValue">getValue</a></li>
3300
3301 <li data-name="LuCI.ui.Select#isChanged"><a href="LuCI.ui.Select.html#isChanged">isChanged</a></li>
3302
3303 <li data-name="LuCI.ui.Select#isValid"><a href="LuCI.ui.Select.html#isValid">isValid</a></li>
3304
3305 <li data-name="LuCI.ui.Select#registerEvents"><a href="LuCI.ui.Select.html#registerEvents">registerEvents</a></li>
3306
3307 <li data-name="LuCI.ui.Select#render"><a href="LuCI.ui.Select.html#render">render</a></li>
3308
3309 <li data-name="LuCI.ui.Select#setChangeEvents"><a href="LuCI.ui.Select.html#setChangeEvents">setChangeEvents</a></li>
3310
3311 <li data-name="LuCI.ui.Select#setPlaceholder"><a href="LuCI.ui.Select.html#setPlaceholder">setPlaceholder</a></li>
3312
3313 <li data-name="LuCI.ui.Select#setUpdateEvents"><a href="LuCI.ui.Select.html#setUpdateEvents">setUpdateEvents</a></li>
3314
3315 <li data-name="LuCI.ui.Select#setValue"><a href="LuCI.ui.Select.html#setValue">setValue</a></li>
3316
3317 <li data-name="LuCI.ui.Select#triggerValidation"><a href="LuCI.ui.Select.html#triggerValidation">triggerValidation</a></li>
3318
3319 </ul>
3320 <ul class="events itemMembers">
3321
3322 </ul>
3323 </li>
3324
3325 <li class="item" data-name="LuCI.ui.tabs">
3326 <span class="title">
3327 <a href="LuCI.ui.tabs.html">LuCI.ui.tabs</a>
3328
3329 </span>
3330 <ul class="members itemMembers">
3331
3332 </ul>
3333 <ul class="typedefs itemMembers">
3334
3335 </ul>
3336 <ul class="typedefs itemMembers">
3337
3338 </ul>
3339 <ul class="methods itemMembers">
3340
3341 <span class="subtitle">Methods</span>
3342
3343 <li data-name="LuCI.ui.tabs#initTabGroup"><a href="LuCI.ui.tabs.html#initTabGroup">initTabGroup</a></li>
3344
3345 <li data-name="LuCI.ui.tabs#isEmptyPane"><a href="LuCI.ui.tabs.html#isEmptyPane">isEmptyPane</a></li>
3346
3347 </ul>
3348 <ul class="events itemMembers">
3349
3350 </ul>
3351 </li>
3352
3353 <li class="item" data-name="LuCI.ui.Textarea">
3354 <span class="title">
3355 <a href="LuCI.ui.Textarea.html">LuCI.ui.Textarea</a>
3356
3357 </span>
3358 <ul class="members itemMembers">
3359
3360 </ul>
3361 <ul class="typedefs itemMembers">
3362
3363 <span class="subtitle">Typedefs</span>
3364
3365 <li data-name="LuCI.ui.Textarea.InitOptions"><a href="LuCI.ui.Textarea.html#.InitOptions">InitOptions</a></li>
3366
3367 </ul>
3368 <ul class="typedefs itemMembers">
3369
3370 </ul>
3371 <ul class="methods itemMembers">
3372
3373 <span class="subtitle">Methods</span>
3374
3375 <li data-name="LuCI.ui.Textarea#getValidationError"><a href="LuCI.ui.Textarea.html#getValidationError">getValidationError</a></li>
3376
3377 <li data-name="LuCI.ui.Textarea#getValue"><a href="LuCI.ui.Textarea.html#getValue">getValue</a></li>
3378
3379 <li data-name="LuCI.ui.Textarea#isChanged"><a href="LuCI.ui.Textarea.html#isChanged">isChanged</a></li>
3380
3381 <li data-name="LuCI.ui.Textarea#isValid"><a href="LuCI.ui.Textarea.html#isValid">isValid</a></li>
3382
3383 <li data-name="LuCI.ui.Textarea#registerEvents"><a href="LuCI.ui.Textarea.html#registerEvents">registerEvents</a></li>
3384
3385 <li data-name="LuCI.ui.Textarea#render"><a href="LuCI.ui.Textarea.html#render">render</a></li>
3386
3387 <li data-name="LuCI.ui.Textarea#setChangeEvents"><a href="LuCI.ui.Textarea.html#setChangeEvents">setChangeEvents</a></li>
3388
3389 <li data-name="LuCI.ui.Textarea#setPlaceholder"><a href="LuCI.ui.Textarea.html#setPlaceholder">setPlaceholder</a></li>
3390
3391 <li data-name="LuCI.ui.Textarea#setUpdateEvents"><a href="LuCI.ui.Textarea.html#setUpdateEvents">setUpdateEvents</a></li>
3392
3393 <li data-name="LuCI.ui.Textarea#setValue"><a href="LuCI.ui.Textarea.html#setValue">setValue</a></li>
3394
3395 <li data-name="LuCI.ui.Textarea#triggerValidation"><a href="LuCI.ui.Textarea.html#triggerValidation">triggerValidation</a></li>
3396
3397 </ul>
3398 <ul class="events itemMembers">
3399
3400 </ul>
3401 </li>
3402
3403 <li class="item" data-name="LuCI.ui.Textfield">
3404 <span class="title">
3405 <a href="LuCI.ui.Textfield.html">LuCI.ui.Textfield</a>
3406
3407 </span>
3408 <ul class="members itemMembers">
3409
3410 </ul>
3411 <ul class="typedefs itemMembers">
3412
3413 <span class="subtitle">Typedefs</span>
3414
3415 <li data-name="LuCI.ui.Textfield.InitOptions"><a href="LuCI.ui.Textfield.html#.InitOptions">InitOptions</a></li>
3416
3417 </ul>
3418 <ul class="typedefs itemMembers">
3419
3420 </ul>
3421 <ul class="methods itemMembers">
3422
3423 <span class="subtitle">Methods</span>
3424
3425 <li data-name="LuCI.ui.Textfield#getValidationError"><a href="LuCI.ui.Textfield.html#getValidationError">getValidationError</a></li>
3426
3427 <li data-name="LuCI.ui.Textfield#getValue"><a href="LuCI.ui.Textfield.html#getValue">getValue</a></li>
3428
3429 <li data-name="LuCI.ui.Textfield#isChanged"><a href="LuCI.ui.Textfield.html#isChanged">isChanged</a></li>
3430
3431 <li data-name="LuCI.ui.Textfield#isValid"><a href="LuCI.ui.Textfield.html#isValid">isValid</a></li>
3432
3433 <li data-name="LuCI.ui.Textfield#registerEvents"><a href="LuCI.ui.Textfield.html#registerEvents">registerEvents</a></li>
3434
3435 <li data-name="LuCI.ui.Textfield#render"><a href="LuCI.ui.Textfield.html#render">render</a></li>
3436
3437 <li data-name="LuCI.ui.Textfield#setChangeEvents"><a href="LuCI.ui.Textfield.html#setChangeEvents">setChangeEvents</a></li>
3438
3439 <li data-name="LuCI.ui.Textfield#setPlaceholder"><a href="LuCI.ui.Textfield.html#setPlaceholder">setPlaceholder</a></li>
3440
3441 <li data-name="LuCI.ui.Textfield#setUpdateEvents"><a href="LuCI.ui.Textfield.html#setUpdateEvents">setUpdateEvents</a></li>
3442
3443 <li data-name="LuCI.ui.Textfield#setValue"><a href="LuCI.ui.Textfield.html#setValue">setValue</a></li>
3444
3445 <li data-name="LuCI.ui.Textfield#triggerValidation"><a href="LuCI.ui.Textfield.html#triggerValidation">triggerValidation</a></li>
3446
3447 </ul>
3448 <ul class="events itemMembers">
3449
3450 </ul>
3451 </li>
3452
3453 <li class="item" data-name="LuCI.view">
3454 <span class="title">
3455 <a href="LuCI.view.html">LuCI.view</a>
3456
3457 </span>
3458 <ul class="members itemMembers">
3459
3460 </ul>
3461 <ul class="typedefs itemMembers">
3462
3463 </ul>
3464 <ul class="typedefs itemMembers">
3465
3466 </ul>
3467 <ul class="methods itemMembers">
3468
3469 <span class="subtitle">Methods</span>
3470
3471 <li data-name="LuCI.view#addFooter"><a href="LuCI.view.html#addFooter">addFooter</a></li>
3472
3473 <li data-name="LuCI.view#handleReset"><a href="LuCI.view.html#handleReset">handleReset</a></li>
3474
3475 <li data-name="LuCI.view#handleSave"><a href="LuCI.view.html#handleSave">handleSave</a></li>
3476
3477 <li data-name="LuCI.view#handleSaveApply"><a href="LuCI.view.html#handleSaveApply">handleSaveApply</a></li>
3478
3479 <li data-name="LuCI.view#load"><a href="LuCI.view.html#load">load</a></li>
3480
3481 <li data-name="LuCI.view#render"><a href="LuCI.view.html#render">render</a></li>
3482
3483 </ul>
3484 <ul class="events itemMembers">
3485
3486 </ul>
3487 </li>
3488
3489 <li class="item" data-name="LuCI.xhr">
3490 <span class="title">
3491 <a href="LuCI.xhr.html">LuCI.xhr</a>
3492
3493 </span>
3494 <ul class="members itemMembers">
3495
3496 </ul>
3497 <ul class="typedefs itemMembers">
3498
3499 </ul>
3500 <ul class="typedefs itemMembers">
3501
3502 </ul>
3503 <ul class="methods itemMembers">
3504
3505 <span class="subtitle">Methods</span>
3506
3507 <li data-name="LuCI.xhr#abort"><a href="LuCI.xhr.html#abort">abort</a></li>
3508
3509 <li data-name="LuCI.xhr#busy"><a href="LuCI.xhr.html#busy">busy</a></li>
3510
3511 <li data-name="LuCI.xhr#cancel"><a href="LuCI.xhr.html#cancel">cancel</a></li>
3512
3513 <li data-name="LuCI.xhr#get"><a href="LuCI.xhr.html#get">get</a></li>
3514
3515 <li data-name="LuCI.xhr#post"><a href="LuCI.xhr.html#post">post</a></li>
3516
3517 <li data-name="LuCI.xhr#send_form"><a href="LuCI.xhr.html#send_form">send_form</a></li>
3518
3519 </ul>
3520 <ul class="events itemMembers">
3521
3522 </ul>
3523 </li>
3524
3525 </ul>
3526 </div>
3527 <div class="main">
3528 <h1 class="page-title" data-filename="form.js.html">Source: form.js</h1>
3529
3530
3531
3532
3533 <section>
3534 <article>
3535 <pre id="source-code" class="prettyprint source "><code>'use strict';
3536 'require ui';
3537 'require uci';
3538 'require rpc';
3539 'require dom';
3540 'require baseclass';
3541
3542 var scope = this;
3543
3544 var callSessionAccess = rpc.declare({
3545 object: 'session',
3546 method: 'access',
3547 params: [ 'scope', 'object', 'function' ],
3548 expect: { 'access': false }
3549 });
3550
3551 var CBIJSONConfig = baseclass.extend({
3552 __init__: function(data) {
3553 data = Object.assign({}, data);
3554
3555 this.data = {};
3556
3557 var num_sections = 0,
3558 section_ids = [];
3559
3560 for (var sectiontype in data) {
3561 if (!data.hasOwnProperty(sectiontype))
3562 continue;
3563
3564 if (Array.isArray(data[sectiontype])) {
3565 for (var i = 0, index = 0; i &lt; data[sectiontype].length; i++) {
3566 var item = data[sectiontype][i],
3567 anonymous, name;
3568
3569 if (!L.isObject(item))
3570 continue;
3571
3572 if (typeof(item['.name']) == 'string') {
3573 name = item['.name'];
3574 anonymous = false;
3575 }
3576 else {
3577 name = sectiontype + num_sections;
3578 anonymous = true;
3579 }
3580
3581 if (!this.data.hasOwnProperty(name))
3582 section_ids.push(name);
3583
3584 this.data[name] = Object.assign(item, {
3585 '.index': num_sections++,
3586 '.anonymous': anonymous,
3587 '.name': name,
3588 '.type': sectiontype
3589 });
3590 }
3591 }
3592 else if (L.isObject(data[sectiontype])) {
3593 this.data[sectiontype] = Object.assign(data[sectiontype], {
3594 '.anonymous': false,
3595 '.name': sectiontype,
3596 '.type': sectiontype
3597 });
3598
3599 section_ids.push(sectiontype);
3600 num_sections++;
3601 }
3602 }
3603
3604 section_ids.sort(L.bind(function(a, b) {
3605 var indexA = (this.data[a]['.index'] != null) ? +this.data[a]['.index'] : 9999,
3606 indexB = (this.data[b]['.index'] != null) ? +this.data[b]['.index'] : 9999;
3607
3608 if (indexA != indexB)
3609 return (indexA - indexB);
3610
3611 return L.naturalCompare(a, b);
3612 }, this));
3613
3614 for (var i = 0; i &lt; section_ids.length; i++)
3615 this.data[section_ids[i]]['.index'] = i;
3616 },
3617
3618 load: function() {
3619 return Promise.resolve(this.data);
3620 },
3621
3622 save: function() {
3623 return Promise.resolve();
3624 },
3625
3626 get: function(config, section, option) {
3627 if (section == null)
3628 return null;
3629
3630 if (option == null)
3631 return this.data[section];
3632
3633 if (!this.data.hasOwnProperty(section))
3634 return null;
3635
3636 var value = this.data[section][option];
3637
3638 if (Array.isArray(value))
3639 return value;
3640
3641 if (value != null)
3642 return String(value);
3643
3644 return null;
3645 },
3646
3647 set: function(config, section, option, value) {
3648 if (section == null || option == null || option.charAt(0) == '.')
3649 return;
3650
3651 if (!this.data.hasOwnProperty(section))
3652 return;
3653
3654 if (value == null)
3655 delete this.data[section][option];
3656 else if (Array.isArray(value))
3657 this.data[section][option] = value;
3658 else
3659 this.data[section][option] = String(value);
3660 },
3661
3662 unset: function(config, section, option) {
3663 return this.set(config, section, option, null);
3664 },
3665
3666 sections: function(config, sectiontype, callback) {
3667 var rv = [];
3668
3669 for (var section_id in this.data)
3670 if (sectiontype == null || this.data[section_id]['.type'] == sectiontype)
3671 rv.push(this.data[section_id]);
3672
3673 rv.sort(function(a, b) { return a['.index'] - b['.index'] });
3674
3675 if (typeof(callback) == 'function')
3676 for (var i = 0; i &lt; rv.length; i++)
3677 callback.call(this, rv[i], rv[i]['.name']);
3678
3679 return rv;
3680 },
3681
3682 add: function(config, sectiontype, sectionname) {
3683 var num_sections_type = 0, next_index = 0;
3684
3685 for (var name in this.data) {
3686 num_sections_type += (this.data[name]['.type'] == sectiontype);
3687 next_index = Math.max(next_index, this.data[name]['.index']);
3688 }
3689
3690 var section_id = sectionname || sectiontype + num_sections_type;
3691
3692 if (!this.data.hasOwnProperty(section_id)) {
3693 this.data[section_id] = {
3694 '.name': section_id,
3695 '.type': sectiontype,
3696 '.anonymous': (sectionname == null),
3697 '.index': next_index + 1
3698 };
3699 }
3700
3701 return section_id;
3702 },
3703
3704 remove: function(config, section) {
3705 if (this.data.hasOwnProperty(section))
3706 delete this.data[section];
3707 },
3708
3709 resolveSID: function(config, section_id) {
3710 return section_id;
3711 },
3712
3713 move: function(config, section_id1, section_id2, after) {
3714 return uci.move.apply(this, [config, section_id1, section_id2, after]);
3715 }
3716 });
3717
3718 /**
3719 * @class AbstractElement
3720 * @memberof LuCI.form
3721 * @hideconstructor
3722 * @classdesc
3723 *
3724 * The `AbstractElement` class serves as abstract base for the different form
3725 * elements implemented by `LuCI.form`. It provides the common logic for
3726 * loading and rendering values, for nesting elements and for defining common
3727 * properties.
3728 *
3729 * This class is private and not directly accessible by user code.
3730 */
3731 var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.prototype */ {
3732 __init__: function(title, description) {
3733 this.title = title || '';
3734 this.description = description || '';
3735 this.children = [];
3736 },
3737
3738 /**
3739 * Add another form element as children to this element.
3740 *
3741 * @param {AbstractElement} obj
3742 * The form element to add.
3743 */
3744 append: function(obj) {
3745 this.children.push(obj);
3746 },
3747
3748 /**
3749 * Parse this elements form input.
3750 *
3751 * The `parse()` function recursively walks the form element tree and
3752 * triggers input value reading and validation for each encountered element.
3753 *
3754 * Elements which are hidden due to unsatisfied dependencies are skipped.
3755 *
3756 * @returns {Promise&lt;void>}
3757 * Returns a promise resolving once this element's value and the values of
3758 * all child elements have been parsed. The returned promise is rejected
3759 * if any parsed values are not meeting the validation constraints of their
3760 * respective elements.
3761 */
3762 parse: function() {
3763 var args = arguments;
3764 this.children.forEach(function(child) {
3765 child.parse.apply(child, args);
3766 });
3767 },
3768
3769 /**
3770 * Render the form element.
3771 *
3772 * The `render()` function recursively walks the form element tree and
3773 * renders the markup for each element, returning the assembled DOM tree.
3774 *
3775 * @abstract
3776 * @returns {Node|Promise&lt;Node>}
3777 * May return a DOM Node or a promise resolving to a DOM node containing
3778 * the form element's markup, including the markup of any child elements.
3779 */
3780 render: function() {
3781 L.error('InternalError', 'Not implemented');
3782 },
3783
3784 /** @private */
3785 loadChildren: function(/* ... */) {
3786 var tasks = [];
3787
3788 if (Array.isArray(this.children))
3789 for (var i = 0; i &lt; this.children.length; i++)
3790 if (!this.children[i].disable)
3791 tasks.push(this.children[i].load.apply(this.children[i], arguments));
3792
3793 return Promise.all(tasks);
3794 },
3795
3796 /** @private */
3797 renderChildren: function(tab_name /*, ... */) {
3798 var tasks = [],
3799 index = 0;
3800
3801 if (Array.isArray(this.children))
3802 for (var i = 0; i &lt; this.children.length; i++)
3803 if (tab_name === null || this.children[i].tab === tab_name)
3804 if (!this.children[i].disable)
3805 tasks.push(this.children[i].render.apply(
3806 this.children[i], this.varargs(arguments, 1, index++)));
3807
3808 return Promise.all(tasks);
3809 },
3810
3811 /**
3812 * Strip any HTML tags from the given input string.
3813 *
3814 * @param {string} s
3815 * The input string to clean.
3816 *
3817 * @returns {string}
3818 * The cleaned input string with HTML tags removed.
3819 */
3820 stripTags: function(s) {
3821 if (typeof(s) == 'string' &amp;&amp; !s.match(/[&lt;>]/))
3822 return s;
3823
3824 var x = dom.elem(s) ? s : dom.parse('&lt;div>' + s + '&lt;/div>');
3825
3826 x.querySelectorAll('br').forEach(function(br) {
3827 x.replaceChild(document.createTextNode('\n'), br);
3828 });
3829
3830 return (x.textContent || x.innerText || '').replace(/([ \t]*\n)+/g, '\n');
3831 },
3832
3833 /**
3834 * Format the given named property as title string.
3835 *
3836 * This function looks up the given named property and formats its value
3837 * suitable for use as element caption or description string. It also
3838 * strips any HTML tags from the result.
3839 *
3840 * If the property value is a string, it is passed to `String.format()`
3841 * along with any additional parameters passed to `titleFn()`.
3842 *
3843 * If the property value is a function, it is invoked with any additional
3844 * `titleFn()` parameters as arguments and the obtained return value is
3845 * converted to a string.
3846 *
3847 * In all other cases, `null` is returned.
3848 *
3849 * @param {string} property
3850 * The name of the element property to use.
3851 *
3852 * @param {...*} fmt_args
3853 * Extra values to format the title string with.
3854 *
3855 * @returns {string|null}
3856 * The formatted title string or `null` if the property did not exist or
3857 * was neither a string nor a function.
3858 */
3859 titleFn: function(attr /*, ... */) {
3860 var s = null;
3861
3862 if (typeof(this[attr]) == 'function')
3863 s = this[attr].apply(this, this.varargs(arguments, 1));
3864 else if (typeof(this[attr]) == 'string')
3865 s = (arguments.length > 1) ? ''.format.apply(this[attr], this.varargs(arguments, 1)) : this[attr];
3866
3867 if (s != null)
3868 s = this.stripTags(String(s)).trim();
3869
3870 if (s == null || s == '')
3871 return null;
3872
3873 return s;
3874 }
3875 });
3876
3877 /**
3878 * @constructor Map
3879 * @memberof LuCI.form
3880 * @augments LuCI.form.AbstractElement
3881 *
3882 * @classdesc
3883 *
3884 * The `Map` class represents one complete form. A form usually maps one UCI
3885 * configuration file and is divided into multiple sections containing multiple
3886 * fields each.
3887 *
3888 * It serves as main entry point into the `LuCI.form` for typical view code.
3889 *
3890 * @param {string} config
3891 * The UCI configuration to map. It is automatically loaded along when the
3892 * resulting map instance.
3893 *
3894 * @param {string} [title]
3895 * The title caption of the form. A form title is usually rendered as separate
3896 * headline element before the actual form contents. If omitted, the
3897 * corresponding headline element will not be rendered.
3898 *
3899 * @param {string} [description]
3900 * The description text of the form which is usually rendered as text
3901 * paragraph below the form title and before the actual form contents.
3902 * If omitted, the corresponding paragraph element will not be rendered.
3903 */
3904 var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
3905 __init__: function(config /*, ... */) {
3906 this.super('__init__', this.varargs(arguments, 1));
3907
3908 this.config = config;
3909 this.parsechain = [ config ];
3910 this.data = uci;
3911 },
3912
3913 /**
3914 * Toggle readonly state of the form.
3915 *
3916 * If set to `true`, the Map instance is marked readonly and any form
3917 * option elements added to it will inherit the readonly state.
3918 *
3919 * If left unset, the Map will test the access permission of the primary
3920 * uci configuration upon loading and mark the form readonly if no write
3921 * permissions are granted.
3922 *
3923 * @name LuCI.form.Map.prototype#readonly
3924 * @type boolean
3925 */
3926
3927 /**
3928 * Find all DOM nodes within this Map which match the given search
3929 * parameters. This function is essentially a convenience wrapper around
3930 * `querySelectorAll()`.
3931 *
3932 * This function is sensitive to the amount of arguments passed to it;
3933 * if only one argument is specified, it is used as selector-expression
3934 * as-is. When two arguments are passed, the first argument is treated
3935 * as attribute name, the second one as attribute value to match.
3936 *
3937 * As an example, `map.findElements('input')` would find all `&lt;input>`
3938 * nodes while `map.findElements('type', 'text')` would find any DOM node
3939 * with a `type="text"` attribute.
3940 *
3941 * @param {string} selector_or_attrname
3942 * If invoked with only one parameter, this argument is a
3943 * `querySelectorAll()` compatible selector expression. If invoked with
3944 * two parameters, this argument is the attribute name to filter for.
3945 *
3946 * @param {string} [attrvalue]
3947 * In case the function is invoked with two parameters, this argument
3948 * specifies the attribute value to match.
3949 *
3950 * @throws {InternalError}
3951 * Throws an `InternalError` if more than two function parameters are
3952 * passed.
3953 *
3954 * @returns {NodeList}
3955 * Returns a (possibly empty) DOM `NodeList` containing the found DOM nodes.
3956 */
3957 findElements: function(/* ... */) {
3958 var q = null;
3959
3960 if (arguments.length == 1)
3961 q = arguments[0];
3962 else if (arguments.length == 2)
3963 q = '[%s="%s"]'.format(arguments[0], arguments[1]);
3964 else
3965 L.error('InternalError', 'Expecting one or two arguments to findElements()');
3966
3967 return this.root.querySelectorAll(q);
3968 },
3969
3970 /**
3971 * Find the first DOM node within this Map which matches the given search
3972 * parameters. This function is essentially a convenience wrapper around
3973 * `findElements()` which only returns the first found node.
3974 *
3975 * This function is sensitive to the amount of arguments passed to it;
3976 * if only one argument is specified, it is used as selector-expression
3977 * as-is. When two arguments are passed, the first argument is treated
3978 * as attribute name, the second one as attribute value to match.
3979 *
3980 * As an example, `map.findElement('input')` would find the first `&lt;input>`
3981 * node while `map.findElement('type', 'text')` would find the first DOM
3982 * node with a `type="text"` attribute.
3983 *
3984 * @param {string} selector_or_attrname
3985 * If invoked with only one parameter, this argument is a `querySelector()`
3986 * compatible selector expression. If invoked with two parameters, this
3987 * argument is the attribute name to filter for.
3988 *
3989 * @param {string} [attrvalue]
3990 * In case the function is invoked with two parameters, this argument
3991 * specifies the attribute value to match.
3992 *
3993 * @throws {InternalError}
3994 * Throws an `InternalError` if more than two function parameters are
3995 * passed.
3996 *
3997 * @returns {Node|null}
3998 * Returns the first found DOM node or `null` if no element matched.
3999 */
4000 findElement: function(/* ... */) {
4001 var res = this.findElements.apply(this, arguments);
4002 return res.length ? res[0] : null;
4003 },
4004
4005 /**
4006 * Tie another UCI configuration to the map.
4007 *
4008 * By default, a map instance will only load the UCI configuration file
4009 * specified in the constructor but sometimes access to values from
4010 * further configuration files is required. This function allows for such
4011 * use cases by registering further UCI configuration files which are
4012 * needed by the map.
4013 *
4014 * @param {string} config
4015 * The additional UCI configuration file to tie to the map. If the given
4016 * config already is in the list of required files, it will be ignored.
4017 */
4018 chain: function(config) {
4019 if (this.parsechain.indexOf(config) == -1)
4020 this.parsechain.push(config);
4021 },
4022
4023 /**
4024 * Add a configuration section to the map.
4025 *
4026 * LuCI forms follow the structure of the underlying UCI configurations,
4027 * means that a map, which represents a single UCI configuration, is
4028 * divided into multiple sections which in turn contain an arbitrary
4029 * number of options.
4030 *
4031 * While UCI itself only knows two kinds of sections - named and anonymous
4032 * ones - the form class offers various flavors of form section elements
4033 * to present configuration sections in different ways. Refer to the
4034 * documentation of the different section classes for details.
4035 *
4036 * @param {LuCI.form.AbstractSection} sectionclass
4037 * The section class to use for rendering the configuration section.
4038 * Note that this value must be the class itself, not a class instance
4039 * obtained from calling `new`. It must also be a class derived from
4040 * `LuCI.form.AbstractSection`.
4041 *
4042 * @param {...string} classargs
4043 * Additional arguments which are passed as-is to the constructor of the
4044 * given section class. Refer to the class specific constructor
4045 * documentation for details.
4046 *
4047 * @returns {LuCI.form.AbstractSection}
4048 * Returns the instantiated section class instance.
4049 */
4050 section: function(cbiClass /*, ... */) {
4051 if (!CBIAbstractSection.isSubclass(cbiClass))
4052 L.error('TypeError', 'Class must be a descendent of CBIAbstractSection');
4053
4054 var obj = cbiClass.instantiate(this.varargs(arguments, 1, this));
4055 this.append(obj);
4056 return obj;
4057 },
4058
4059 /**
4060 * Load the configuration covered by this map.
4061 *
4062 * The `load()` function first loads all referenced UCI configurations,
4063 * then it recursively walks the form element tree and invokes the
4064 * load function of each child element.
4065 *
4066 * @returns {Promise&lt;void>}
4067 * Returns a promise resolving once the entire form completed loading all
4068 * data. The promise may reject with an error if any configuration failed
4069 * to load or if any of the child elements load functions rejected with
4070 * an error.
4071 */
4072 load: function() {
4073 var doCheckACL = (!(this instanceof CBIJSONMap) &amp;&amp; this.readonly == null),
4074 loadTasks = [ doCheckACL ? callSessionAccess('uci', this.config, 'write') : true ],
4075 configs = this.parsechain || [ this.config ];
4076
4077 loadTasks.push.apply(loadTasks, configs.map(L.bind(function(config, i) {
4078 return i ? L.resolveDefault(this.data.load(config)) : this.data.load(config);
4079 }, this)));
4080
4081 return Promise.all(loadTasks).then(L.bind(function(res) {
4082 if (res[0] === false)
4083 this.readonly = true;
4084
4085 return this.loadChildren();
4086 }, this));
4087 },
4088
4089 /**
4090 * Parse the form input values.
4091 *
4092 * The `parse()` function recursively walks the form element tree and
4093 * triggers input value reading and validation for each child element.
4094 *
4095 * Elements which are hidden due to unsatisfied dependencies are skipped.
4096 *
4097 * @returns {Promise&lt;void>}
4098 * Returns a promise resolving once the entire form completed parsing all
4099 * input values. The returned promise is rejected if any parsed values are
4100 * not meeting the validation constraints of their respective elements.
4101 */
4102 parse: function() {
4103 var tasks = [];
4104
4105 if (Array.isArray(this.children))
4106 for (var i = 0; i &lt; this.children.length; i++)
4107 tasks.push(this.children[i].parse());
4108
4109 return Promise.all(tasks);
4110 },
4111
4112 /**
4113 * Save the form input values.
4114 *
4115 * This function parses the current form, saves the resulting UCI changes,
4116 * reloads the UCI configuration data and redraws the form elements.
4117 *
4118 * @param {function} [cb]
4119 * An optional callback function that is invoked after the form is parsed
4120 * but before the changed UCI data is saved. This is useful to perform
4121 * additional data manipulation steps before saving the changes.
4122 *
4123 * @param {boolean} [silent=false]
4124 * If set to `true`, trigger an alert message to the user in case saving
4125 * the form data failures. Otherwise fail silently.
4126 *
4127 * @returns {Promise&lt;void>}
4128 * Returns a promise resolving once the entire save operation is complete.
4129 * The returned promise is rejected if any step of the save operation
4130 * failed.
4131 */
4132 save: function(cb, silent) {
4133 this.checkDepends();
4134
4135 return this.parse()
4136 .then(cb)
4137 .then(this.data.save.bind(this.data))
4138 .then(this.load.bind(this))
4139 .catch(function(e) {
4140 if (!silent) {
4141 ui.showModal(_('Save error'), [
4142 E('p', {}, [ _('An error occurred while saving the form:') ]),
4143 E('p', {}, [ E('em', { 'style': 'white-space:pre-wrap' }, [ e.message ]) ]),
4144 E('div', { 'class': 'right' }, [
4145 E('button', { 'class': 'cbi-button', 'click': ui.hideModal }, [ _('Dismiss') ])
4146 ])
4147 ]);
4148 }
4149
4150 return Promise.reject(e);
4151 }).then(this.renderContents.bind(this));
4152 },
4153
4154 /**
4155 * Reset the form by re-rendering its contents. This will revert all
4156 * unsaved user inputs to their initial form state.
4157 *
4158 * @returns {Promise&lt;Node>}
4159 * Returns a promise resolving to the toplevel form DOM node once the
4160 * re-rendering is complete.
4161 */
4162 reset: function() {
4163 return this.renderContents();
4164 },
4165
4166 /**
4167 * Render the form markup.
4168 *
4169 * @returns {Promise&lt;Node>}
4170 * Returns a promise resolving to the toplevel form DOM node once the
4171 * rendering is complete.
4172 */
4173 render: function() {
4174 return this.load().then(this.renderContents.bind(this));
4175 },
4176
4177 /** @private */
4178 renderContents: function() {
4179 var mapEl = this.root || (this.root = E('div', {
4180 'id': 'cbi-%s'.format(this.config),
4181 'class': 'cbi-map',
4182 'cbi-dependency-check': L.bind(this.checkDepends, this)
4183 }));
4184
4185 dom.bindClassInstance(mapEl, this);
4186
4187 return this.renderChildren(null).then(L.bind(function(nodes) {
4188 var initialRender = !mapEl.firstChild;
4189
4190 dom.content(mapEl, null);
4191
4192 if (this.title != null &amp;&amp; this.title != '')
4193 mapEl.appendChild(E('h2', { 'name': 'content' }, this.title));
4194
4195 if (this.description != null &amp;&amp; this.description != '')
4196 mapEl.appendChild(E('div', { 'class': 'cbi-map-descr' }, this.description));
4197
4198 if (this.tabbed)
4199 dom.append(mapEl, E('div', { 'class': 'cbi-map-tabbed' }, nodes));
4200 else
4201 dom.append(mapEl, nodes);
4202
4203 if (!initialRender) {
4204 mapEl.classList.remove('flash');
4205
4206 window.setTimeout(function() {
4207 mapEl.classList.add('flash');
4208 }, 1);
4209 }
4210
4211 this.checkDepends();
4212
4213 var tabGroups = mapEl.querySelectorAll('.cbi-map-tabbed, .cbi-section-node-tabbed');
4214
4215 for (var i = 0; i &lt; tabGroups.length; i++)
4216 ui.tabs.initTabGroup(tabGroups[i].childNodes);
4217
4218 return mapEl;
4219 }, this));
4220 },
4221
4222 /**
4223 * Find a form option element instance.
4224 *
4225 * @param {string} name
4226 * The name or the full ID of the option element to look up.
4227 *
4228 * @param {string} [section_id]
4229 * The ID of the UCI section containing the option to look up. May be
4230 * omitted if a full ID is passed as first argument.
4231 *
4232 * @param {string} [config_name]
4233 * The name of the UCI configuration the option instance belongs to.
4234 * Defaults to the main UCI configuration of the map if omitted.
4235 *
4236 * @returns {Array&lt;LuCI.form.AbstractValue,string>|null}
4237 * Returns a two-element array containing the form option instance as
4238 * first item and the corresponding UCI section ID as second item.
4239 * Returns `null` if the option could not be found.
4240 */
4241 lookupOption: function(name, section_id, config_name) {
4242 var id, elem, sid, inst;
4243
4244 if (name.indexOf('.') > -1)
4245 id = 'cbid.%s'.format(name);
4246 else
4247 id = 'cbid.%s.%s.%s'.format(config_name || this.config, section_id, name);
4248
4249 elem = this.findElement('data-field', id);
4250 sid = elem ? id.split(/\./)[2] : null;
4251 inst = elem ? dom.findClassInstance(elem) : null;
4252
4253 return (inst instanceof CBIAbstractValue) ? [ inst, sid ] : null;
4254 },
4255
4256 /** @private */
4257 checkDepends: function(ev, n) {
4258 var changed = false;
4259
4260 for (var i = 0, s = this.children[0]; (s = this.children[i]) != null; i++)
4261 if (s.checkDepends(ev, n))
4262 changed = true;
4263
4264 if (changed &amp;&amp; (n || 0) &lt; 10)
4265 this.checkDepends(ev, (n || 10) + 1);
4266
4267 ui.tabs.updateTabs(ev, this.root);
4268 },
4269
4270 /** @private */
4271 isDependencySatisfied: function(depends, config_name, section_id) {
4272 var def = false;
4273
4274 if (!Array.isArray(depends) || !depends.length)
4275 return true;
4276
4277 for (var i = 0; i &lt; depends.length; i++) {
4278 var istat = true,
4279 reverse = depends[i]['!reverse'],
4280 contains = depends[i]['!contains'];
4281
4282 for (var dep in depends[i]) {
4283 if (dep == '!reverse' || dep == '!contains') {
4284 continue;
4285 }
4286 else if (dep == '!default') {
4287 def = true;
4288 istat = false;
4289 }
4290 else {
4291 var res = this.lookupOption(dep, section_id, config_name),
4292 val = (res &amp;&amp; res[0].isActive(res[1])) ? res[0].formvalue(res[1]) : null;
4293
4294 var equal = contains
4295 ? isContained(val, depends[i][dep])
4296 : isEqual(val, depends[i][dep]);
4297
4298 istat = (istat &amp;&amp; equal);
4299 }
4300 }
4301
4302 if (istat ^ reverse)
4303 return true;
4304 }
4305
4306 return def;
4307 }
4308 });
4309
4310 /**
4311 * @constructor JSONMap
4312 * @memberof LuCI.form
4313 * @augments LuCI.form.Map
4314 *
4315 * @classdesc
4316 *
4317 * A `JSONMap` class functions similar to [LuCI.form.Map]{@link LuCI.form.Map}
4318 * but uses a multidimensional JavaScript object instead of UCI configuration
4319 * as data source.
4320 *
4321 * @param {Object&lt;string, Object&lt;string, *>|Array&lt;Object&lt;string, *>>>} data
4322 * The JavaScript object to use as data source. Internally, the object is
4323 * converted into an UCI-like format. Its toplevel keys are treated like UCI
4324 * section types while the object or array-of-object values are treated as
4325 * section contents.
4326 *
4327 * @param {string} [title]
4328 * The title caption of the form. A form title is usually rendered as separate
4329 * headline element before the actual form contents. If omitted, the
4330 * corresponding headline element will not be rendered.
4331 *
4332 * @param {string} [description]
4333 * The description text of the form which is usually rendered as text
4334 * paragraph below the form title and before the actual form contents.
4335 * If omitted, the corresponding paragraph element will not be rendered.
4336 */
4337 var CBIJSONMap = CBIMap.extend(/** @lends LuCI.form.JSONMap.prototype */ {
4338 __init__: function(data /*, ... */) {
4339 this.super('__init__', this.varargs(arguments, 1, 'json'));
4340
4341 this.config = 'json';
4342 this.parsechain = [ 'json' ];
4343 this.data = new CBIJSONConfig(data);
4344 }
4345 });
4346
4347 /**
4348 * @class AbstractSection
4349 * @memberof LuCI.form
4350 * @augments LuCI.form.AbstractElement
4351 * @hideconstructor
4352 * @classdesc
4353 *
4354 * The `AbstractSection` class serves as abstract base for the different form
4355 * section styles implemented by `LuCI.form`. It provides the common logic for
4356 * enumerating underlying configuration section instances, for registering
4357 * form options and for handling tabs to segment child options.
4358 *
4359 * This class is private and not directly accessible by user code.
4360 */
4361 var CBIAbstractSection = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractSection.prototype */ {
4362 __init__: function(map, sectionType /*, ... */) {
4363 this.super('__init__', this.varargs(arguments, 2));
4364
4365 this.sectiontype = sectionType;
4366 this.map = map;
4367 this.config = map.config;
4368
4369 this.optional = true;
4370 this.addremove = false;
4371 this.dynamic = false;
4372 },
4373
4374 /**
4375 * Access the parent option container instance.
4376 *
4377 * In case this section is nested within an option element container,
4378 * this property will hold a reference to the parent option instance.
4379 *
4380 * If this section is not nested, the property is `null`.
4381 *
4382 * @name LuCI.form.AbstractSection.prototype#parentoption
4383 * @type LuCI.form.AbstractValue
4384 * @readonly
4385 */
4386
4387 /**
4388 * Enumerate the UCI section IDs covered by this form section element.
4389 *
4390 * @abstract
4391 * @throws {InternalError}
4392 * Throws an `InternalError` exception if the function is not implemented.
4393 *
4394 * @returns {string[]}
4395 * Returns an array of UCI section IDs covered by this form element.
4396 * The sections will be rendered in the same order as the returned array.
4397 */
4398 cfgsections: function() {
4399 L.error('InternalError', 'Not implemented');
4400 },
4401
4402 /**
4403 * Filter UCI section IDs to render.
4404 *
4405 * The filter function is invoked for each UCI section ID of a given type
4406 * and controls whether the given UCI section is rendered or ignored by
4407 * the form section element.
4408 *
4409 * The default implementation always returns `true`. User code or
4410 * classes extending `AbstractSection` may overwrite this function with
4411 * custom implementations.
4412 *
4413 * @abstract
4414 * @param {string} section_id
4415 * The UCI section ID to test.
4416 *
4417 * @returns {boolean}
4418 * Returns `true` when the given UCI section ID should be handled and
4419 * `false` when it should be ignored.
4420 */
4421 filter: function(section_id) {
4422 return true;
4423 },
4424
4425 /**
4426 * Load the configuration covered by this section.
4427 *
4428 * The `load()` function recursively walks the section element tree and
4429 * invokes the load function of each child option element.
4430 *
4431 * @returns {Promise&lt;void>}
4432 * Returns a promise resolving once the values of all child elements have
4433 * been loaded. The promise may reject with an error if any of the child
4434 * elements load functions rejected with an error.
4435 */
4436 load: function() {
4437 var section_ids = this.cfgsections(),
4438 tasks = [];
4439
4440 if (Array.isArray(this.children))
4441 for (var i = 0; i &lt; section_ids.length; i++)
4442 tasks.push(this.loadChildren(section_ids[i])
4443 .then(Function.prototype.bind.call(function(section_id, set_values) {
4444 for (var i = 0; i &lt; set_values.length; i++)
4445 this.children[i].cfgvalue(section_id, set_values[i]);
4446 }, this, section_ids[i])));
4447
4448 return Promise.all(tasks);
4449 },
4450
4451 /**
4452 * Parse this sections form input.
4453 *
4454 * The `parse()` function recursively walks the section element tree and
4455 * triggers input value reading and validation for each encountered child
4456 * option element.
4457 *
4458 * Options which are hidden due to unsatisfied dependencies are skipped.
4459 *
4460 * @returns {Promise&lt;void>}
4461 * Returns a promise resolving once the values of all child elements have
4462 * been parsed. The returned promise is rejected if any parsed values are
4463 * not meeting the validation constraints of their respective elements.
4464 */
4465 parse: function() {
4466 var section_ids = this.cfgsections(),
4467 tasks = [];
4468
4469 if (Array.isArray(this.children))
4470 for (var i = 0; i &lt; section_ids.length; i++)
4471 for (var j = 0; j &lt; this.children.length; j++)
4472 tasks.push(this.children[j].parse(section_ids[i]));
4473
4474 return Promise.all(tasks);
4475 },
4476
4477 /**
4478 * Add an option tab to the section.
4479 *
4480 * The child option elements of a section may be divided into multiple
4481 * tabs to provide a better overview to the user.
4482 *
4483 * Before options can be moved into a tab pane, the corresponding tab
4484 * has to be defined first, which is done by calling this function.
4485 *
4486 * Note that once tabs are defined, user code must use the `taboption()`
4487 * method to add options to specific tabs. Option elements added by
4488 * `option()` will not be assigned to any tab and not be rendered in this
4489 * case.
4490 *
4491 * @param {string} name
4492 * The name of the tab to register. It may be freely chosen and just serves
4493 * as an identifier to differentiate tabs.
4494 *
4495 * @param {string} title
4496 * The human readable caption of the tab.
4497 *
4498 * @param {string} [description]
4499 * An additional description text for the corresponding tab pane. It is
4500 * displayed as text paragraph below the tab but before the tab pane
4501 * contents. If omitted, no description will be rendered.
4502 *
4503 * @throws {Error}
4504 * Throws an exception if a tab with the same `name` already exists.
4505 */
4506 tab: function(name, title, description) {
4507 if (this.tabs &amp;&amp; this.tabs[name])
4508 throw 'Tab already declared';
4509
4510 var entry = {
4511 name: name,
4512 title: title,
4513 description: description,
4514 children: []
4515 };
4516
4517 this.tabs = this.tabs || [];
4518 this.tabs.push(entry);
4519 this.tabs[name] = entry;
4520
4521 this.tab_names = this.tab_names || [];
4522 this.tab_names.push(name);
4523 },
4524
4525 /**
4526 * Add a configuration option widget to the section.
4527 *
4528 * Note that [taboption()]{@link LuCI.form.AbstractSection#taboption}
4529 * should be used instead if this form section element uses tabs.
4530 *
4531 * @param {LuCI.form.AbstractValue} optionclass
4532 * The option class to use for rendering the configuration option. Note
4533 * that this value must be the class itself, not a class instance obtained
4534 * from calling `new`. It must also be a class derived from
4535 * [LuCI.form.AbstractSection]{@link LuCI.form.AbstractSection}.
4536 *
4537 * @param {...*} classargs
4538 * Additional arguments which are passed as-is to the constructor of the
4539 * given option class. Refer to the class specific constructor
4540 * documentation for details.
4541 *
4542 * @throws {TypeError}
4543 * Throws a `TypeError` exception in case the passed class value is not a
4544 * descendent of `AbstractValue`.
4545 *
4546 * @returns {LuCI.form.AbstractValue}
4547 * Returns the instantiated option class instance.
4548 */
4549 option: function(cbiClass /*, ... */) {
4550 if (!CBIAbstractValue.isSubclass(cbiClass))
4551 throw L.error('TypeError', 'Class must be a descendent of CBIAbstractValue');
4552
4553 var obj = cbiClass.instantiate(this.varargs(arguments, 1, this.map, this));
4554 this.append(obj);
4555 return obj;
4556 },
4557
4558 /**
4559 * Add a configuration option widget to a tab of the section.
4560 *
4561 * @param {string} tabName
4562 * The name of the section tab to add the option element to.
4563 *
4564 * @param {LuCI.form.AbstractValue} optionclass
4565 * The option class to use for rendering the configuration option. Note
4566 * that this value must be the class itself, not a class instance obtained
4567 * from calling `new`. It must also be a class derived from
4568 * [LuCI.form.AbstractSection]{@link LuCI.form.AbstractSection}.
4569 *
4570 * @param {...*} classargs
4571 * Additional arguments which are passed as-is to the constructor of the
4572 * given option class. Refer to the class specific constructor
4573 * documentation for details.
4574 *
4575 * @throws {ReferenceError}
4576 * Throws a `ReferenceError` exception when the given tab name does not
4577 * exist.
4578 *
4579 * @throws {TypeError}
4580 * Throws a `TypeError` exception in case the passed class value is not a
4581 * descendent of `AbstractValue`.
4582 *
4583 * @returns {LuCI.form.AbstractValue}
4584 * Returns the instantiated option class instance.
4585 */
4586 taboption: function(tabName /*, ... */) {
4587 if (!this.tabs || !this.tabs[tabName])
4588 throw L.error('ReferenceError', 'Associated tab not declared');
4589
4590 var obj = this.option.apply(this, this.varargs(arguments, 1));
4591 obj.tab = tabName;
4592 this.tabs[tabName].children.push(obj);
4593 return obj;
4594 },
4595
4596 /**
4597 * Query underlying option configuration values.
4598 *
4599 * This function is sensitive to the amount of arguments passed to it;
4600 * if only one argument is specified, the configuration values of all
4601 * options within this section are returned as dictionary.
4602 *
4603 * If both the section ID and an option name are supplied, this function
4604 * returns the configuration value of the specified option only.
4605 *
4606 * @param {string} section_id
4607 * The configuration section ID
4608 *
4609 * @param {string} [option]
4610 * The name of the option to query
4611 *
4612 * @returns {null|string|string[]|Object&lt;string, null|string|string[]>}
4613 * Returns either a dictionary of option names and their corresponding
4614 * configuration values or just a single configuration value, depending
4615 * on the amount of passed arguments.
4616 */
4617 cfgvalue: function(section_id, option) {
4618 var rv = (arguments.length == 1) ? {} : null;
4619
4620 for (var i = 0, o; (o = this.children[i]) != null; i++)
4621 if (rv)
4622 rv[o.option] = o.cfgvalue(section_id);
4623 else if (o.option == option)
4624 return o.cfgvalue(section_id);
4625
4626 return rv;
4627 },
4628
4629 /**
4630 * Query underlying option widget input values.
4631 *
4632 * This function is sensitive to the amount of arguments passed to it;
4633 * if only one argument is specified, the widget input values of all
4634 * options within this section are returned as dictionary.
4635 *
4636 * If both the section ID and an option name are supplied, this function
4637 * returns the widget input value of the specified option only.
4638 *
4639 * @param {string} section_id
4640 * The configuration section ID
4641 *
4642 * @param {string} [option]
4643 * The name of the option to query
4644 *
4645 * @returns {null|string|string[]|Object&lt;string, null|string|string[]>}
4646 * Returns either a dictionary of option names and their corresponding
4647 * widget input values or just a single widget input value, depending
4648 * on the amount of passed arguments.
4649 */
4650 formvalue: function(section_id, option) {
4651 var rv = (arguments.length == 1) ? {} : null;
4652
4653 for (var i = 0, o; (o = this.children[i]) != null; i++) {
4654 var func = this.map.root ? this.children[i].formvalue : this.children[i].cfgvalue;
4655
4656 if (rv)
4657 rv[o.option] = func.call(o, section_id);
4658 else if (o.option == option)
4659 return func.call(o, section_id);
4660 }
4661
4662 return rv;
4663 },
4664
4665 /**
4666 * Obtain underlying option LuCI.ui widget instances.
4667 *
4668 * This function is sensitive to the amount of arguments passed to it;
4669 * if only one argument is specified, the LuCI.ui widget instances of all
4670 * options within this section are returned as dictionary.
4671 *
4672 * If both the section ID and an option name are supplied, this function
4673 * returns the LuCI.ui widget instance value of the specified option only.
4674 *
4675 * @param {string} section_id
4676 * The configuration section ID
4677 *
4678 * @param {string} [option]
4679 * The name of the option to query
4680 *
4681 * @returns {null|LuCI.ui.AbstractElement|Object&lt;string, null|LuCI.ui.AbstractElement>}
4682 * Returns either a dictionary of option names and their corresponding
4683 * widget input values or just a single widget input value, depending
4684 * on the amount of passed arguments.
4685 */
4686 getUIElement: function(section_id, option) {
4687 var rv = (arguments.length == 1) ? {} : null;
4688
4689 for (var i = 0, o; (o = this.children[i]) != null; i++)
4690 if (rv)
4691 rv[o.option] = o.getUIElement(section_id);
4692 else if (o.option == option)
4693 return o.getUIElement(section_id);
4694
4695 return rv;
4696 },
4697
4698 /**
4699 * Obtain underlying option objects.
4700 *
4701 * This function is sensitive to the amount of arguments passed to it;
4702 * if no option name is specified, all options within this section are
4703 * returned as dictionary.
4704 *
4705 * If an option name is supplied, this function returns the matching
4706 * LuCI.form.AbstractValue instance only.
4707 *
4708 * @param {string} [option]
4709 * The name of the option object to obtain
4710 *
4711 * @returns {null|LuCI.form.AbstractValue|Object&lt;string, LuCI.form.AbstractValue>}
4712 * Returns either a dictionary of option names and their corresponding
4713 * option instance objects or just a single object instance value,
4714 * depending on the amount of passed arguments.
4715 */
4716 getOption: function(option) {
4717 var rv = (arguments.length == 0) ? {} : null;
4718
4719 for (var i = 0, o; (o = this.children[i]) != null; i++)
4720 if (rv)
4721 rv[o.option] = o;
4722 else if (o.option == option)
4723 return o;
4724
4725 return rv;
4726 },
4727
4728 /** @private */
4729 renderUCISection: function(section_id) {
4730 var renderTasks = [];
4731
4732 if (!this.tabs)
4733 return this.renderOptions(null, section_id);
4734
4735 for (var i = 0; i &lt; this.tab_names.length; i++)
4736 renderTasks.push(this.renderOptions(this.tab_names[i], section_id));
4737
4738 return Promise.all(renderTasks)
4739 .then(this.renderTabContainers.bind(this, section_id));
4740 },
4741
4742 /** @private */
4743 renderTabContainers: function(section_id, nodes) {
4744 var config_name = this.uciconfig || this.map.config,
4745 containerEls = E([]);
4746
4747 for (var i = 0; i &lt; nodes.length; i++) {
4748 var tab_name = this.tab_names[i],
4749 tab_data = this.tabs[tab_name],
4750 containerEl = E('div', {
4751 'id': 'container.%s.%s.%s'.format(config_name, section_id, tab_name),
4752 'data-tab': tab_name,
4753 'data-tab-title': tab_data.title,
4754 'data-tab-active': tab_name === this.selected_tab
4755 });
4756
4757 if (tab_data.description != null &amp;&amp; tab_data.description != '')
4758 containerEl.appendChild(
4759 E('div', { 'class': 'cbi-tab-descr' }, tab_data.description));
4760
4761 containerEl.appendChild(nodes[i]);
4762 containerEls.appendChild(containerEl);
4763 }
4764
4765 return containerEls;
4766 },
4767
4768 /** @private */
4769 renderOptions: function(tab_name, section_id) {
4770 var in_table = (this instanceof CBITableSection);
4771 return this.renderChildren(tab_name, section_id, in_table).then(function(nodes) {
4772 var optionEls = E([]);
4773 for (var i = 0; i &lt; nodes.length; i++)
4774 optionEls.appendChild(nodes[i]);
4775 return optionEls;
4776 });
4777 },
4778
4779 /** @private */
4780 checkDepends: function(ev, n) {
4781 var changed = false,
4782 sids = this.cfgsections();
4783
4784 for (var i = 0, sid = sids[0]; (sid = sids[i]) != null; i++) {
4785 for (var j = 0, o = this.children[0]; (o = this.children[j]) != null; j++) {
4786 var isActive = o.isActive(sid),
4787 isSatisified = o.checkDepends(sid);
4788
4789 if (isActive != isSatisified) {
4790 o.setActive(sid, !isActive);
4791 isActive = !isActive;
4792 changed = true;
4793 }
4794
4795 if (!n &amp;&amp; isActive)
4796 o.triggerValidation(sid);
4797 }
4798 }
4799
4800 return changed;
4801 }
4802 });
4803
4804
4805 var isEqual = function(x, y) {
4806 if (typeof(y) == 'object' &amp;&amp; y instanceof RegExp)
4807 return (x == null) ? false : y.test(x);
4808
4809 if (x != null &amp;&amp; y != null &amp;&amp; typeof(x) != typeof(y))
4810 return false;
4811
4812 if ((x == null &amp;&amp; y != null) || (x != null &amp;&amp; y == null))
4813 return false;
4814
4815 if (Array.isArray(x)) {
4816 if (x.length != y.length)
4817 return false;
4818
4819 for (var i = 0; i &lt; x.length; i++)
4820 if (!isEqual(x[i], y[i]))
4821 return false;
4822 }
4823 else if (typeof(x) == 'object') {
4824 for (var k in x) {
4825 if (x.hasOwnProperty(k) &amp;&amp; !y.hasOwnProperty(k))
4826 return false;
4827
4828 if (!isEqual(x[k], y[k]))
4829 return false;
4830 }
4831
4832 for (var k in y)
4833 if (y.hasOwnProperty(k) &amp;&amp; !x.hasOwnProperty(k))
4834 return false;
4835 }
4836 else if (x != y) {
4837 return false;
4838 }
4839
4840 return true;
4841 };
4842
4843 var isContained = function(x, y) {
4844 if (Array.isArray(x)) {
4845 for (var i = 0; i &lt; x.length; i++)
4846 if (x[i] == y)
4847 return true;
4848 }
4849 else if (L.isObject(x)) {
4850 if (x.hasOwnProperty(y) &amp;&amp; x[y] != null)
4851 return true;
4852 }
4853 else if (typeof(x) == 'string') {
4854 return (x.indexOf(y) > -1);
4855 }
4856
4857 return false;
4858 };
4859
4860 /**
4861 * @class AbstractValue
4862 * @memberof LuCI.form
4863 * @augments LuCI.form.AbstractElement
4864 * @hideconstructor
4865 * @classdesc
4866 *
4867 * The `AbstractValue` class serves as abstract base for the different form
4868 * option styles implemented by `LuCI.form`. It provides the common logic for
4869 * handling option input values, for dependencies among options and for
4870 * validation constraints that should be applied to entered values.
4871 *
4872 * This class is private and not directly accessible by user code.
4873 */
4874 var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractValue.prototype */ {
4875 __init__: function(map, section, option /*, ... */) {
4876 this.super('__init__', this.varargs(arguments, 3));
4877
4878 this.section = section;
4879 this.option = option;
4880 this.map = map;
4881 this.config = map.config;
4882
4883 this.deps = [];
4884 this.initial = {};
4885 this.rmempty = true;
4886 this.default = null;
4887 this.size = null;
4888 this.optional = false;
4889 this.retain = false;
4890 },
4891
4892 /**
4893 * If set to `false`, the underlying option value is retained upon saving
4894 * the form when the option element is disabled due to unsatisfied
4895 * dependency constraints.
4896 *
4897 * @name LuCI.form.AbstractValue.prototype#rmempty
4898 * @type boolean
4899 * @default true
4900 */
4901
4902 /**
4903 * If set to `true`, the underlying ui input widget is allowed to be empty,
4904 * otherwise the option element is marked invalid when no value is entered
4905 * or selected by the user.
4906 *
4907 * @name LuCI.form.AbstractValue.prototype#optional
4908 * @type boolean
4909 * @default false
4910 */
4911
4912 /**
4913 * If set to `true`, the underlying ui input widget value is not cleared
4914 * from the configuration on unsatisfied dependencies. The default behavior
4915 * is to remove the values of all options whose dependencies are not
4916 * fulfilled.
4917 *
4918 * @name LuCI.form.AbstractValue.prototype#retain
4919 * @type boolean
4920 * @default false
4921 */
4922
4923 /**
4924 * Sets a default value to use when the underlying UCI option is not set.
4925 *
4926 * @name LuCI.form.AbstractValue.prototype#default
4927 * @type *
4928 * @default null
4929 */
4930
4931 /**
4932 * Specifies a datatype constraint expression to validate input values
4933 * against. Refer to {@link LuCI.validation} for details on the format.
4934 *
4935 * If the user entered input does not match the datatype validation, the
4936 * option element is marked as invalid.
4937 *
4938 * @name LuCI.form.AbstractValue.prototype#datatype
4939 * @type string
4940 * @default null
4941 */
4942
4943 /**
4944 * Specifies a custom validation function to test the user input for
4945 * validity. The validation function must return `true` to accept the
4946 * value. Any other return value type is converted to a string and
4947 * displayed to the user as validation error message.
4948 *
4949 * If the user entered input does not pass the validation function, the
4950 * option element is marked as invalid.
4951 *
4952 * @name LuCI.form.AbstractValue.prototype#validate
4953 * @type function
4954 * @default null
4955 */
4956
4957 /**
4958 * Override the UCI configuration name to read the option value from.
4959 *
4960 * By default, the configuration name is inherited from the parent Map.
4961 * By setting this property, a deviating configuration may be specified.
4962 *
4963 * The default is null, means inheriting from the parent form.
4964 *
4965 * @name LuCI.form.AbstractValue.prototype#uciconfig
4966 * @type string
4967 * @default null
4968 */
4969
4970 /**
4971 * Override the UCI section name to read the option value from.
4972 *
4973 * By default, the section ID is inherited from the parent section element.
4974 * By setting this property, a deviating section may be specified.
4975 *
4976 * The default is null, means inheriting from the parent section.
4977 *
4978 * @name LuCI.form.AbstractValue.prototype#ucisection
4979 * @type string
4980 * @default null
4981 */
4982
4983 /**
4984 * Override the UCI option name to read the value from.
4985 *
4986 * By default, the elements name, which is passed as third argument to
4987 * the constructor, is used as UCI option name. By setting this property,
4988 * a deviating UCI option may be specified.
4989 *
4990 * The default is null, means using the option element name.
4991 *
4992 * @name LuCI.form.AbstractValue.prototype#ucioption
4993 * @type string
4994 * @default null
4995 */
4996
4997 /**
4998 * Mark grid section option element as editable.
4999 *
5000 * Options which are displayed in the table portion of a `GridSection`
5001 * instance are rendered as readonly text by default. By setting the
5002 * `editable` property of a child option element to `true`, that element
5003 * is rendered as full input widget within its cell instead of a text only
5004 * preview.
5005 *
5006 * This property has no effect on options that are not children of grid
5007 * section elements.
5008 *
5009 * @name LuCI.form.AbstractValue.prototype#editable
5010 * @type boolean
5011 * @default false
5012 */
5013
5014 /**
5015 * Move grid section option element into the table, the modal popup or both.
5016 *
5017 * If this property is `null` (the default), the option element is
5018 * displayed in both the table preview area and the per-section instance
5019 * modal popup of a grid section. When it is set to `false` the option
5020 * is only shown in the table but not the modal popup. When set to `true`,
5021 * the option is only visible in the modal popup but not the table.
5022 *
5023 * This property has no effect on options that are not children of grid
5024 * section elements.
5025 *
5026 * @name LuCI.form.AbstractValue.prototype#modalonly
5027 * @type boolean
5028 * @default null
5029 */
5030
5031 /**
5032 * Make option element readonly.
5033 *
5034 * This property defaults to the readonly state of the parent form element.
5035 * When set to `true`, the underlying widget is rendered in disabled state,
5036 * means its contents cannot be changed and the widget cannot be interacted
5037 * with.
5038 *
5039 * @name LuCI.form.AbstractValue.prototype#readonly
5040 * @type boolean
5041 * @default false
5042 */
5043
5044 /**
5045 * Override the cell width of a table or grid section child option.
5046 *
5047 * If the property is set to a numeric value, it is treated as pixel width
5048 * which is set on the containing cell element of the option, essentially
5049 * forcing a certain column width. When the property is set to a string
5050 * value, it is applied as-is to the CSS `width` property.
5051 *
5052 * This property has no effect on options that are not children of grid or
5053 * table section elements.
5054 *
5055 * @name LuCI.form.AbstractValue.prototype#width
5056 * @type number|string
5057 * @default null
5058 */
5059
5060 /**
5061 * Register a custom value change handler.
5062 *
5063 * If this property is set to a function value, the function is invoked
5064 * whenever the value of the underlying UI input element is changing.
5065 *
5066 * The invoked handler function will receive the DOM click element as
5067 * first and the underlying configuration section ID as well as the input
5068 * value as second and third argument respectively.
5069 *
5070 * @name LuCI.form.AbstractValue.prototype#onchange
5071 * @type function
5072 * @default null
5073 */
5074
5075 /**
5076 * Add a dependency constraint to the option.
5077 *
5078 * Dependency constraints allow making the presence of option elements
5079 * dependent on the current values of certain other options within the
5080 * same form. An option element with unsatisfied dependencies will be
5081 * hidden from the view and its current value is omitted when saving.
5082 *
5083 * Multiple constraints (that is, multiple calls to `depends()`) are
5084 * treated as alternatives, forming a logical "or" expression.
5085 *
5086 * By passing an object of name => value pairs as first argument, it is
5087 * possible to depend on multiple options simultaneously, allowing to form
5088 * a logical "and" expression.
5089 *
5090 * Option names may be given in "dot notation" which allows to reference
5091 * option elements outside the current form section. If a name without
5092 * dot is specified, it refers to an option within the same configuration
5093 * section. If specified as &lt;code>configname.sectionid.optionname&lt;/code>,
5094 * options anywhere within the same form may be specified.
5095 *
5096 * The object notation also allows for a number of special keys which are
5097 * not treated as option names but as modifiers to influence the dependency
5098 * constraint evaluation. The associated value of these special "tag" keys
5099 * is ignored. The recognized tags are:
5100 *
5101 * &lt;ul>
5102 * &lt;li>
5103 * &lt;code>!reverse&lt;/code>&lt;br>
5104 * Invert the dependency, instead of requiring another option to be
5105 * equal to the dependency value, that option should &lt;em>not&lt;/em> be
5106 * equal.
5107 * &lt;/li>
5108 * &lt;li>
5109 * &lt;code>!contains&lt;/code>&lt;br>
5110 * Instead of requiring an exact match, the dependency is considered
5111 * satisfied when the dependency value is contained within the option
5112 * value.
5113 * &lt;/li>
5114 * &lt;li>
5115 * &lt;code>!default&lt;/code>&lt;br>
5116 * The dependency is always satisfied
5117 * &lt;/li>
5118 * &lt;/ul>
5119 *
5120 * Examples:
5121 *
5122 * &lt;ul>
5123 * &lt;li>
5124 * &lt;code>opt.depends("foo", "test")&lt;/code>&lt;br>
5125 * Require the value of `foo` to be `test`.
5126 * &lt;/li>
5127 * &lt;li>
5128 * &lt;code>opt.depends({ foo: "test" })&lt;/code>&lt;br>
5129 * Equivalent to the previous example.
5130 * &lt;/li>
5131 * &lt;li>
5132 * &lt;code>opt.depends({ foo: /test/ })&lt;/code>&lt;br>
5133 * Require the value of `foo` to match the regular expression `/test/`.
5134 * &lt;/li>
5135 * &lt;li>
5136 * &lt;code>opt.depends({ foo: "test", bar: "qrx" })&lt;/code>&lt;br>
5137 * Require the value of `foo` to be `test` and the value of `bar` to be
5138 * `qrx`.
5139 * &lt;/li>
5140 * &lt;li>
5141 * &lt;code>opt.depends({ foo: "test" })&lt;br>
5142 * opt.depends({ bar: "qrx" })&lt;/code>&lt;br>
5143 * Require either &lt;code>foo&lt;/code> to be set to &lt;code>test&lt;/code>,
5144 * &lt;em>or&lt;/em> the &lt;code>bar&lt;/code> option to be &lt;code>qrx&lt;/code>.
5145 * &lt;/li>
5146 * &lt;li>
5147 * &lt;code>opt.depends("test.section1.foo", "bar")&lt;/code>&lt;br>
5148 * Require the "foo" form option within the "section1" section to be
5149 * set to "bar".
5150 * &lt;/li>
5151 * &lt;li>
5152 * &lt;code>opt.depends({ foo: "test", "!contains": true })&lt;/code>&lt;br>
5153 * Require the "foo" option value to contain the substring "test".
5154 * &lt;/li>
5155 * &lt;/ul>
5156 *
5157 * @param {string|Object&lt;string, string|RegExp>} field
5158 * The name of the option to depend on or an object describing multiple
5159 * dependencies which must be satisfied (a logical "and" expression).
5160 *
5161 * @param {string|RegExp} value
5162 * When invoked with a plain option name as first argument, this parameter
5163 * specifies the expected value. In case an object is passed as first
5164 * argument, this parameter is ignored.
5165 */
5166 depends: function(field, value) {
5167 var deps;
5168
5169 if (typeof(field) === 'string')
5170 deps = {}, deps[field] = value;
5171 else
5172 deps = field;
5173
5174 this.deps.push(deps);
5175 },
5176
5177 /** @private */
5178 transformDepList: function(section_id, deplist) {
5179 var list = deplist || this.deps,
5180 deps = [];
5181
5182 if (Array.isArray(list)) {
5183 for (var i = 0; i &lt; list.length; i++) {
5184 var dep = {};
5185
5186 for (var k in list[i]) {
5187 if (list[i].hasOwnProperty(k)) {
5188 if (k.charAt(0) === '!')
5189 dep[k] = list[i][k];
5190 else if (k.indexOf('.') !== -1)
5191 dep['cbid.%s'.format(k)] = list[i][k];
5192 else
5193 dep['cbid.%s.%s.%s'.format(
5194 this.uciconfig || this.section.uciconfig || this.map.config,
5195 this.ucisection || section_id,
5196 k
5197 )] = list[i][k];
5198 }
5199 }
5200
5201 for (var k in dep) {
5202 if (dep.hasOwnProperty(k)) {
5203 deps.push(dep);
5204 break;
5205 }
5206 }
5207 }
5208 }
5209
5210 return deps;
5211 },
5212
5213 /** @private */
5214 transformChoices: function() {
5215 if (!Array.isArray(this.keylist) || this.keylist.length == 0)
5216 return null;
5217
5218 var choices = {};
5219
5220 for (var i = 0; i &lt; this.keylist.length; i++)
5221 choices[this.keylist[i]] = this.vallist[i];
5222
5223 return choices;
5224 },
5225
5226 /** @private */
5227 checkDepends: function(section_id) {
5228 var config_name = this.uciconfig || this.section.uciconfig || this.map.config,
5229 active = this.map.isDependencySatisfied(this.deps, config_name, section_id);
5230
5231 if (active)
5232 this.updateDefaultValue(section_id);
5233
5234 return active;
5235 },
5236
5237 /** @private */
5238 updateDefaultValue: function(section_id) {
5239 if (!L.isObject(this.defaults))
5240 return;
5241
5242 var config_name = this.uciconfig || this.section.uciconfig || this.map.config,
5243 cfgvalue = L.toArray(this.cfgvalue(section_id))[0],
5244 default_defval = null, satisified_defval = null;
5245
5246 for (var value in this.defaults) {
5247 if (!this.defaults[value] || this.defaults[value].length == 0) {
5248 default_defval = value;
5249 continue;
5250 }
5251 else if (this.map.isDependencySatisfied(this.defaults[value], config_name, section_id)) {
5252 satisified_defval = value;
5253 break;
5254 }
5255 }
5256
5257 if (satisified_defval == null)
5258 satisified_defval = default_defval;
5259
5260 var node = this.map.findElement('id', this.cbid(section_id));
5261 if (node &amp;&amp; node.getAttribute('data-changed') != 'true' &amp;&amp; satisified_defval != null &amp;&amp; cfgvalue == null)
5262 dom.callClassMethod(node, 'setValue', satisified_defval);
5263
5264 this.default = satisified_defval;
5265 },
5266
5267 /**
5268 * Obtain the internal ID ("cbid") of the element instance.
5269 *
5270 * Since each form section element may map multiple underlying
5271 * configuration sections, the configuration section ID is required to
5272 * form a fully qualified ID pointing to the specific element instance
5273 * within the given specific section.
5274 *
5275 * @param {string} section_id
5276 * The configuration section ID
5277 *
5278 * @throws {TypeError}
5279 * Throws a `TypeError` exception when no `section_id` was specified.
5280 *
5281 * @returns {string}
5282 * Returns the element ID.
5283 */
5284 cbid: function(section_id) {
5285 if (section_id == null)
5286 L.error('TypeError', 'Section ID required');
5287
5288 return 'cbid.%s.%s.%s'.format(
5289 this.uciconfig || this.section.uciconfig || this.map.config,
5290 section_id, this.option);
5291 },
5292
5293 /**
5294 * Load the underlying configuration value.
5295 *
5296 * The default implementation of this method reads and returns the
5297 * underlying UCI option value (or the related JavaScript property for
5298 * `JSONMap` instances). It may be overwritten by user code to load data
5299 * from nonstandard sources.
5300 *
5301 * @param {string} section_id
5302 * The configuration section ID
5303 *
5304 * @throws {TypeError}
5305 * Throws a `TypeError` exception when no `section_id` was specified.
5306 *
5307 * @returns {*|Promise&lt;*>}
5308 * Returns the configuration value to initialize the option element with.
5309 * The return value of this function is filtered through `Promise.resolve()`
5310 * so it may return promises if overridden by user code.
5311 */
5312 load: function(section_id) {
5313 if (section_id == null)
5314 L.error('TypeError', 'Section ID required');
5315
5316 return this.map.data.get(
5317 this.uciconfig || this.section.uciconfig || this.map.config,
5318 this.ucisection || section_id,
5319 this.ucioption || this.option);
5320 },
5321
5322 /**
5323 * Obtain the underlying `LuCI.ui` element instance.
5324 *
5325 * @param {string} section_id
5326 * The configuration section ID
5327 *
5328 * @throws {TypeError}
5329 * Throws a `TypeError` exception when no `section_id` was specified.
5330 *
5331 * @return {LuCI.ui.AbstractElement|null}
5332 * Returns the `LuCI.ui` element instance or `null` in case the form
5333 * option implementation does not use `LuCI.ui` widgets.
5334 */
5335 getUIElement: function(section_id) {
5336 var node = this.map.findElement('id', this.cbid(section_id)),
5337 inst = node ? dom.findClassInstance(node) : null;
5338 return (inst instanceof ui.AbstractElement) ? inst : null;
5339 },
5340
5341 /**
5342 * Query the underlying configuration value.
5343 *
5344 * The default implementation of this method returns the cached return
5345 * value of [load()]{@link LuCI.form.AbstractValue#load}. It may be
5346 * overwritten by user code to obtain the configuration value in a
5347 * different way.
5348 *
5349 * @param {string} section_id
5350 * The configuration section ID
5351 *
5352 * @throws {TypeError}
5353 * Throws a `TypeError` exception when no `section_id` was specified.
5354 *
5355 * @returns {*}
5356 * Returns the configuration value.
5357 */
5358 cfgvalue: function(section_id, set_value) {
5359 if (section_id == null)
5360 L.error('TypeError', 'Section ID required');
5361
5362 if (arguments.length == 2) {
5363 this.data = this.data || {};
5364 this.data[section_id] = set_value;
5365 }
5366
5367 return this.data ? this.data[section_id] : null;
5368 },
5369
5370 /**
5371 * Query the current form input value.
5372 *
5373 * The default implementation of this method returns the current input
5374 * value of the underlying [LuCI.ui]{@link LuCI.ui.AbstractElement} widget.
5375 * It may be overwritten by user code to handle input values differently.
5376 *
5377 * @param {string} section_id
5378 * The configuration section ID
5379 *
5380 * @throws {TypeError}
5381 * Throws a `TypeError` exception when no `section_id` was specified.
5382 *
5383 * @returns {*}
5384 * Returns the current input value.
5385 */
5386 formvalue: function(section_id) {
5387 var elem = this.getUIElement(section_id);
5388 return elem ? elem.getValue() : null;
5389 },
5390
5391 /**
5392 * Obtain a textual input representation.
5393 *
5394 * The default implementation of this method returns the HTML escaped
5395 * current input value of the underlying
5396 * [LuCI.ui]{@link LuCI.ui.AbstractElement} widget. User code or specific
5397 * option element implementations may overwrite this function to apply a
5398 * different logic, e.g. to return `Yes` or `No` depending on the checked
5399 * state of checkbox elements.
5400 *
5401 * @param {string} section_id
5402 * The configuration section ID
5403 *
5404 * @throws {TypeError}
5405 * Throws a `TypeError` exception when no `section_id` was specified.
5406 *
5407 * @returns {string}
5408 * Returns the text representation of the current input value.
5409 */
5410 textvalue: function(section_id) {
5411 var cval = this.cfgvalue(section_id);
5412
5413 if (cval == null)
5414 cval = this.default;
5415
5416 if (Array.isArray(cval))
5417 cval = cval.join(' ');
5418
5419 return (cval != null) ? '%h'.format(cval) : null;
5420 },
5421
5422 /**
5423 * Apply custom validation logic.
5424 *
5425 * This method is invoked whenever incremental validation is performed on
5426 * the user input, e.g. on keyup or blur events.
5427 *
5428 * The default implementation of this method does nothing and always
5429 * returns `true`. User code may overwrite this method to provide
5430 * additional validation logic which is not covered by data type
5431 * constraints.
5432 *
5433 * @abstract
5434 * @param {string} section_id
5435 * The configuration section ID
5436 *
5437 * @param {*} value
5438 * The value to validate
5439 *
5440 * @returns {*}
5441 * The method shall return `true` to accept the given value. Any other
5442 * return value is treated as failure, converted to a string and displayed
5443 * as error message to the user.
5444 */
5445 validate: function(section_id, value) {
5446 return true;
5447 },
5448
5449 /**
5450 * Test whether the input value is currently valid.
5451 *
5452 * @param {string} section_id
5453 * The configuration section ID
5454 *
5455 * @returns {boolean}
5456 * Returns `true` if the input value currently is valid, otherwise it
5457 * returns `false`.
5458 */
5459 isValid: function(section_id) {
5460 var elem = this.getUIElement(section_id);
5461 return elem ? elem.isValid() : true;
5462 },
5463
5464 /**
5465 * Returns the current validation error for this input.
5466 *
5467 * @param {string} section_id
5468 * The configuration section ID
5469 *
5470 * @returns {string}
5471 * The validation error at this time
5472 */
5473 getValidationError: function (section_id) {
5474 var elem = this.getUIElement(section_id);
5475 return elem ? elem.getValidationError() : '';
5476 },
5477
5478 /**
5479 * Test whether the option element is currently active.
5480 *
5481 * An element is active when it is not hidden due to unsatisfied dependency
5482 * constraints.
5483 *
5484 * @param {string} section_id
5485 * The configuration section ID
5486 *
5487 * @returns {boolean}
5488 * Returns `true` if the option element currently is active, otherwise it
5489 * returns `false`.
5490 */
5491 isActive: function(section_id) {
5492 var field = this.map.findElement('data-field', this.cbid(section_id));
5493 return (field != null &amp;&amp; !field.classList.contains('hidden'));
5494 },
5495
5496 /** @private */
5497 setActive: function(section_id, active) {
5498 var field = this.map.findElement('data-field', this.cbid(section_id));
5499
5500 if (field &amp;&amp; field.classList.contains('hidden') == active) {
5501 field.classList[active ? 'remove' : 'add']('hidden');
5502
5503 if (dom.matches(field.parentNode, '.td.cbi-value-field'))
5504 field.parentNode.classList[active ? 'remove' : 'add']('inactive');
5505
5506 return true;
5507 }
5508
5509 return false;
5510 },
5511
5512 /** @private */
5513 triggerValidation: function(section_id) {
5514 var elem = this.getUIElement(section_id);
5515 return elem ? elem.triggerValidation() : true;
5516 },
5517
5518 /**
5519 * Parse the option element input.
5520 *
5521 * The function is invoked when the `parse()` method has been invoked on
5522 * the parent form and triggers input value reading and validation.
5523 *
5524 * @param {string} section_id
5525 * The configuration section ID
5526 *
5527 * @returns {Promise&lt;void>}
5528 * Returns a promise resolving once the input value has been read and
5529 * validated or rejecting in case the input value does not meet the
5530 * validation constraints.
5531 */
5532 parse: function(section_id) {
5533 var active = this.isActive(section_id);
5534
5535 if (active &amp;&amp; !this.isValid(section_id)) {
5536 var title = this.stripTags(this.title).trim(),
5537 error = this.getValidationError(section_id);
5538
5539 return Promise.reject(new TypeError(
5540 _('Option "%s" contains an invalid input value.').format(title || this.option) + ' ' + error));
5541 }
5542
5543 if (active) {
5544 var cval = this.cfgvalue(section_id),
5545 fval = this.formvalue(section_id);
5546
5547 if (fval == null || fval == '') {
5548 if (this.rmempty || this.optional) {
5549 return Promise.resolve(this.remove(section_id));
5550 }
5551 else {
5552 var title = this.stripTags(this.title).trim();
5553
5554 return Promise.reject(new TypeError(
5555 _('Option "%s" must not be empty.').format(title || this.option)));
5556 }
5557 }
5558 else if (this.forcewrite || !isEqual(cval, fval)) {
5559 return Promise.resolve(this.write(section_id, fval));
5560 }
5561 }
5562 else if (!this.retain) {
5563 return Promise.resolve(this.remove(section_id));
5564 }
5565
5566 return Promise.resolve();
5567 },
5568
5569 /**
5570 * Write the current input value into the configuration.
5571 *
5572 * This function is invoked upon saving the parent form when the option
5573 * element is valid and when its input value has been changed compared to
5574 * the initial value returned by
5575 * [cfgvalue()]{@link LuCI.form.AbstractValue#cfgvalue}.
5576 *
5577 * The default implementation simply sets the given input value in the
5578 * UCI configuration (or the associated JavaScript object property in
5579 * case of `JSONMap` forms). It may be overwritten by user code to
5580 * implement alternative save logic, e.g. to transform the input value
5581 * before it is written.
5582 *
5583 * @param {string} section_id
5584 * The configuration section ID
5585 *
5586 * @param {string|string[]} formvalue
5587 * The input value to write.
5588 */
5589 write: function(section_id, formvalue) {
5590 return this.map.data.set(
5591 this.uciconfig || this.section.uciconfig || this.map.config,
5592 this.ucisection || section_id,
5593 this.ucioption || this.option,
5594 formvalue);
5595 },
5596
5597 /**
5598 * Remove the corresponding value from the configuration.
5599 *
5600 * This function is invoked upon saving the parent form when the option
5601 * element has been hidden due to unsatisfied dependencies or when the
5602 * user cleared the input value and the option is marked optional.
5603 *
5604 * The default implementation simply removes the associated option from the
5605 * UCI configuration (or the associated JavaScript object property in
5606 * case of `JSONMap` forms). It may be overwritten by user code to
5607 * implement alternative removal logic, e.g. to retain the original value.
5608 *
5609 * @param {string} section_id
5610 * The configuration section ID
5611 */
5612 remove: function(section_id) {
5613 var this_cfg = this.uciconfig || this.section.uciconfig || this.map.config,
5614 this_sid = this.ucisection || section_id,
5615 this_opt = this.ucioption || this.option;
5616
5617 for (var i = 0; i &lt; this.section.children.length; i++) {
5618 var sibling = this.section.children[i];
5619
5620 if (sibling === this || sibling.ucioption == null)
5621 continue;
5622
5623 var sibling_cfg = sibling.uciconfig || sibling.section.uciconfig || sibling.map.config,
5624 sibling_sid = sibling.ucisection || section_id,
5625 sibling_opt = sibling.ucioption || sibling.option;
5626
5627 if (this_cfg != sibling_cfg || this_sid != sibling_sid || this_opt != sibling_opt)
5628 continue;
5629
5630 if (!sibling.isActive(section_id))
5631 continue;
5632
5633 /* found another active option aliasing the same uci option name,
5634 * so we can't remove the value */
5635 return;
5636 }
5637
5638 this.map.data.unset(this_cfg, this_sid, this_opt);
5639 }
5640 });
5641
5642 /**
5643 * @class TypedSection
5644 * @memberof LuCI.form
5645 * @augments LuCI.form.AbstractSection
5646 * @hideconstructor
5647 * @classdesc
5648 *
5649 * The `TypedSection` class maps all or - if `filter()` is overwritten - a
5650 * subset of the underlying UCI configuration sections of a given type.
5651 *
5652 * Layout wise, the configuration section instances mapped by the section
5653 * element (sometimes referred to as "section nodes") are stacked beneath
5654 * each other in a single column, with an optional section remove button next
5655 * to each section node and a section add button at the end, depending on the
5656 * value of the `addremove` property.
5657 *
5658 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
5659 * The configuration form this section is added to. It is automatically passed
5660 * by [section()]{@link LuCI.form.Map#section}.
5661 *
5662 * @param {string} section_type
5663 * The type of the UCI section to map.
5664 *
5665 * @param {string} [title]
5666 * The title caption of the form section element.
5667 *
5668 * @param {string} [description]
5669 * The description text of the form section element.
5670 */
5671 var CBITypedSection = CBIAbstractSection.extend(/** @lends LuCI.form.TypedSection.prototype */ {
5672 __name__: 'CBI.TypedSection',
5673
5674 /**
5675 * If set to `true`, the user may add or remove instances from the form
5676 * section widget, otherwise only preexisting sections may be edited.
5677 * The default is `false`.
5678 *
5679 * @name LuCI.form.TypedSection.prototype#addremove
5680 * @type boolean
5681 * @default false
5682 */
5683
5684 /**
5685 * If set to `true`, mapped section instances are treated as anonymous
5686 * UCI sections, which means that section instance elements will be
5687 * rendered without title element and that no name is required when adding
5688 * new sections. The default is `false`.
5689 *
5690 * @name LuCI.form.TypedSection.prototype#anonymous
5691 * @type boolean
5692 * @default false
5693 */
5694
5695 /**
5696 * When set to `true`, instead of rendering section instances one below
5697 * another, treat each instance as separate tab pane and render a tab menu
5698 * at the top of the form section element, allowing the user to switch
5699 * among instances. The default is `false`.
5700 *
5701 * @name LuCI.form.TypedSection.prototype#tabbed
5702 * @type boolean
5703 * @default false
5704 */
5705
5706 /**
5707 * Override the caption used for the section add button at the bottom of
5708 * the section form element. If set to a string, it will be used as-is,
5709 * if set to a function, the function will be invoked and its return value
5710 * is used as caption, after converting it to a string. If this property
5711 * is not set, the default is `Add`.
5712 *
5713 * @name LuCI.form.TypedSection.prototype#addbtntitle
5714 * @type string|function
5715 * @default null
5716 */
5717
5718 /**
5719 * Override the UCI configuration name to read the section IDs from. By
5720 * default, the configuration name is inherited from the parent `Map`.
5721 * By setting this property, a deviating configuration may be specified.
5722 * The default is `null`, means inheriting from the parent form.
5723 *
5724 * @name LuCI.form.TypedSection.prototype#uciconfig
5725 * @type string
5726 * @default null
5727 */
5728
5729 /** @override */
5730 cfgsections: function() {
5731 return this.map.data.sections(this.uciconfig || this.map.config, this.sectiontype)
5732 .map(function(s) { return s['.name'] })
5733 .filter(L.bind(this.filter, this));
5734 },
5735
5736 /** @private */
5737 handleAdd: function(ev, name) {
5738 var config_name = this.uciconfig || this.map.config;
5739
5740 this.map.data.add(config_name, this.sectiontype, name);
5741 return this.map.save(null, true);
5742 },
5743
5744 /** @private */
5745 handleRemove: function(section_id, ev) {
5746 var config_name = this.uciconfig || this.map.config;
5747
5748 this.map.data.remove(config_name, section_id);
5749 return this.map.save(null, true);
5750 },
5751
5752 /** @private */
5753 renderSectionAdd: function(extra_class) {
5754 if (!this.addremove)
5755 return E([]);
5756
5757 var createEl = E('div', { 'class': 'cbi-section-create' }),
5758 config_name = this.uciconfig || this.map.config,
5759 btn_title = this.titleFn('addbtntitle');
5760
5761 if (extra_class != null)
5762 createEl.classList.add(extra_class);
5763
5764 if (this.anonymous) {
5765 createEl.appendChild(E('button', {
5766 'class': 'cbi-button cbi-button-add',
5767 'title': btn_title || _('Add'),
5768 'click': ui.createHandlerFn(this, 'handleAdd'),
5769 'disabled': this.map.readonly || null
5770 }, [ btn_title || _('Add') ]));
5771 }
5772 else {
5773 var nameEl = E('input', {
5774 'type': 'text',
5775 'class': 'cbi-section-create-name',
5776 'disabled': this.map.readonly || null
5777 });
5778
5779 dom.append(createEl, [
5780 E('div', {}, nameEl),
5781 E('button', {
5782 'class': 'cbi-button cbi-button-add',
5783 'title': btn_title || _('Add'),
5784 'click': ui.createHandlerFn(this, function(ev) {
5785 if (nameEl.classList.contains('cbi-input-invalid'))
5786 return;
5787
5788 return this.handleAdd(ev, nameEl.value);
5789 }),
5790 'disabled': this.map.readonly || true
5791 }, [ btn_title || _('Add') ])
5792 ]);
5793
5794 if (this.map.readonly !== true) {
5795 ui.addValidator(nameEl, 'uciname', true, function(v) {
5796 var button = createEl.querySelector('.cbi-section-create > .cbi-button-add');
5797 if (v !== '') {
5798 button.disabled = null;
5799 return true;
5800 }
5801 else {
5802 button.disabled = true;
5803 return _('Expecting: %s').format(_('non-empty value'));
5804 }
5805 }, 'blur', 'keyup');
5806 }
5807 }
5808
5809 return createEl;
5810 },
5811
5812 /** @private */
5813 renderSectionPlaceholder: function() {
5814 return E('em', _('This section contains no values yet'));
5815 },
5816
5817 /** @private */
5818 renderContents: function(cfgsections, nodes) {
5819 var section_id = null,
5820 config_name = this.uciconfig || this.map.config,
5821 sectionEl = E('div', {
5822 'id': 'cbi-%s-%s'.format(config_name, this.sectiontype),
5823 'class': 'cbi-section',
5824 'data-tab': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.sectiontype : null,
5825 'data-tab-title': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.title || this.sectiontype : null
5826 });
5827
5828 if (this.title != null &amp;&amp; this.title != '')
5829 sectionEl.appendChild(E('h3', {}, this.title));
5830
5831 if (this.description != null &amp;&amp; this.description != '')
5832 sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description));
5833
5834 for (var i = 0; i &lt; nodes.length; i++) {
5835 if (this.addremove) {
5836 sectionEl.appendChild(
5837 E('div', { 'class': 'cbi-section-remove right' },
5838 E('button', {
5839 'class': 'cbi-button',
5840 'name': 'cbi.rts.%s.%s'.format(config_name, cfgsections[i]),
5841 'data-section-id': cfgsections[i],
5842 'click': ui.createHandlerFn(this, 'handleRemove', cfgsections[i]),
5843 'disabled': this.map.readonly || null
5844 }, [ _('Delete') ])));
5845 }
5846
5847 if (!this.anonymous)
5848 sectionEl.appendChild(E('h3', cfgsections[i].toUpperCase()));
5849
5850 sectionEl.appendChild(E('div', {
5851 'id': 'cbi-%s-%s'.format(config_name, cfgsections[i]),
5852 'class': this.tabs
5853 ? 'cbi-section-node cbi-section-node-tabbed' : 'cbi-section-node',
5854 'data-section-id': cfgsections[i]
5855 }, nodes[i]));
5856 }
5857
5858 if (nodes.length == 0)
5859 sectionEl.appendChild(this.renderSectionPlaceholder());
5860
5861 sectionEl.appendChild(this.renderSectionAdd());
5862
5863 dom.bindClassInstance(sectionEl, this);
5864
5865 return sectionEl;
5866 },
5867
5868 /** @override */
5869 render: function() {
5870 var cfgsections = this.cfgsections(),
5871 renderTasks = [];
5872
5873 for (var i = 0; i &lt; cfgsections.length; i++)
5874 renderTasks.push(this.renderUCISection(cfgsections[i]));
5875
5876 return Promise.all(renderTasks).then(this.renderContents.bind(this, cfgsections));
5877 }
5878 });
5879
5880 /**
5881 * @class TableSection
5882 * @memberof LuCI.form
5883 * @augments LuCI.form.TypedSection
5884 * @hideconstructor
5885 * @classdesc
5886 *
5887 * The `TableSection` class maps all or - if `filter()` is overwritten - a
5888 * subset of the underlying UCI configuration sections of a given type.
5889 *
5890 * Layout wise, the configuration section instances mapped by the section
5891 * element (sometimes referred to as "section nodes") are rendered as rows
5892 * within an HTML table element, with an optional section remove button in the
5893 * last column and a section add button below the table, depending on the
5894 * value of the `addremove` property.
5895 *
5896 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
5897 * The configuration form this section is added to. It is automatically passed
5898 * by [section()]{@link LuCI.form.Map#section}.
5899 *
5900 * @param {string} section_type
5901 * The type of the UCI section to map.
5902 *
5903 * @param {string} [title]
5904 * The title caption of the form section element.
5905 *
5906 * @param {string} [description]
5907 * The description text of the form section element.
5908 */
5909 var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.prototype */ {
5910 __name__: 'CBI.TableSection',
5911
5912 /**
5913 * If set to `true`, the user may add or remove instances from the form
5914 * section widget, otherwise only preexisting sections may be edited.
5915 * The default is `false`.
5916 *
5917 * @name LuCI.form.TableSection.prototype#addremove
5918 * @type boolean
5919 * @default false
5920 */
5921
5922 /**
5923 * If set to `true`, mapped section instances are treated as anonymous
5924 * UCI sections, which means that section instance elements will be
5925 * rendered without title element and that no name is required when adding
5926 * new sections. The default is `false`.
5927 *
5928 * @name LuCI.form.TableSection.prototype#anonymous
5929 * @type boolean
5930 * @default false
5931 */
5932
5933 /**
5934 * Override the caption used for the section add button at the bottom of
5935 * the section form element. If set to a string, it will be used as-is,
5936 * if set to a function, the function will be invoked and its return value
5937 * is used as caption, after converting it to a string. If this property
5938 * is not set, the default is `Add`.
5939 *
5940 * @name LuCI.form.TableSection.prototype#addbtntitle
5941 * @type string|function
5942 * @default null
5943 */
5944
5945 /**
5946 * Override the per-section instance title caption shown in the first
5947 * column of the table unless `anonymous` is set to true. If set to a
5948 * string, it will be used as `String.format()` pattern with the name of
5949 * the underlying UCI section as first argument, if set to a function, the
5950 * function will be invoked with the section name as first argument and
5951 * its return value is used as caption, after converting it to a string.
5952 * If this property is not set, the default is the name of the underlying
5953 * UCI configuration section.
5954 *
5955 * @name LuCI.form.TableSection.prototype#sectiontitle
5956 * @type string|function
5957 * @default null
5958 */
5959
5960 /**
5961 * Override the per-section instance modal popup title caption shown when
5962 * clicking the `More…` button in a section specifying `max_cols`. If set
5963 * to a string, it will be used as `String.format()` pattern with the name
5964 * of the underlying UCI section as first argument, if set to a function,
5965 * the function will be invoked with the section name as first argument and
5966 * its return value is used as caption, after converting it to a string.
5967 * If this property is not set, the default is the name of the underlying
5968 * UCI configuration section.
5969 *
5970 * @name LuCI.form.TableSection.prototype#modaltitle
5971 * @type string|function
5972 * @default null
5973 */
5974
5975 /**
5976 * Override the UCI configuration name to read the section IDs from. By
5977 * default, the configuration name is inherited from the parent `Map`.
5978 * By setting this property, a deviating configuration may be specified.
5979 * The default is `null`, means inheriting from the parent form.
5980 *
5981 * @name LuCI.form.TableSection.prototype#uciconfig
5982 * @type string
5983 * @default null
5984 */
5985
5986 /**
5987 * Specify a maximum amount of columns to display. By default, one table
5988 * column is rendered for each child option of the form section element.
5989 * When this option is set to a positive number, then no more columns than
5990 * the given amount are rendered. When the number of child options exceeds
5991 * the specified amount, a `More…` button is rendered in the last column,
5992 * opening a modal dialog presenting all options elements in `NamedSection`
5993 * style when clicked.
5994 *
5995 * @name LuCI.form.TableSection.prototype#max_cols
5996 * @type number
5997 * @default null
5998 */
5999
6000 /**
6001 * If set to `true`, alternating `cbi-rowstyle-1` and `cbi-rowstyle-2` CSS
6002 * classes are added to the table row elements. Not all LuCI themes
6003 * implement these row style classes. The default is `false`.
6004 *
6005 * @name LuCI.form.TableSection.prototype#rowcolors
6006 * @type boolean
6007 * @default false
6008 */
6009
6010 /**
6011 * Enables a per-section instance row `Edit` button which triggers a certain
6012 * action when clicked. If set to a string, the string value is used
6013 * as `String.format()` pattern with the name of the underlying UCI section
6014 * as first format argument. The result is then interpreted as URL which
6015 * LuCI will navigate to when the user clicks the edit button.
6016 *
6017 * If set to a function, this function will be registered as click event
6018 * handler on the rendered edit button, receiving the section instance
6019 * name as first and the DOM click event as second argument.
6020 *
6021 * @name LuCI.form.TableSection.prototype#extedit
6022 * @type string|function
6023 * @default null
6024 */
6025
6026 /**
6027 * If set to `true`, a sort button is added to the last column, allowing
6028 * the user to reorder the section instances mapped by the section form
6029 * element.
6030 *
6031 * @name LuCI.form.TableSection.prototype#sortable
6032 * @type boolean
6033 * @default false
6034 */
6035
6036 /**
6037 * If set to `true`, the header row with the options descriptions will
6038 * not be displayed. By default, descriptions row is automatically displayed
6039 * when at least one option has a description.
6040 *
6041 * @name LuCI.form.TableSection.prototype#nodescriptions
6042 * @type boolean
6043 * @default false
6044 */
6045
6046 /**
6047 * The `TableSection` implementation does not support option tabbing, so
6048 * its implementation of `tab()` will always throw an exception when
6049 * invoked.
6050 *
6051 * @override
6052 * @throws Throws an exception when invoked.
6053 */
6054 tab: function() {
6055 throw 'Tabs are not supported by TableSection';
6056 },
6057
6058 /** @private */
6059 renderContents: function(cfgsections, nodes) {
6060 var section_id = null,
6061 config_name = this.uciconfig || this.map.config,
6062 max_cols = isNaN(this.max_cols) ? this.children.length : this.max_cols,
6063 has_more = max_cols &lt; this.children.length,
6064 drag_sort = this.sortable &amp;&amp; !('ontouchstart' in window),
6065 touch_sort = this.sortable &amp;&amp; ('ontouchstart' in window),
6066 sectionEl = E('div', {
6067 'id': 'cbi-%s-%s'.format(config_name, this.sectiontype),
6068 'class': 'cbi-section cbi-tblsection',
6069 'data-tab': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.sectiontype : null,
6070 'data-tab-title': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.title || this.sectiontype : null
6071 }),
6072 tableEl = E('table', {
6073 'class': 'table cbi-section-table'
6074 });
6075
6076 if (this.title != null &amp;&amp; this.title != '')
6077 sectionEl.appendChild(E('h3', {}, this.title));
6078
6079 if (this.description != null &amp;&amp; this.description != '')
6080 sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description));
6081
6082 tableEl.appendChild(this.renderHeaderRows(max_cols));
6083
6084 for (var i = 0; i &lt; nodes.length; i++) {
6085 var sectionname = this.titleFn('sectiontitle', cfgsections[i]);
6086
6087 if (sectionname == null)
6088 sectionname = cfgsections[i];
6089
6090 var trEl = E('tr', {
6091 'id': 'cbi-%s-%s'.format(config_name, cfgsections[i]),
6092 'class': 'tr cbi-section-table-row',
6093 'data-sid': cfgsections[i],
6094 'draggable': (drag_sort || touch_sort) ? true : null,
6095 'mousedown': drag_sort ? L.bind(this.handleDragInit, this) : null,
6096 'dragstart': drag_sort ? L.bind(this.handleDragStart, this) : null,
6097 'dragover': drag_sort ? L.bind(this.handleDragOver, this) : null,
6098 'dragenter': drag_sort ? L.bind(this.handleDragEnter, this) : null,
6099 'dragleave': drag_sort ? L.bind(this.handleDragLeave, this) : null,
6100 'dragend': drag_sort ? L.bind(this.handleDragEnd, this) : null,
6101 'drop': drag_sort ? L.bind(this.handleDrop, this) : null,
6102 'touchmove': touch_sort ? L.bind(this.handleTouchMove, this) : null,
6103 'touchend': touch_sort ? L.bind(this.handleTouchEnd, this) : null,
6104 'data-title': (sectionname &amp;&amp; (!this.anonymous || this.sectiontitle)) ? sectionname : null,
6105 'data-section-id': cfgsections[i]
6106 });
6107
6108 if (this.extedit || this.rowcolors)
6109 trEl.classList.add(!(tableEl.childNodes.length % 2)
6110 ? 'cbi-rowstyle-1' : 'cbi-rowstyle-2');
6111
6112 for (var j = 0; j &lt; max_cols &amp;&amp; nodes[i].firstChild; j++)
6113 trEl.appendChild(nodes[i].firstChild);
6114
6115 trEl.appendChild(this.renderRowActions(cfgsections[i], has_more ? _('More…') : null));
6116 tableEl.appendChild(trEl);
6117 }
6118
6119 if (nodes.length == 0)
6120 tableEl.appendChild(E('tr', { 'class': 'tr cbi-section-table-row placeholder' },
6121 E('td', { 'class': 'td' }, this.renderSectionPlaceholder())));
6122
6123 sectionEl.appendChild(tableEl);
6124
6125 sectionEl.appendChild(this.renderSectionAdd('cbi-tblsection-create'));
6126
6127 dom.bindClassInstance(sectionEl, this);
6128
6129 return sectionEl;
6130 },
6131
6132 /** @private */
6133 renderHeaderRows: function(max_cols, has_action) {
6134 var has_titles = false,
6135 has_descriptions = false,
6136 max_cols = isNaN(this.max_cols) ? this.children.length : this.max_cols,
6137 has_more = max_cols &lt; this.children.length,
6138 anon_class = (!this.anonymous || this.sectiontitle) ? 'named' : 'anonymous',
6139 trEls = E([]);
6140
6141 for (var i = 0, opt; i &lt; max_cols &amp;&amp; (opt = this.children[i]) != null; i++) {
6142 if (opt.modalonly)
6143 continue;
6144
6145 has_titles = has_titles || !!opt.title;
6146 has_descriptions = has_descriptions || !!opt.description;
6147 }
6148
6149 if (has_titles) {
6150 var trEl = E('tr', {
6151 'class': 'tr cbi-section-table-titles ' + anon_class,
6152 'data-title': (!this.anonymous || this.sectiontitle) ? _('Name') : null,
6153 'click': this.sortable ? ui.createHandlerFn(this, 'handleSort') : null
6154 });
6155
6156 for (var i = 0, opt; i &lt; max_cols &amp;&amp; (opt = this.children[i]) != null; i++) {
6157 if (opt.modalonly)
6158 continue;
6159
6160 trEl.appendChild(E('th', {
6161 'class': 'th cbi-section-table-cell',
6162 'data-widget': opt.__name__,
6163 'data-sortable-row': this.sortable ? '' : null
6164 }));
6165
6166 if (opt.width != null)
6167 trEl.lastElementChild.style.width =
6168 (typeof(opt.width) == 'number') ? opt.width+'px' : opt.width;
6169
6170 if (opt.titleref)
6171 trEl.lastElementChild.appendChild(E('a', {
6172 'href': opt.titleref,
6173 'class': 'cbi-title-ref',
6174 'title': this.titledesc || _('Go to relevant configuration page')
6175 }, opt.title));
6176 else
6177 dom.content(trEl.lastElementChild, opt.title);
6178 }
6179
6180 if (this.sortable || this.extedit || this.addremove || has_more || has_action)
6181 trEl.appendChild(E('th', {
6182 'class': 'th cbi-section-table-cell cbi-section-actions'
6183 }));
6184
6185 trEls.appendChild(trEl);
6186 }
6187
6188 if (has_descriptions &amp;&amp; !this.nodescriptions) {
6189 var trEl = E('tr', {
6190 'class': 'tr cbi-section-table-descr ' + anon_class
6191 });
6192
6193 for (var i = 0, opt; i &lt; max_cols &amp;&amp; (opt = this.children[i]) != null; i++) {
6194 if (opt.modalonly)
6195 continue;
6196
6197 trEl.appendChild(E('th', {
6198 'class': 'th cbi-section-table-cell',
6199 'data-widget': opt.__name__
6200 }, opt.description));
6201
6202 if (opt.width != null)
6203 trEl.lastElementChild.style.width =
6204 (typeof(opt.width) == 'number') ? opt.width+'px' : opt.width;
6205 }
6206
6207 if (this.sortable || this.extedit || this.addremove || has_more || has_action)
6208 trEl.appendChild(E('th', {
6209 'class': 'th cbi-section-table-cell cbi-section-actions'
6210 }));
6211
6212 trEls.appendChild(trEl);
6213 }
6214
6215 return trEls;
6216 },
6217
6218 /** @private */
6219 renderRowActions: function(section_id, more_label) {
6220 var config_name = this.uciconfig || this.map.config;
6221
6222 if (!this.sortable &amp;&amp; !this.extedit &amp;&amp; !this.addremove &amp;&amp; !more_label)
6223 return E([]);
6224
6225 var tdEl = E('td', {
6226 'class': 'td cbi-section-table-cell nowrap cbi-section-actions'
6227 }, E('div'));
6228
6229 if (this.sortable) {
6230 dom.append(tdEl.lastElementChild, [
6231 E('button', {
6232 'title': _('Drag to reorder'),
6233 'class': 'cbi-button drag-handle center',
6234 'style': 'cursor:move',
6235 'disabled': this.map.readonly || null
6236 }, '☰')
6237 ]);
6238 }
6239
6240 if (this.extedit) {
6241 var evFn = null;
6242
6243 if (typeof(this.extedit) == 'function')
6244 evFn = L.bind(this.extedit, this);
6245 else if (typeof(this.extedit) == 'string')
6246 evFn = L.bind(function(sid, ev) {
6247 location.href = this.extedit.format(sid);
6248 }, this, section_id);
6249
6250 dom.append(tdEl.lastElementChild,
6251 E('button', {
6252 'title': _('Edit'),
6253 'class': 'cbi-button cbi-button-edit',
6254 'click': evFn
6255 }, [ _('Edit') ])
6256 );
6257 }
6258
6259 if (more_label) {
6260 dom.append(tdEl.lastElementChild,
6261 E('button', {
6262 'title': more_label,
6263 'class': 'cbi-button cbi-button-edit',
6264 'click': ui.createHandlerFn(this, 'renderMoreOptionsModal', section_id)
6265 }, [ more_label ])
6266 );
6267 }
6268
6269 if (this.addremove) {
6270 var btn_title = this.titleFn('removebtntitle', section_id);
6271
6272 dom.append(tdEl.lastElementChild,
6273 E('button', {
6274 'title': btn_title || _('Delete'),
6275 'class': 'cbi-button cbi-button-remove',
6276 'click': ui.createHandlerFn(this, 'handleRemove', section_id),
6277 'disabled': this.map.readonly || null
6278 }, [ btn_title || _('Delete') ])
6279 );
6280 }
6281
6282 return tdEl;
6283 },
6284
6285 /** @private */
6286 handleDragInit: function(ev) {
6287 scope.dragState = { node: ev.target };
6288 },
6289
6290 /** @private */
6291 handleDragStart: function(ev) {
6292 if (!scope.dragState || !scope.dragState.node.classList.contains('drag-handle')) {
6293 scope.dragState = null;
6294 ev.preventDefault();
6295 return false;
6296 }
6297
6298 scope.dragState.node = dom.parent(scope.dragState.node, '.tr');
6299 ev.dataTransfer.setData('text', 'drag');
6300 ev.target.style.opacity = 0.4;
6301 },
6302
6303 /** @private */
6304 handleDragOver: function(ev) {
6305 var n = scope.dragState.targetNode,
6306 r = scope.dragState.rect,
6307 t = r.top + r.height / 2;
6308
6309 if (ev.clientY &lt;= t) {
6310 n.classList.remove('drag-over-below');
6311 n.classList.add('drag-over-above');
6312 }
6313 else {
6314 n.classList.remove('drag-over-above');
6315 n.classList.add('drag-over-below');
6316 }
6317
6318 ev.dataTransfer.dropEffect = 'move';
6319 ev.preventDefault();
6320 return false;
6321 },
6322
6323 /** @private */
6324 handleDragEnter: function(ev) {
6325 scope.dragState.rect = ev.currentTarget.getBoundingClientRect();
6326 scope.dragState.targetNode = ev.currentTarget;
6327 },
6328
6329 /** @private */
6330 handleDragLeave: function(ev) {
6331 ev.currentTarget.classList.remove('drag-over-above');
6332 ev.currentTarget.classList.remove('drag-over-below');
6333 },
6334
6335 /** @private */
6336 handleDragEnd: function(ev) {
6337 var n = ev.target;
6338
6339 n.style.opacity = '';
6340 n.classList.add('flash');
6341 n.parentNode.querySelectorAll('.drag-over-above, .drag-over-below')
6342 .forEach(function(tr) {
6343 tr.classList.remove('drag-over-above');
6344 tr.classList.remove('drag-over-below');
6345 });
6346 },
6347
6348 /** @private */
6349 handleDrop: function(ev) {
6350 var s = scope.dragState;
6351
6352 if (s.node &amp;&amp; s.targetNode) {
6353 var config_name = this.uciconfig || this.map.config,
6354 ref_node = s.targetNode,
6355 after = false;
6356
6357 if (ref_node.classList.contains('drag-over-below')) {
6358 ref_node = ref_node.nextElementSibling;
6359 after = true;
6360 }
6361
6362 var sid1 = s.node.getAttribute('data-sid'),
6363 sid2 = s.targetNode.getAttribute('data-sid');
6364
6365 s.node.parentNode.insertBefore(s.node, ref_node);
6366 this.map.data.move(config_name, sid1, sid2, after);
6367 }
6368
6369 scope.dragState = null;
6370 ev.target.style.opacity = '';
6371 ev.stopPropagation();
6372 ev.preventDefault();
6373 return false;
6374 },
6375
6376 /** @private */
6377 determineBackgroundColor: function(node) {
6378 var r = 255, g = 255, b = 255;
6379
6380 while (node) {
6381 var s = window.getComputedStyle(node),
6382 c = (s.getPropertyValue('background-color') || '').replace(/ /g, '');
6383
6384 if (c != '' &amp;&amp; c != 'transparent' &amp;&amp; c != 'rgba(0,0,0,0)') {
6385 if (/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.test(c)) {
6386 r = parseInt(RegExp.$1, 16);
6387 g = parseInt(RegExp.$2, 16);
6388 b = parseInt(RegExp.$3, 16);
6389 }
6390 else if (/^rgba?\(([0-9]+),([0-9]+),([0-9]+)[,)]$/.test(c)) {
6391 r = +RegExp.$1;
6392 g = +RegExp.$2;
6393 b = +RegExp.$3;
6394 }
6395
6396 break;
6397 }
6398
6399 node = node.parentNode;
6400 }
6401
6402 return [ r, g, b ];
6403 },
6404
6405 /** @private */
6406 handleTouchMove: function(ev) {
6407 if (!ev.target.classList.contains('drag-handle'))
6408 return;
6409
6410 var touchLoc = ev.targetTouches[0],
6411 rowBtn = ev.target,
6412 rowElem = dom.parent(rowBtn, '.tr'),
6413 htmlElem = document.querySelector('html'),
6414 dragHandle = document.querySelector('.touchsort-element'),
6415 viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
6416
6417 if (!dragHandle) {
6418 var rowRect = rowElem.getBoundingClientRect(),
6419 btnRect = rowBtn.getBoundingClientRect(),
6420 paddingLeft = btnRect.left - rowRect.left,
6421 paddingRight = rowRect.right - btnRect.right,
6422 colorBg = this.determineBackgroundColor(rowElem),
6423 colorFg = (colorBg[0] * 0.299 + colorBg[1] * 0.587 + colorBg[2] * 0.114) > 186 ? [ 0, 0, 0 ] : [ 255, 255, 255 ];
6424
6425 dragHandle = E('div', { 'class': 'touchsort-element' }, [
6426 E('strong', [ rowElem.getAttribute('data-title') ]),
6427 rowBtn.cloneNode(true)
6428 ]);
6429
6430 Object.assign(dragHandle.style, {
6431 position: 'absolute',
6432 boxShadow: '0 0 3px rgba(%d, %d, %d, 1)'.format(colorFg[0], colorFg[1], colorFg[2]),
6433 background: 'rgba(%d, %d, %d, 0.8)'.format(colorBg[0], colorBg[1], colorBg[2]),
6434 top: rowRect.top + 'px',
6435 left: rowRect.left + 'px',
6436 width: rowRect.width + 'px',
6437 height: (rowBtn.offsetHeight + 4) + 'px'
6438 });
6439
6440 Object.assign(dragHandle.firstElementChild.style, {
6441 position: 'absolute',
6442 lineHeight: dragHandle.style.height,
6443 whiteSpace: 'nowrap',
6444 overflow: 'hidden',
6445 textOverflow: 'ellipsis',
6446 left: (paddingRight > paddingLeft) ? '' : '5px',
6447 right: (paddingRight > paddingLeft) ? '5px' : '',
6448 width: (Math.max(paddingLeft, paddingRight) - 10) + 'px'
6449 });
6450
6451 Object.assign(dragHandle.lastElementChild.style, {
6452 position: 'absolute',
6453 top: '2px',
6454 left: paddingLeft + 'px',
6455 width: rowBtn.offsetWidth + 'px'
6456 });
6457
6458 document.body.appendChild(dragHandle);
6459
6460 rowElem.classList.remove('flash');
6461 rowBtn.blur();
6462 }
6463
6464 dragHandle.style.top = (touchLoc.pageY - (parseInt(dragHandle.style.height) / 2)) + 'px';
6465
6466 rowElem.parentNode.querySelectorAll('[draggable]').forEach(function(tr, i, trs) {
6467 var trRect = tr.getBoundingClientRect(),
6468 yTop = trRect.top + window.scrollY,
6469 yBottom = trRect.bottom + window.scrollY,
6470 yMiddle = yTop + ((yBottom - yTop) / 2);
6471
6472 tr.classList.remove('drag-over-above', 'drag-over-below');
6473
6474 if ((i == 0 || touchLoc.pageY >= yTop) &amp;&amp; touchLoc.pageY &lt;= yMiddle)
6475 tr.classList.add('drag-over-above');
6476 else if ((i == (trs.length - 1) || touchLoc.pageY &lt;= yBottom) &amp;&amp; touchLoc.pageY > yMiddle)
6477 tr.classList.add('drag-over-below');
6478 });
6479
6480 /* prevent standard scrolling and scroll page when drag handle is
6481 * moved very close (~30px) to the viewport edge */
6482
6483 ev.preventDefault();
6484
6485 if (touchLoc.clientY &lt; 30)
6486 window.requestAnimationFrame(function() { htmlElem.scrollTop -= 30 });
6487 else if (touchLoc.clientY > viewportHeight - 30)
6488 window.requestAnimationFrame(function() { htmlElem.scrollTop += 30 });
6489 },
6490
6491 /** @private */
6492 handleTouchEnd: function(ev) {
6493 var rowElem = dom.parent(ev.target, '.tr'),
6494 htmlElem = document.querySelector('html'),
6495 dragHandle = document.querySelector('.touchsort-element'),
6496 targetElem = rowElem.parentNode.querySelector('.drag-over-above, .drag-over-below'),
6497 viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
6498
6499 if (!dragHandle)
6500 return;
6501
6502 if (targetElem) {
6503 var isBelow = targetElem.classList.contains('drag-over-below');
6504
6505 rowElem.parentNode.insertBefore(rowElem, isBelow ? targetElem.nextElementSibling : targetElem);
6506
6507 this.map.data.move(
6508 this.uciconfig || this.map.config,
6509 rowElem.getAttribute('data-sid'),
6510 targetElem.getAttribute('data-sid'),
6511 isBelow);
6512
6513 window.requestAnimationFrame(function() {
6514 var rowRect = rowElem.getBoundingClientRect();
6515
6516 if (rowRect.top &lt; 50)
6517 htmlElem.scrollTop = (htmlElem.scrollTop + rowRect.top - 50);
6518 else if (rowRect.bottom > viewportHeight - 50)
6519 htmlElem.scrollTop = (htmlElem.scrollTop + viewportHeight - 50 - rowRect.height);
6520
6521 rowElem.classList.add('flash');
6522 });
6523
6524 targetElem.classList.remove('drag-over-above', 'drag-over-below');
6525 }
6526
6527 document.body.removeChild(dragHandle);
6528 },
6529
6530 /** @private */
6531 handleModalCancel: function(modalMap, ev) {
6532 var prevNode = this.getPreviousModalMap(),
6533 resetTasks = Promise.resolve();
6534
6535 if (prevNode) {
6536 var heading = prevNode.parentNode.querySelector('h4'),
6537 prevMap = dom.findClassInstance(prevNode);
6538
6539 while (prevMap) {
6540 resetTasks = resetTasks
6541 .then(L.bind(prevMap.load, prevMap))
6542 .then(L.bind(prevMap.reset, prevMap));
6543
6544 prevMap = prevMap.parent;
6545 }
6546
6547 prevNode.classList.add('flash');
6548 prevNode.classList.remove('hidden');
6549 prevNode.parentNode.removeChild(prevNode.nextElementSibling);
6550
6551 heading.removeChild(heading.lastElementChild);
6552
6553 if (!this.getPreviousModalMap())
6554 prevNode.parentNode
6555 .querySelector('div.right > button')
6556 .firstChild.data = _('Dismiss');
6557 }
6558 else {
6559 ui.hideModal();
6560 }
6561
6562 return resetTasks;
6563 },
6564
6565 /** @private */
6566 handleModalSave: function(modalMap, ev) {
6567 var mapNode = this.getActiveModalMap(),
6568 activeMap = dom.findClassInstance(mapNode),
6569 saveTasks = activeMap.save(null, true);
6570
6571 while (activeMap.parent) {
6572 activeMap = activeMap.parent;
6573 saveTasks = saveTasks
6574 .then(L.bind(activeMap.load, activeMap))
6575 .then(L.bind(activeMap.reset, activeMap));
6576 }
6577
6578 return saveTasks
6579 .then(L.bind(this.handleModalCancel, this, modalMap, ev, true))
6580 .catch(function() {});
6581 },
6582
6583 /** @private */
6584 handleSort: function(ev) {
6585 if (!ev.target.matches('th[data-sortable-row]'))
6586 return;
6587
6588 var th = ev.target,
6589 descending = (th.getAttribute('data-sort-direction') == 'desc'),
6590 config_name = this.uciconfig || this.map.config,
6591 index = 0,
6592 list = [];
6593
6594 ev.currentTarget.querySelectorAll('th').forEach(function(other_th, i) {
6595 if (other_th !== th)
6596 other_th.removeAttribute('data-sort-direction');
6597 else
6598 index = i;
6599 });
6600
6601 ev.currentTarget.parentNode.querySelectorAll('tr.cbi-section-table-row').forEach(L.bind(function(tr, i) {
6602 var sid = tr.getAttribute('data-sid'),
6603 opt = tr.childNodes[index].getAttribute('data-name'),
6604 val = this.cfgvalue(sid, opt);
6605
6606 tr.querySelectorAll('.flash').forEach(function(n) {
6607 n.classList.remove('flash')
6608 });
6609
6610 list.push([
6611 ui.Table.prototype.deriveSortKey((val != null) ? val.trim() : ''),
6612 tr
6613 ]);
6614 }, this));
6615
6616 list.sort(function(a, b) {
6617 return descending
6618 ? -L.naturalCompare(a[0], b[0])
6619 : L.naturalCompare(a[0], b[0]);
6620 });
6621
6622 window.requestAnimationFrame(L.bind(function() {
6623 var ref_sid, cur_sid;
6624
6625 for (var i = 0; i &lt; list.length; i++) {
6626 list[i][1].childNodes[index].classList.add('flash');
6627 th.parentNode.parentNode.appendChild(list[i][1]);
6628
6629 cur_sid = list[i][1].getAttribute('data-sid');
6630
6631 if (ref_sid)
6632 this.map.data.move(config_name, cur_sid, ref_sid, true);
6633
6634 ref_sid = cur_sid;
6635 }
6636
6637 th.setAttribute('data-sort-direction', descending ? 'asc' : 'desc');
6638 }, this));
6639 },
6640
6641 /**
6642 * Add further options to the per-section instanced modal popup.
6643 *
6644 * This function may be overwritten by user code to perform additional
6645 * setup steps before displaying the more options modal which is useful to
6646 * e.g. query additional data or to inject further option elements.
6647 *
6648 * The default implementation of this function does nothing.
6649 *
6650 * @abstract
6651 * @param {LuCI.form.NamedSection} modalSection
6652 * The `NamedSection` instance about to be rendered in the modal popup.
6653 *
6654 * @param {string} section_id
6655 * The ID of the underlying UCI section the modal popup belongs to.
6656 *
6657 * @param {Event} ev
6658 * The DOM event emitted by clicking the `More…` button.
6659 *
6660 * @returns {*|Promise&lt;*>}
6661 * Return values of this function are ignored but if a promise is returned,
6662 * it is run to completion before the rendering is continued, allowing
6663 * custom logic to perform asynchronous work before the modal dialog
6664 * is shown.
6665 */
6666 addModalOptions: function(modalSection, section_id, ev) {
6667
6668 },
6669
6670 /** @private */
6671 getActiveModalMap: function() {
6672 return document.querySelector('body.modal-overlay-active > #modal_overlay > .modal.cbi-modal > .cbi-map:not(.hidden)');
6673 },
6674
6675 /** @private */
6676 getPreviousModalMap: function() {
6677 var mapNode = this.getActiveModalMap(),
6678 prevNode = mapNode ? mapNode.previousElementSibling : null;
6679
6680 return (prevNode &amp;&amp; prevNode.matches('.cbi-map.hidden')) ? prevNode : null;
6681 },
6682
6683 /** @private */
6684 cloneOptions: function(src_section, dest_section) {
6685 for (var i = 0; i &lt; src_section.children.length; i++) {
6686 var o1 = src_section.children[i];
6687
6688 if (o1.modalonly === false &amp;&amp; src_section === this)
6689 continue;
6690
6691 var o2;
6692
6693 if (o1.subsection) {
6694 o2 = dest_section.option(o1.constructor, o1.option, o1.subsection.constructor, o1.subsection.sectiontype, o1.subsection.title, o1.subsection.description);
6695
6696 for (var k in o1.subsection) {
6697 if (!o1.subsection.hasOwnProperty(k))
6698 continue;
6699
6700 switch (k) {
6701 case 'map':
6702 case 'children':
6703 case 'parentoption':
6704 continue;
6705
6706 default:
6707 o2.subsection[k] = o1.subsection[k];
6708 }
6709 }
6710
6711 this.cloneOptions(o1.subsection, o2.subsection);
6712 }
6713 else {
6714 o2 = dest_section.option(o1.constructor, o1.option, o1.title, o1.description);
6715 }
6716
6717 for (var k in o1) {
6718 if (!o1.hasOwnProperty(k))
6719 continue;
6720
6721 switch (k) {
6722 case 'map':
6723 case 'section':
6724 case 'option':
6725 case 'title':
6726 case 'description':
6727 case 'subsection':
6728 continue;
6729
6730 default:
6731 o2[k] = o1[k];
6732 }
6733 }
6734 }
6735 },
6736
6737 /** @private */
6738 renderMoreOptionsModal: function(section_id, ev) {
6739 var parent = this.map,
6740 sref = parent.data.get(parent.config, section_id),
6741 mapNode = this.getActiveModalMap(),
6742 activeMap = mapNode ? dom.findClassInstance(mapNode) : null,
6743 stackedMap = activeMap &amp;&amp; (activeMap.parent !== parent || activeMap.section !== section_id);
6744
6745 return (stackedMap ? activeMap.save(null, true) : Promise.resolve()).then(L.bind(function() {
6746 section_id = sref['.name'];
6747
6748 var m;
6749
6750 if (parent instanceof CBIJSONMap) {
6751 m = new CBIJSONMap(null, null, null);
6752 m.data = parent.data;
6753 }
6754 else {
6755 m = new CBIMap(parent.config, null, null);
6756 }
6757
6758 var s = m.section(CBINamedSection, section_id, this.sectiontype);
6759
6760 m.parent = parent;
6761 m.section = section_id;
6762 m.readonly = parent.readonly;
6763
6764 s.tabs = this.tabs;
6765 s.tab_names = this.tab_names;
6766
6767 this.cloneOptions(this, s);
6768
6769 return Promise.resolve(this.addModalOptions(s, section_id, ev)).then(function() {
6770 return m.render();
6771 }).then(L.bind(function(nodes) {
6772 var title = parent.title,
6773 name = null;
6774
6775 if ((name = this.titleFn('modaltitle', section_id)) != null)
6776 title = name;
6777 else if ((name = this.titleFn('sectiontitle', section_id)) != null)
6778 title = '%s - %s'.format(parent.title, name);
6779 else if (!this.anonymous)
6780 title = '%s - %s'.format(parent.title, section_id);
6781
6782 if (stackedMap) {
6783 mapNode.parentNode
6784 .querySelector('h4')
6785 .appendChild(E('span', title ? ' » ' + title : ''));
6786
6787 mapNode.parentNode
6788 .querySelector('div.right > button')
6789 .firstChild.data = _('Back');
6790
6791 mapNode.classList.add('hidden');
6792 mapNode.parentNode.insertBefore(nodes, mapNode.nextElementSibling);
6793
6794 nodes.classList.add('flash');
6795 }
6796 else {
6797 ui.showModal(title, [
6798 nodes,
6799 E('div', { 'class': 'right' }, [
6800 E('button', {
6801 'class': 'cbi-button',
6802 'click': ui.createHandlerFn(this, 'handleModalCancel', m)
6803 }, [ _('Dismiss') ]), ' ',
6804 E('button', {
6805 'class': 'cbi-button cbi-button-positive important',
6806 'click': ui.createHandlerFn(this, 'handleModalSave', m),
6807 'disabled': m.readonly || null
6808 }, [ _('Save') ])
6809 ])
6810 ], 'cbi-modal');
6811 }
6812 }, this));
6813 }, this)).catch(L.error);
6814 }
6815 });
6816
6817 /**
6818 * @class GridSection
6819 * @memberof LuCI.form
6820 * @augments LuCI.form.TableSection
6821 * @hideconstructor
6822 * @classdesc
6823 *
6824 * The `GridSection` class maps all or - if `filter()` is overwritten - a
6825 * subset of the underlying UCI configuration sections of a given type.
6826 *
6827 * A grid section functions similar to a {@link LuCI.form.TableSection} but
6828 * supports tabbing in the modal overlay. Option elements added with
6829 * [option()]{@link LuCI.form.GridSection#option} are shown in the table while
6830 * elements added with [taboption()]{@link LuCI.form.GridSection#taboption}
6831 * are displayed in the modal popup.
6832 *
6833 * Another important difference is that the table cells show a readonly text
6834 * preview of the corresponding option elements by default, unless the child
6835 * option element is explicitly made writable by setting the `editable`
6836 * property to `true`.
6837 *
6838 * Additionally, the grid section honours a `modalonly` property of child
6839 * option elements. Refer to the [AbstractValue]{@link LuCI.form.AbstractValue}
6840 * documentation for details.
6841 *
6842 * Layout wise, a grid section looks mostly identical to table sections.
6843 *
6844 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
6845 * The configuration form this section is added to. It is automatically passed
6846 * by [section()]{@link LuCI.form.Map#section}.
6847 *
6848 * @param {string} section_type
6849 * The type of the UCI section to map.
6850 *
6851 * @param {string} [title]
6852 * The title caption of the form section element.
6853 *
6854 * @param {string} [description]
6855 * The description text of the form section element.
6856 */
6857 var CBIGridSection = CBITableSection.extend(/** @lends LuCI.form.GridSection.prototype */ {
6858 /**
6859 * Add an option tab to the section.
6860 *
6861 * The modal option elements of a grid section may be divided into multiple
6862 * tabs to provide a better overview to the user.
6863 *
6864 * Before options can be moved into a tab pane, the corresponding tab
6865 * has to be defined first, which is done by calling this function.
6866 *
6867 * Note that tabs are only effective in modal popups, options added with
6868 * `option()` will not be assigned to a specific tab and are rendered in
6869 * the table view only.
6870 *
6871 * @param {string} name
6872 * The name of the tab to register. It may be freely chosen and just serves
6873 * as an identifier to differentiate tabs.
6874 *
6875 * @param {string} title
6876 * The human readable caption of the tab.
6877 *
6878 * @param {string} [description]
6879 * An additional description text for the corresponding tab pane. It is
6880 * displayed as text paragraph below the tab but before the tab pane
6881 * contents. If omitted, no description will be rendered.
6882 *
6883 * @throws {Error}
6884 * Throws an exception if a tab with the same `name` already exists.
6885 */
6886 tab: function(name, title, description) {
6887 CBIAbstractSection.prototype.tab.call(this, name, title, description);
6888 },
6889
6890 /** @private */
6891 handleAdd: function(ev, name) {
6892 var config_name = this.uciconfig || this.map.config,
6893 section_id = this.map.data.add(config_name, this.sectiontype, name),
6894 mapNode = this.getPreviousModalMap(),
6895 prevMap = mapNode ? dom.findClassInstance(mapNode) : this.map;
6896
6897 prevMap.addedSection = section_id;
6898
6899 return this.renderMoreOptionsModal(section_id);
6900 },
6901
6902 /** @private */
6903 handleModalSave: function(/* ... */) {
6904 var mapNode = this.getPreviousModalMap(),
6905 prevMap = mapNode ? dom.findClassInstance(mapNode) : this.map;
6906
6907 return this.super('handleModalSave', arguments);
6908 },
6909
6910 /** @private */
6911 handleModalCancel: function(modalMap, ev, isSaving) {
6912 var config_name = this.uciconfig || this.map.config,
6913 mapNode = this.getPreviousModalMap(),
6914 prevMap = mapNode ? dom.findClassInstance(mapNode) : this.map;
6915
6916 if (prevMap.addedSection != null &amp;&amp; !isSaving)
6917 this.map.data.remove(config_name, prevMap.addedSection);
6918
6919 delete prevMap.addedSection;
6920
6921 return this.super('handleModalCancel', arguments);
6922 },
6923
6924 /** @private */
6925 renderUCISection: function(section_id) {
6926 return this.renderOptions(null, section_id);
6927 },
6928
6929 /** @private */
6930 renderChildren: function(tab_name, section_id, in_table) {
6931 var tasks = [], index = 0;
6932
6933 for (var i = 0, opt; (opt = this.children[i]) != null; i++) {
6934 if (opt.disable || opt.modalonly)
6935 continue;
6936
6937 if (opt.editable)
6938 tasks.push(opt.render(index++, section_id, in_table));
6939 else
6940 tasks.push(this.renderTextValue(section_id, opt));
6941 }
6942
6943 return Promise.all(tasks);
6944 },
6945
6946 /** @private */
6947 renderTextValue: function(section_id, opt) {
6948 var title = this.stripTags(opt.title).trim(),
6949 descr = this.stripTags(opt.description).trim(),
6950 value = opt.textvalue(section_id);
6951
6952 return E('td', {
6953 'class': 'td cbi-value-field',
6954 'data-title': (title != '') ? title : null,
6955 'data-description': (descr != '') ? descr : null,
6956 'data-name': opt.option,
6957 'data-widget': 'CBI.DummyValue'
6958 }, (value != null) ? value : E('em', _('none')));
6959 },
6960
6961 /** @private */
6962 renderHeaderRows: function(section_id) {
6963 return this.super('renderHeaderRows', [ NaN, true ]);
6964 },
6965
6966 /** @private */
6967 renderRowActions: function(section_id) {
6968 return this.super('renderRowActions', [ section_id, _('Edit') ]);
6969 },
6970
6971 /** @override */
6972 parse: function() {
6973 var section_ids = this.cfgsections(),
6974 tasks = [];
6975
6976 if (Array.isArray(this.children)) {
6977 for (var i = 0; i &lt; section_ids.length; i++) {
6978 for (var j = 0; j &lt; this.children.length; j++) {
6979 if (!this.children[j].editable || this.children[j].modalonly)
6980 continue;
6981
6982 tasks.push(this.children[j].parse(section_ids[i]));
6983 }
6984 }
6985 }
6986
6987 return Promise.all(tasks);
6988 }
6989 });
6990
6991 /**
6992 * @class NamedSection
6993 * @memberof LuCI.form
6994 * @augments LuCI.form.AbstractSection
6995 * @hideconstructor
6996 * @classdesc
6997 *
6998 * The `NamedSection` class maps exactly one UCI section instance which is
6999 * specified when constructing the class instance.
7000 *
7001 * Layout and functionality wise, a named section is essentially a
7002 * `TypedSection` which allows exactly one section node.
7003 *
7004 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7005 * The configuration form this section is added to. It is automatically passed
7006 * by [section()]{@link LuCI.form.Map#section}.
7007 *
7008 * @param {string} section_id
7009 * The name (ID) of the UCI section to map.
7010 *
7011 * @param {string} section_type
7012 * The type of the UCI section to map.
7013 *
7014 * @param {string} [title]
7015 * The title caption of the form section element.
7016 *
7017 * @param {string} [description]
7018 * The description text of the form section element.
7019 */
7020 var CBINamedSection = CBIAbstractSection.extend(/** @lends LuCI.form.NamedSection.prototype */ {
7021 __name__: 'CBI.NamedSection',
7022 __init__: function(map, section_id /*, ... */) {
7023 this.super('__init__', this.varargs(arguments, 2, map));
7024
7025 this.section = section_id;
7026 },
7027
7028 /**
7029 * If set to `true`, the user may remove or recreate the sole mapped
7030 * configuration instance from the form section widget, otherwise only a
7031 * preexisting section may be edited. The default is `false`.
7032 *
7033 * @name LuCI.form.NamedSection.prototype#addremove
7034 * @type boolean
7035 * @default false
7036 */
7037
7038 /**
7039 * Override the UCI configuration name to read the section IDs from. By
7040 * default, the configuration name is inherited from the parent `Map`.
7041 * By setting this property, a deviating configuration may be specified.
7042 * The default is `null`, means inheriting from the parent form.
7043 *
7044 * @name LuCI.form.NamedSection.prototype#uciconfig
7045 * @type string
7046 * @default null
7047 */
7048
7049 /**
7050 * The `NamedSection` class overwrites the generic `cfgsections()`
7051 * implementation to return a one-element array containing the mapped
7052 * section ID as sole element. User code should not normally change this.
7053 *
7054 * @returns {string[]}
7055 * Returns a one-element array containing the mapped section ID.
7056 */
7057 cfgsections: function() {
7058 return [ this.section ];
7059 },
7060
7061 /** @private */
7062 handleAdd: function(ev) {
7063 var section_id = this.section,
7064 config_name = this.uciconfig || this.map.config;
7065
7066 this.map.data.add(config_name, this.sectiontype, section_id);
7067 return this.map.save(null, true);
7068 },
7069
7070 /** @private */
7071 handleRemove: function(ev) {
7072 var section_id = this.section,
7073 config_name = this.uciconfig || this.map.config;
7074
7075 this.map.data.remove(config_name, section_id);
7076 return this.map.save(null, true);
7077 },
7078
7079 /** @private */
7080 renderContents: function(data) {
7081 var ucidata = data[0], nodes = data[1],
7082 section_id = this.section,
7083 config_name = this.uciconfig || this.map.config,
7084 sectionEl = E('div', {
7085 'id': ucidata ? null : 'cbi-%s-%s'.format(config_name, section_id),
7086 'class': 'cbi-section',
7087 'data-tab': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.sectiontype : null,
7088 'data-tab-title': (this.map.tabbed &amp;&amp; !this.parentoption) ? this.title || this.sectiontype : null
7089 });
7090
7091 if (typeof(this.title) === 'string' &amp;&amp; this.title !== '')
7092 sectionEl.appendChild(E('h3', {}, this.title));
7093
7094 if (typeof(this.description) === 'string' &amp;&amp; this.description !== '')
7095 sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description));
7096
7097 if (ucidata) {
7098 if (this.addremove) {
7099 sectionEl.appendChild(
7100 E('div', { 'class': 'cbi-section-remove right' },
7101 E('button', {
7102 'class': 'cbi-button',
7103 'click': ui.createHandlerFn(this, 'handleRemove'),
7104 'disabled': this.map.readonly || null
7105 }, [ _('Delete') ])));
7106 }
7107
7108 sectionEl.appendChild(E('div', {
7109 'id': 'cbi-%s-%s'.format(config_name, section_id),
7110 'class': this.tabs
7111 ? 'cbi-section-node cbi-section-node-tabbed' : 'cbi-section-node',
7112 'data-section-id': section_id
7113 }, nodes));
7114 }
7115 else if (this.addremove) {
7116 sectionEl.appendChild(
7117 E('button', {
7118 'class': 'cbi-button cbi-button-add',
7119 'click': ui.createHandlerFn(this, 'handleAdd'),
7120 'disabled': this.map.readonly || null
7121 }, [ _('Add') ]));
7122 }
7123
7124 dom.bindClassInstance(sectionEl, this);
7125
7126 return sectionEl;
7127 },
7128
7129 /** @override */
7130 render: function() {
7131 var config_name = this.uciconfig || this.map.config,
7132 section_id = this.section;
7133
7134 return Promise.all([
7135 this.map.data.get(config_name, section_id),
7136 this.renderUCISection(section_id)
7137 ]).then(this.renderContents.bind(this));
7138 }
7139 });
7140
7141 /**
7142 * @class Value
7143 * @memberof LuCI.form
7144 * @augments LuCI.form.AbstractValue
7145 * @hideconstructor
7146 * @classdesc
7147 *
7148 * The `Value` class represents a simple one-line form input using the
7149 * {@link LuCI.ui.Textfield} or - in case choices are added - the
7150 * {@link LuCI.ui.Combobox} class as underlying widget.
7151 *
7152 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7153 * The configuration form this section is added to. It is automatically passed
7154 * by [option()]{@link LuCI.form.AbstractSection#option} or
7155 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7156 * option to the section.
7157 *
7158 * @param {LuCI.form.AbstractSection} section
7159 * The configuration section this option is added to. It is automatically passed
7160 * by [option()]{@link LuCI.form.AbstractSection#option} or
7161 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7162 * option to the section.
7163 *
7164 * @param {string} option
7165 * The name of the UCI option to map.
7166 *
7167 * @param {string} [title]
7168 * The title caption of the option element.
7169 *
7170 * @param {string} [description]
7171 * The description text of the option element.
7172 */
7173 var CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */ {
7174 __name__: 'CBI.Value',
7175
7176 /**
7177 * If set to `true`, the field is rendered as password input, otherwise
7178 * as plain text input.
7179 *
7180 * @name LuCI.form.Value.prototype#password
7181 * @type boolean
7182 * @default false
7183 */
7184
7185 /**
7186 * Set a placeholder string to use when the input field is empty.
7187 *
7188 * @name LuCI.form.Value.prototype#placeholder
7189 * @type string
7190 * @default null
7191 */
7192
7193 /**
7194 * Add a predefined choice to the form option. By adding one or more
7195 * choices, the plain text input field is turned into a combobox widget
7196 * which prompts the user to select a predefined choice, or to enter a
7197 * custom value.
7198 *
7199 * @param {string} key
7200 * The choice value to add.
7201 *
7202 * @param {Node|string} val
7203 * The caption for the choice value. May be a DOM node, a document fragment
7204 * or a plain text string. If omitted, the `key` value is used as caption.
7205 */
7206 value: function(key, val) {
7207 this.keylist = this.keylist || [];
7208 this.keylist.push(String(key));
7209
7210 this.vallist = this.vallist || [];
7211 this.vallist.push(dom.elem(val) ? val : String(val != null ? val : key));
7212 },
7213
7214 /** @override */
7215 render: function(option_index, section_id, in_table) {
7216 return Promise.resolve(this.cfgvalue(section_id))
7217 .then(this.renderWidget.bind(this, section_id, option_index))
7218 .then(this.renderFrame.bind(this, section_id, in_table, option_index));
7219 },
7220
7221 /** @private */
7222 handleValueChange: function(section_id, state, ev) {
7223 if (typeof(this.onchange) != 'function')
7224 return;
7225
7226 var value = this.formvalue(section_id);
7227
7228 if (isEqual(value, state.previousValue))
7229 return;
7230
7231 state.previousValue = value;
7232 this.onchange.call(this, ev, section_id, value);
7233 },
7234
7235 /** @private */
7236 renderFrame: function(section_id, in_table, option_index, nodes) {
7237 var config_name = this.uciconfig || this.section.uciconfig || this.map.config,
7238 depend_list = this.transformDepList(section_id),
7239 optionEl;
7240
7241 if (in_table) {
7242 var title = this.stripTags(this.title).trim();
7243 optionEl = E('td', {
7244 'class': 'td cbi-value-field',
7245 'data-title': (title != '') ? title : null,
7246 'data-description': this.stripTags(this.description).trim(),
7247 'data-name': this.option,
7248 'data-widget': this.typename || (this.template ? this.template.replace(/^.+\//, '') : null) || this.__name__
7249 }, E('div', {
7250 'id': 'cbi-%s-%s-%s'.format(config_name, section_id, this.option),
7251 'data-index': option_index,
7252 'data-depends': depend_list,
7253 'data-field': this.cbid(section_id)
7254 }));
7255 }
7256 else {
7257 optionEl = E('div', {
7258 'class': 'cbi-value',
7259 'id': 'cbi-%s-%s-%s'.format(config_name, section_id, this.option),
7260 'data-index': option_index,
7261 'data-depends': depend_list,
7262 'data-field': this.cbid(section_id),
7263 'data-name': this.option,
7264 'data-widget': this.typename || (this.template ? this.template.replace(/^.+\//, '') : null) || this.__name__
7265 });
7266
7267 if (this.last_child)
7268 optionEl.classList.add('cbi-value-last');
7269
7270 if (typeof(this.title) === 'string' &amp;&amp; this.title !== '') {
7271 optionEl.appendChild(E('label', {
7272 'class': 'cbi-value-title',
7273 'for': 'widget.cbid.%s.%s.%s'.format(config_name, section_id, this.option),
7274 'click': function(ev) {
7275 var node = ev.currentTarget,
7276 elem = node.nextElementSibling.querySelector('#' + node.getAttribute('for')) || node.nextElementSibling.querySelector('[data-widget-id="' + node.getAttribute('for') + '"]');
7277
7278 if (elem) {
7279 elem.click();
7280 elem.focus();
7281 }
7282 }
7283 },
7284 this.titleref ? E('a', {
7285 'class': 'cbi-title-ref',
7286 'href': this.titleref,
7287 'title': this.titledesc || _('Go to relevant configuration page')
7288 }, this.title) : this.title));
7289
7290 optionEl.appendChild(E('div', { 'class': 'cbi-value-field' }));
7291 }
7292 }
7293
7294 if (nodes)
7295 (optionEl.lastChild || optionEl).appendChild(nodes);
7296
7297 if (!in_table &amp;&amp; typeof(this.description) === 'string' &amp;&amp; this.description !== '')
7298 dom.append(optionEl.lastChild || optionEl,
7299 E('div', { 'class': 'cbi-value-description' }, this.description.trim()));
7300
7301 if (depend_list &amp;&amp; depend_list.length)
7302 optionEl.classList.add('hidden');
7303
7304 optionEl.addEventListener('widget-change',
7305 L.bind(this.map.checkDepends, this.map));
7306
7307 optionEl.addEventListener('widget-change',
7308 L.bind(this.handleValueChange, this, section_id, {}));
7309
7310 dom.bindClassInstance(optionEl, this);
7311
7312 return optionEl;
7313 },
7314
7315 /** @private */
7316 renderWidget: function(section_id, option_index, cfgvalue) {
7317 var value = (cfgvalue != null) ? cfgvalue : this.default,
7318 choices = this.transformChoices(),
7319 widget;
7320
7321 if (choices) {
7322 var placeholder = (this.optional || this.rmempty)
7323 ? E('em', _('unspecified')) : _('-- Please choose --');
7324
7325 widget = new ui.Combobox(Array.isArray(value) ? value.join(' ') : value, choices, {
7326 id: this.cbid(section_id),
7327 sort: this.keylist,
7328 optional: this.optional || this.rmempty,
7329 datatype: this.datatype,
7330 select_placeholder: this.placeholder || placeholder,
7331 validate: L.bind(this.validate, this, section_id),
7332 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7333 });
7334 }
7335 else {
7336 widget = new ui.Textfield(Array.isArray(value) ? value.join(' ') : value, {
7337 id: this.cbid(section_id),
7338 password: this.password,
7339 optional: this.optional || this.rmempty,
7340 datatype: this.datatype,
7341 placeholder: this.placeholder,
7342 validate: L.bind(this.validate, this, section_id),
7343 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7344 });
7345 }
7346
7347 return widget.render();
7348 }
7349 });
7350
7351 /**
7352 * @class DynamicList
7353 * @memberof LuCI.form
7354 * @augments LuCI.form.Value
7355 * @hideconstructor
7356 * @classdesc
7357 *
7358 * The `DynamicList` class represents a multi value widget allowing the user
7359 * to enter multiple unique values, optionally selected from a set of
7360 * predefined choices. It builds upon the {@link LuCI.ui.DynamicList} widget.
7361 *
7362 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7363 * The configuration form this section is added to. It is automatically passed
7364 * by [option()]{@link LuCI.form.AbstractSection#option} or
7365 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7366 * option to the section.
7367 *
7368 * @param {LuCI.form.AbstractSection} section
7369 * The configuration section this option is added to. It is automatically passed
7370 * by [option()]{@link LuCI.form.AbstractSection#option} or
7371 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7372 * option to the section.
7373 *
7374 * @param {string} option
7375 * The name of the UCI option to map.
7376 *
7377 * @param {string} [title]
7378 * The title caption of the option element.
7379 *
7380 * @param {string} [description]
7381 * The description text of the option element.
7382 */
7383 var CBIDynamicList = CBIValue.extend(/** @lends LuCI.form.DynamicList.prototype */ {
7384 __name__: 'CBI.DynamicList',
7385
7386 /** @private */
7387 renderWidget: function(section_id, option_index, cfgvalue) {
7388 var value = (cfgvalue != null) ? cfgvalue : this.default,
7389 choices = this.transformChoices(),
7390 items = L.toArray(value);
7391
7392 var widget = new ui.DynamicList(items, choices, {
7393 id: this.cbid(section_id),
7394 sort: this.keylist,
7395 optional: this.optional || this.rmempty,
7396 datatype: this.datatype,
7397 placeholder: this.placeholder,
7398 validate: L.bind(this.validate, this, section_id),
7399 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7400 });
7401
7402 return widget.render();
7403 },
7404 });
7405
7406 /**
7407 * @class ListValue
7408 * @memberof LuCI.form
7409 * @augments LuCI.form.Value
7410 * @hideconstructor
7411 * @classdesc
7412 *
7413 * The `ListValue` class implements a simple static HTML select element
7414 * allowing the user chose a single value from a set of predefined choices.
7415 * It builds upon the {@link LuCI.ui.Select} widget.
7416 *
7417 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7418 * The configuration form this section is added to. It is automatically passed
7419 * by [option()]{@link LuCI.form.AbstractSection#option} or
7420 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7421 * option to the section.
7422 *
7423 * @param {LuCI.form.AbstractSection} section
7424 * The configuration section this option is added to. It is automatically passed
7425 * by [option()]{@link LuCI.form.AbstractSection#option} or
7426 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7427 * option to the section.
7428 *
7429 * @param {string} option
7430 * The name of the UCI option to map.
7431 *
7432 * @param {string} [title]
7433 * The title caption of the option element.
7434 *
7435 * @param {string} [description]
7436 * The description text of the option element.
7437 */
7438 var CBIListValue = CBIValue.extend(/** @lends LuCI.form.ListValue.prototype */ {
7439 __name__: 'CBI.ListValue',
7440
7441 __init__: function() {
7442 this.super('__init__', arguments);
7443 this.widget = 'select';
7444 this.orientation = 'horizontal';
7445 this.deplist = [];
7446 },
7447
7448 /**
7449 * Set the size attribute of the underlying HTML select element.
7450 *
7451 * @name LuCI.form.ListValue.prototype#size
7452 * @type number
7453 * @default null
7454 */
7455
7456 /**
7457 * Set the type of the underlying form controls.
7458 *
7459 * May be one of `select` or `radio`. If set to `select`, an HTML
7460 * select element is rendered, otherwise a collection of `radio`
7461 * elements is used.
7462 *
7463 * @name LuCI.form.ListValue.prototype#widget
7464 * @type string
7465 * @default select
7466 */
7467
7468 /**
7469 * Set the orientation of the underlying radio or checkbox elements.
7470 *
7471 * May be one of `horizontal` or `vertical`. Only applies to non-select
7472 * widget types.
7473 *
7474 * @name LuCI.form.ListValue.prototype#orientation
7475 * @type string
7476 * @default horizontal
7477 */
7478
7479 /** @private */
7480 renderWidget: function(section_id, option_index, cfgvalue) {
7481 var choices = this.transformChoices();
7482 var widget = new ui.Select((cfgvalue != null) ? cfgvalue : this.default, choices, {
7483 id: this.cbid(section_id),
7484 size: this.size,
7485 sort: this.keylist,
7486 widget: this.widget,
7487 optional: this.optional,
7488 orientation: this.orientation,
7489 placeholder: this.placeholder,
7490 validate: L.bind(this.validate, this, section_id),
7491 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7492 });
7493
7494 return widget.render();
7495 },
7496 });
7497
7498 /**
7499 * @class FlagValue
7500 * @memberof LuCI.form
7501 * @augments LuCI.form.Value
7502 * @hideconstructor
7503 * @classdesc
7504 *
7505 * The `FlagValue` element builds upon the {@link LuCI.ui.Checkbox} widget to
7506 * implement a simple checkbox element.
7507 *
7508 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7509 * The configuration form this section is added to. It is automatically passed
7510 * by [option()]{@link LuCI.form.AbstractSection#option} or
7511 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7512 * option to the section.
7513 *
7514 * @param {LuCI.form.AbstractSection} section
7515 * The configuration section this option is added to. It is automatically passed
7516 * by [option()]{@link LuCI.form.AbstractSection#option} or
7517 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7518 * option to the section.
7519 *
7520 * @param {string} option
7521 * The name of the UCI option to map.
7522 *
7523 * @param {string} [title]
7524 * The title caption of the option element.
7525 *
7526 * @param {string} [description]
7527 * The description text of the option element.
7528 */
7529 var CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.FlagValue.prototype */ {
7530 __name__: 'CBI.FlagValue',
7531
7532 __init__: function() {
7533 this.super('__init__', arguments);
7534
7535 this.enabled = '1';
7536 this.disabled = '0';
7537 this.default = this.disabled;
7538 },
7539
7540 /**
7541 * Sets the input value to use for the checkbox checked state.
7542 *
7543 * @name LuCI.form.FlagValue.prototype#enabled
7544 * @type number
7545 * @default 1
7546 */
7547
7548 /**
7549 * Sets the input value to use for the checkbox unchecked state.
7550 *
7551 * @name LuCI.form.FlagValue.prototype#disabled
7552 * @type number
7553 * @default 0
7554 */
7555
7556 /**
7557 * Set a tooltip for the flag option.
7558 *
7559 * If set to a string, it will be used as-is as a tooltip.
7560 *
7561 * If set to a function, the function will be invoked and the return
7562 * value will be shown as a tooltip. If the return value of the function
7563 * is `null` no tooltip will be set.
7564 *
7565 * @name LuCI.form.TypedSection.prototype#tooltip
7566 * @type string|function
7567 * @default null
7568 */
7569
7570 /**
7571 * Set a tooltip icon.
7572 *
7573 * If set, this icon will be shown for the default one.
7574 * This could also be a png icon from the resources directory.
7575 *
7576 * @name LuCI.form.TypedSection.prototype#tooltipicon
7577 * @type string
7578 * @default 'ℹ️';
7579 */
7580
7581 /** @private */
7582 renderWidget: function(section_id, option_index, cfgvalue) {
7583 var tooltip = null;
7584
7585 if (typeof(this.tooltip) == 'function')
7586 tooltip = this.tooltip.apply(this, [section_id]);
7587 else if (typeof(this.tooltip) == 'string')
7588 tooltip = (arguments.length > 1) ? ''.format.apply(this.tooltip, this.varargs(arguments, 1)) : this.tooltip;
7589
7590 var widget = new ui.Checkbox((cfgvalue != null) ? cfgvalue : this.default, {
7591 id: this.cbid(section_id),
7592 value_enabled: this.enabled,
7593 value_disabled: this.disabled,
7594 validate: L.bind(this.validate, this, section_id),
7595 tooltip: tooltip,
7596 tooltipicon: this.tooltipicon,
7597 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7598 });
7599
7600 return widget.render();
7601 },
7602
7603 /**
7604 * Query the checked state of the underlying checkbox widget and return
7605 * either the `enabled` or the `disabled` property value, depending on
7606 * the checked state.
7607 *
7608 * @override
7609 */
7610 formvalue: function(section_id) {
7611 var elem = this.getUIElement(section_id),
7612 checked = elem ? elem.isChecked() : false;
7613 return checked ? this.enabled : this.disabled;
7614 },
7615
7616 /**
7617 * Query the checked state of the underlying checkbox widget and return
7618 * either a localized `Yes` or `No` string, depending on the checked state.
7619 *
7620 * @override
7621 */
7622 textvalue: function(section_id) {
7623 var cval = this.cfgvalue(section_id);
7624
7625 if (cval == null)
7626 cval = this.default;
7627
7628 return (cval == this.enabled) ? _('Yes') : _('No');
7629 },
7630
7631 /** @override */
7632 parse: function(section_id) {
7633 if (this.isActive(section_id)) {
7634 var fval = this.formvalue(section_id);
7635
7636 if (!this.isValid(section_id)) {
7637 var title = this.stripTags(this.title).trim();
7638 var error = this.getValidationError(section_id);
7639 return Promise.reject(new TypeError(
7640 _('Option "%s" contains an invalid input value.').format(title || this.option) + ' ' + error));
7641 }
7642
7643 if (fval == this.default &amp;&amp; (this.optional || this.rmempty))
7644 return Promise.resolve(this.remove(section_id));
7645 else
7646 return Promise.resolve(this.write(section_id, fval));
7647 }
7648 else if (!this.retain) {
7649 return Promise.resolve(this.remove(section_id));
7650 }
7651 },
7652 });
7653
7654 /**
7655 * @class MultiValue
7656 * @memberof LuCI.form
7657 * @augments LuCI.form.DynamicList
7658 * @hideconstructor
7659 * @classdesc
7660 *
7661 * The `MultiValue` class is a modified variant of the `DynamicList` element
7662 * which leverages the {@link LuCI.ui.Dropdown} widget to implement a multi
7663 * select dropdown element.
7664 *
7665 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7666 * The configuration form this section is added to. It is automatically passed
7667 * by [option()]{@link LuCI.form.AbstractSection#option} or
7668 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7669 * option to the section.
7670 *
7671 * @param {LuCI.form.AbstractSection} section
7672 * The configuration section this option is added to. It is automatically passed
7673 * by [option()]{@link LuCI.form.AbstractSection#option} or
7674 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7675 * option to the section.
7676 *
7677 * @param {string} option
7678 * The name of the UCI option to map.
7679 *
7680 * @param {string} [title]
7681 * The title caption of the option element.
7682 *
7683 * @param {string} [description]
7684 * The description text of the option element.
7685 */
7686 var CBIMultiValue = CBIDynamicList.extend(/** @lends LuCI.form.MultiValue.prototype */ {
7687 __name__: 'CBI.MultiValue',
7688
7689 __init__: function() {
7690 this.super('__init__', arguments);
7691 this.placeholder = _('-- Please choose --');
7692 },
7693
7694 /**
7695 * Allows to specify the [display_items]{@link LuCI.ui.Dropdown.InitOptions}
7696 * property of the underlying dropdown widget. If omitted, the value of
7697 * the `size` property is used or `3` when `size` is unspecified as well.
7698 *
7699 * @name LuCI.form.MultiValue.prototype#display_size
7700 * @type number
7701 * @default null
7702 */
7703
7704 /**
7705 * Allows to specify the [dropdown_items]{@link LuCI.ui.Dropdown.InitOptions}
7706 * property of the underlying dropdown widget. If omitted, the value of
7707 * the `size` property is used or `-1` when `size` is unspecified as well.
7708 *
7709 * @name LuCI.form.MultiValue.prototype#dropdown_size
7710 * @type number
7711 * @default null
7712 */
7713
7714 /** @private */
7715 renderWidget: function(section_id, option_index, cfgvalue) {
7716 var value = (cfgvalue != null) ? cfgvalue : this.default,
7717 choices = this.transformChoices();
7718
7719 var widget = new ui.Dropdown(L.toArray(value), choices, {
7720 id: this.cbid(section_id),
7721 sort: this.keylist,
7722 multiple: true,
7723 optional: this.optional || this.rmempty,
7724 select_placeholder: this.placeholder,
7725 display_items: this.display_size || this.size || 3,
7726 dropdown_items: this.dropdown_size || this.size || -1,
7727 validate: L.bind(this.validate, this, section_id),
7728 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7729 });
7730
7731 return widget.render();
7732 },
7733 });
7734
7735 /**
7736 * @class TextValue
7737 * @memberof LuCI.form
7738 * @augments LuCI.form.Value
7739 * @hideconstructor
7740 * @classdesc
7741 *
7742 * The `TextValue` class implements a multi-line textarea input using
7743 * {@link LuCI.ui.Textarea}.
7744 *
7745 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7746 * The configuration form this section is added to. It is automatically passed
7747 * by [option()]{@link LuCI.form.AbstractSection#option} or
7748 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7749 * option to the section.
7750 *
7751 * @param {LuCI.form.AbstractSection} section
7752 * The configuration section this option is added to. It is automatically passed
7753 * by [option()]{@link LuCI.form.AbstractSection#option} or
7754 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7755 * option to the section.
7756 *
7757 * @param {string} option
7758 * The name of the UCI option to map.
7759 *
7760 * @param {string} [title]
7761 * The title caption of the option element.
7762 *
7763 * @param {string} [description]
7764 * The description text of the option element.
7765 */
7766 var CBITextValue = CBIValue.extend(/** @lends LuCI.form.TextValue.prototype */ {
7767 __name__: 'CBI.TextValue',
7768
7769 /** @ignore */
7770 value: null,
7771
7772 /**
7773 * Enforces the use of a monospace font for the textarea contents when set
7774 * to `true`.
7775 *
7776 * @name LuCI.form.TextValue.prototype#monospace
7777 * @type boolean
7778 * @default false
7779 */
7780
7781 /**
7782 * Allows to specify the [cols]{@link LuCI.ui.Textarea.InitOptions}
7783 * property of the underlying textarea widget.
7784 *
7785 * @name LuCI.form.TextValue.prototype#cols
7786 * @type number
7787 * @default null
7788 */
7789
7790 /**
7791 * Allows to specify the [rows]{@link LuCI.ui.Textarea.InitOptions}
7792 * property of the underlying textarea widget.
7793 *
7794 * @name LuCI.form.TextValue.prototype#rows
7795 * @type number
7796 * @default null
7797 */
7798
7799 /**
7800 * Allows to specify the [wrap]{@link LuCI.ui.Textarea.InitOptions}
7801 * property of the underlying textarea widget.
7802 *
7803 * @name LuCI.form.TextValue.prototype#wrap
7804 * @type number
7805 * @default null
7806 */
7807
7808 /** @private */
7809 renderWidget: function(section_id, option_index, cfgvalue) {
7810 var value = (cfgvalue != null) ? cfgvalue : this.default;
7811
7812 var widget = new ui.Textarea(value, {
7813 id: this.cbid(section_id),
7814 optional: this.optional || this.rmempty,
7815 placeholder: this.placeholder,
7816 monospace: this.monospace,
7817 cols: this.cols,
7818 rows: this.rows,
7819 wrap: this.wrap,
7820 validate: L.bind(this.validate, this, section_id),
7821 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
7822 });
7823
7824 return widget.render();
7825 }
7826 });
7827
7828 /**
7829 * @class DummyValue
7830 * @memberof LuCI.form
7831 * @augments LuCI.form.Value
7832 * @hideconstructor
7833 * @classdesc
7834 *
7835 * The `DummyValue` element wraps an {@link LuCI.ui.Hiddenfield} widget and
7836 * renders the underlying UCI option or default value as readonly text.
7837 *
7838 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7839 * The configuration form this section is added to. It is automatically passed
7840 * by [option()]{@link LuCI.form.AbstractSection#option} or
7841 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7842 * option to the section.
7843 *
7844 * @param {LuCI.form.AbstractSection} section
7845 * The configuration section this option is added to. It is automatically passed
7846 * by [option()]{@link LuCI.form.AbstractSection#option} or
7847 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7848 * option to the section.
7849 *
7850 * @param {string} option
7851 * The name of the UCI option to map.
7852 *
7853 * @param {string} [title]
7854 * The title caption of the option element.
7855 *
7856 * @param {string} [description]
7857 * The description text of the option element.
7858 */
7859 var CBIDummyValue = CBIValue.extend(/** @lends LuCI.form.DummyValue.prototype */ {
7860 __name__: 'CBI.DummyValue',
7861
7862 /**
7863 * Set a URL which is opened when clicking on the dummy value text.
7864 *
7865 * By setting this property, the dummy value text is wrapped in an `&lt;a>`
7866 * element with the property value used as `href` attribute.
7867 *
7868 * @name LuCI.form.DummyValue.prototype#href
7869 * @type string
7870 * @default null
7871 */
7872
7873 /**
7874 * Treat the UCI option value (or the `default` property value) as HTML.
7875 *
7876 * By default, the value text is HTML escaped before being rendered as
7877 * text. In some cases it may be needed to actually interpret and render
7878 * HTML contents as-is. When set to `true`, HTML escaping is disabled.
7879 *
7880 * @name LuCI.form.DummyValue.prototype#rawhtml
7881 * @type boolean
7882 * @default null
7883 */
7884
7885 /**
7886 * Render the UCI option value as hidden using the HTML display: none style property.
7887 *
7888 * By default, the value is displayed
7889 *
7890 * @name LuCI.form.DummyValue.prototype#hidden
7891 * @type boolean
7892 * @default null
7893 */
7894
7895 /** @private */
7896 renderWidget: function(section_id, option_index, cfgvalue) {
7897 var value = (cfgvalue != null) ? cfgvalue : this.default,
7898 hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) }),
7899 outputEl = E('div', { 'style': this.hidden ? 'display:none' : null });
7900
7901 if (this.href &amp;&amp; !((this.readonly != null) ? this.readonly : this.map.readonly))
7902 outputEl.appendChild(E('a', { 'href': this.href }));
7903
7904 dom.append(outputEl.lastChild || outputEl,
7905 this.rawhtml ? value : [ value ]);
7906
7907 return E([
7908 outputEl,
7909 hiddenEl.render()
7910 ]);
7911 },
7912
7913 /** @override */
7914 remove: function() {},
7915
7916 /** @override */
7917 write: function() {}
7918 });
7919
7920 /**
7921 * @class ButtonValue
7922 * @memberof LuCI.form
7923 * @augments LuCI.form.Value
7924 * @hideconstructor
7925 * @classdesc
7926 *
7927 * The `DummyValue` element wraps an {@link LuCI.ui.Hiddenfield} widget and
7928 * renders the underlying UCI option or default value as readonly text.
7929 *
7930 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
7931 * The configuration form this section is added to. It is automatically passed
7932 * by [option()]{@link LuCI.form.AbstractSection#option} or
7933 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7934 * option to the section.
7935 *
7936 * @param {LuCI.form.AbstractSection} section
7937 * The configuration section this option is added to. It is automatically passed
7938 * by [option()]{@link LuCI.form.AbstractSection#option} or
7939 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
7940 * option to the section.
7941 *
7942 * @param {string} option
7943 * The name of the UCI option to map.
7944 *
7945 * @param {string} [title]
7946 * The title caption of the option element.
7947 *
7948 * @param {string} [description]
7949 * The description text of the option element.
7950 */
7951 var CBIButtonValue = CBIValue.extend(/** @lends LuCI.form.ButtonValue.prototype */ {
7952 __name__: 'CBI.ButtonValue',
7953
7954 /**
7955 * Override the rendered button caption.
7956 *
7957 * By default, the option title - which is passed as fourth argument to the
7958 * constructor - is used as caption for the button element. When setting
7959 * this property to a string, it is used as `String.format()` pattern with
7960 * the underlying UCI section name passed as first format argument. When
7961 * set to a function, it is invoked passing the section ID as sole argument
7962 * and the resulting return value is converted to a string before being
7963 * used as button caption.
7964 *
7965 * The default is `null`, means the option title is used as caption.
7966 *
7967 * @name LuCI.form.ButtonValue.prototype#inputtitle
7968 * @type string|function
7969 * @default null
7970 */
7971
7972 /**
7973 * Override the button style class.
7974 *
7975 * By setting this property, a specific `cbi-button-*` CSS class can be
7976 * selected to influence the style of the resulting button.
7977 *
7978 * Suitable values which are implemented by most themes are `positive`,
7979 * `negative` and `primary`.
7980 *
7981 * The default is `null`, means a neutral button styling is used.
7982 *
7983 * @name LuCI.form.ButtonValue.prototype#inputstyle
7984 * @type string
7985 * @default null
7986 */
7987
7988 /**
7989 * Override the button click action.
7990 *
7991 * By default, the underlying UCI option (or default property) value is
7992 * copied into a hidden field tied to the button element and the save
7993 * action is triggered on the parent form element.
7994 *
7995 * When this property is set to a function, it is invoked instead of
7996 * performing the default actions. The handler function will receive the
7997 * DOM click element as first and the underlying configuration section ID
7998 * as second argument.
7999 *
8000 * @name LuCI.form.ButtonValue.prototype#onclick
8001 * @type function
8002 * @default null
8003 */
8004
8005 /** @private */
8006 renderWidget: function(section_id, option_index, cfgvalue) {
8007 var value = (cfgvalue != null) ? cfgvalue : this.default,
8008 hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) }),
8009 outputEl = E('div'),
8010 btn_title = this.titleFn('inputtitle', section_id) || this.titleFn('title', section_id);
8011
8012 if (value !== false)
8013 dom.content(outputEl, [
8014 E('button', {
8015 'class': 'cbi-button cbi-button-%s'.format(this.inputstyle || 'button'),
8016 'click': ui.createHandlerFn(this, function(section_id, ev) {
8017 if (this.onclick)
8018 return this.onclick(ev, section_id);
8019
8020 ev.currentTarget.parentNode.nextElementSibling.value = value;
8021 return this.map.save();
8022 }, section_id),
8023 'disabled': ((this.readonly != null) ? this.readonly : this.map.readonly) || null
8024 }, [ btn_title ])
8025 ]);
8026 else
8027 dom.content(outputEl, ' - ');
8028
8029 return E([
8030 outputEl,
8031 hiddenEl.render()
8032 ]);
8033 }
8034 });
8035
8036 /**
8037 * @class HiddenValue
8038 * @memberof LuCI.form
8039 * @augments LuCI.form.Value
8040 * @hideconstructor
8041 * @classdesc
8042 *
8043 * The `HiddenValue` element wraps an {@link LuCI.ui.Hiddenfield} widget.
8044 *
8045 * Hidden value widgets used to be necessary in legacy code which actually
8046 * submitted the underlying HTML form the server. With client side handling of
8047 * forms, there are more efficient ways to store hidden state data.
8048 *
8049 * Since this widget has no visible content, the title and description values
8050 * of this form element should be set to `null` as well to avoid a broken or
8051 * distorted form layout when rendering the option element.
8052 *
8053 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
8054 * The configuration form this section is added to. It is automatically passed
8055 * by [option()]{@link LuCI.form.AbstractSection#option} or
8056 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8057 * option to the section.
8058 *
8059 * @param {LuCI.form.AbstractSection} section
8060 * The configuration section this option is added to. It is automatically passed
8061 * by [option()]{@link LuCI.form.AbstractSection#option} or
8062 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8063 * option to the section.
8064 *
8065 * @param {string} option
8066 * The name of the UCI option to map.
8067 *
8068 * @param {string} [title]
8069 * The title caption of the option element.
8070 *
8071 * @param {string} [description]
8072 * The description text of the option element.
8073 */
8074 var CBIHiddenValue = CBIValue.extend(/** @lends LuCI.form.HiddenValue.prototype */ {
8075 __name__: 'CBI.HiddenValue',
8076
8077 /** @private */
8078 renderWidget: function(section_id, option_index, cfgvalue) {
8079 var widget = new ui.Hiddenfield((cfgvalue != null) ? cfgvalue : this.default, {
8080 id: this.cbid(section_id)
8081 });
8082
8083 return widget.render();
8084 }
8085 });
8086
8087 /**
8088 * @class FileUpload
8089 * @memberof LuCI.form
8090 * @augments LuCI.form.Value
8091 * @hideconstructor
8092 * @classdesc
8093 *
8094 * The `FileUpload` element wraps an {@link LuCI.ui.FileUpload} widget and
8095 * offers the ability to browse, upload and select remote files.
8096 *
8097 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
8098 * The configuration form this section is added to. It is automatically passed
8099 * by [option()]{@link LuCI.form.AbstractSection#option} or
8100 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8101 * option to the section.
8102 *
8103 * @param {LuCI.form.AbstractSection} section
8104 * The configuration section this option is added to. It is automatically passed
8105 * by [option()]{@link LuCI.form.AbstractSection#option} or
8106 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8107 * option to the section.
8108 *
8109 * @param {string} option
8110 * The name of the UCI option to map.
8111 *
8112 * @param {string} [title]
8113 * The title caption of the option element.
8114 *
8115 * @param {string} [description]
8116 * The description text of the option element.
8117 */
8118 var CBIFileUpload = CBIValue.extend(/** @lends LuCI.form.FileUpload.prototype */ {
8119 __name__: 'CBI.FileSelect',
8120
8121 __init__: function(/* ... */) {
8122 this.super('__init__', arguments);
8123
8124 this.show_hidden = false;
8125 this.enable_upload = true;
8126 this.enable_remove = true;
8127 this.root_directory = '/etc/luci-uploads';
8128 },
8129
8130 /**
8131 * Toggle display of hidden files.
8132 *
8133 * Display hidden files when rendering the remote directory listing.
8134 * Note that this is merely a cosmetic feature, hidden files are always
8135 * included in received remote file listings.
8136 *
8137 * The default is `false`, means hidden files are not displayed.
8138 *
8139 * @name LuCI.form.FileUpload.prototype#show_hidden
8140 * @type boolean
8141 * @default false
8142 */
8143
8144 /**
8145 * Toggle file upload functionality.
8146 *
8147 * When set to `true`, the underlying widget provides a button which lets
8148 * the user select and upload local files to the remote system.
8149 * Note that this is merely a cosmetic feature, remote upload access is
8150 * controlled by the session ACL rules.
8151 *
8152 * The default is `true`, means file upload functionality is displayed.
8153 *
8154 * @name LuCI.form.FileUpload.prototype#enable_upload
8155 * @type boolean
8156 * @default true
8157 */
8158
8159 /**
8160 * Toggle remote file delete functionality.
8161 *
8162 * When set to `true`, the underlying widget provides a buttons which let
8163 * the user delete files from remote directories. Note that this is merely
8164 * a cosmetic feature, remote delete permissions are controlled by the
8165 * session ACL rules.
8166 *
8167 * The default is `true`, means file removal buttons are displayed.
8168 *
8169 * @name LuCI.form.FileUpload.prototype#enable_remove
8170 * @type boolean
8171 * @default true
8172 */
8173
8174 /**
8175 * Specify the root directory for file browsing.
8176 *
8177 * This property defines the topmost directory the file browser widget may
8178 * navigate to, the UI will not allow browsing directories outside this
8179 * prefix. Note that this is merely a cosmetic feature, remote file access
8180 * and directory listing permissions are controlled by the session ACL
8181 * rules.
8182 *
8183 * The default is `/etc/luci-uploads`.
8184 *
8185 * @name LuCI.form.FileUpload.prototype#root_directory
8186 * @type string
8187 * @default /etc/luci-uploads
8188 */
8189
8190 /** @private */
8191 renderWidget: function(section_id, option_index, cfgvalue) {
8192 var browserEl = new ui.FileUpload((cfgvalue != null) ? cfgvalue : this.default, {
8193 id: this.cbid(section_id),
8194 name: this.cbid(section_id),
8195 show_hidden: this.show_hidden,
8196 enable_upload: this.enable_upload,
8197 enable_remove: this.enable_remove,
8198 root_directory: this.root_directory,
8199 disabled: (this.readonly != null) ? this.readonly : this.map.readonly
8200 });
8201
8202 return browserEl.render();
8203 }
8204 });
8205
8206 /**
8207 * @class SectionValue
8208 * @memberof LuCI.form
8209 * @augments LuCI.form.Value
8210 * @hideconstructor
8211 * @classdesc
8212 *
8213 * The `SectionValue` widget embeds a form section element within an option
8214 * element container, allowing to nest form sections into other sections.
8215 *
8216 * @param {LuCI.form.Map|LuCI.form.JSONMap} form
8217 * The configuration form this section is added to. It is automatically passed
8218 * by [option()]{@link LuCI.form.AbstractSection#option} or
8219 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8220 * option to the section.
8221 *
8222 * @param {LuCI.form.AbstractSection} section
8223 * The configuration section this option is added to. It is automatically passed
8224 * by [option()]{@link LuCI.form.AbstractSection#option} or
8225 * [taboption()]{@link LuCI.form.AbstractSection#taboption} when adding the
8226 * option to the section.
8227 *
8228 * @param {string} option
8229 * The internal name of the option element holding the section. Since a section
8230 * container element does not read or write any configuration itself, the name
8231 * is only used internally and does not need to relate to any underlying UCI
8232 * option name.
8233 *
8234 * @param {LuCI.form.AbstractSection} subsection_class
8235 * The class to use for instantiating the nested section element. Note that
8236 * the class value itself is expected here, not a class instance obtained by
8237 * calling `new`. The given class argument must be a subclass of the
8238 * `AbstractSection` class.
8239 *
8240 * @param {...*} [class_args]
8241 * All further arguments are passed as-is to the subclass constructor. Refer
8242 * to the corresponding class constructor documentations for details.
8243 */
8244 var CBISectionValue = CBIValue.extend(/** @lends LuCI.form.SectionValue.prototype */ {
8245 __name__: 'CBI.ContainerValue',
8246 __init__: function(map, section, option, cbiClass /*, ... */) {
8247 this.super('__init__', [map, section, option]);
8248
8249 if (!CBIAbstractSection.isSubclass(cbiClass))
8250 throw 'Sub section must be a descendent of CBIAbstractSection';
8251
8252 this.subsection = cbiClass.instantiate(this.varargs(arguments, 4, this.map));
8253 this.subsection.parentoption = this;
8254 },
8255
8256 /**
8257 * Access the embedded section instance.
8258 *
8259 * This property holds a reference to the instantiated nested section.
8260 *
8261 * @name LuCI.form.SectionValue.prototype#subsection
8262 * @type LuCI.form.AbstractSection
8263 * @readonly
8264 */
8265
8266 /** @override */
8267 load: function(section_id) {
8268 return this.subsection.load(section_id);
8269 },
8270
8271 /** @override */
8272 parse: function(section_id) {
8273 return this.subsection.parse(section_id);
8274 },
8275
8276 /** @private */
8277 renderWidget: function(section_id, option_index, cfgvalue) {
8278 return this.subsection.render(section_id);
8279 },
8280
8281 /** @private */
8282 checkDepends: function(section_id) {
8283 this.subsection.checkDepends(section_id);
8284 return CBIValue.prototype.checkDepends.apply(this, [ section_id ]);
8285 },
8286
8287 /**
8288 * Since the section container is not rendering an own widget,
8289 * its `value()` implementation is a no-op.
8290 *
8291 * @override
8292 */
8293 value: function() {},
8294
8295 /**
8296 * Since the section container is not tied to any UCI configuration,
8297 * its `write()` implementation is a no-op.
8298 *
8299 * @override
8300 */
8301 write: function() {},
8302
8303 /**
8304 * Since the section container is not tied to any UCI configuration,
8305 * its `remove()` implementation is a no-op.
8306 *
8307 * @override
8308 */
8309 remove: function() {},
8310
8311 /**
8312 * Since the section container is not tied to any UCI configuration,
8313 * its `cfgvalue()` implementation will always return `null`.
8314 *
8315 * @override
8316 * @returns {null}
8317 */
8318 cfgvalue: function() { return null },
8319
8320 /**
8321 * Since the section container is not tied to any UCI configuration,
8322 * its `formvalue()` implementation will always return `null`.
8323 *
8324 * @override
8325 * @returns {null}
8326 */
8327 formvalue: function() { return null }
8328 });
8329
8330 /**
8331 * @class form
8332 * @memberof LuCI
8333 * @hideconstructor
8334 * @classdesc
8335 *
8336 * The LuCI form class provides high level abstractions for creating
8337 * UCI- or JSON backed configurations forms.
8338 *
8339 * To import the class in views, use `'require form'`, to import it in
8340 * external JavaScript, use `L.require("form").then(...)`.
8341 *
8342 * A typical form is created by first constructing a
8343 * {@link LuCI.form.Map} or {@link LuCI.form.JSONMap} instance using `new` and
8344 * by subsequently adding sections and options to it. Finally
8345 * [render()]{@link LuCI.form.Map#render} is invoked on the instance to
8346 * assemble the HTML markup and insert it into the DOM.
8347 *
8348 * Example:
8349 *
8350 * &lt;pre>
8351 * 'use strict';
8352 * 'require form';
8353 *
8354 * var m, s, o;
8355 *
8356 * m = new form.Map('example', 'Example form',
8357 * 'This is an example form mapping the contents of /etc/config/example');
8358 *
8359 * s = m.section(form.NamedSection, 'first_section', 'example', 'The first section',
8360 * 'This sections maps "config example first_section" of /etc/config/example');
8361 *
8362 * o = s.option(form.Flag, 'some_bool', 'A checkbox option');
8363 *
8364 * o = s.option(form.ListValue, 'some_choice', 'A select element');
8365 * o.value('choice1', 'The first choice');
8366 * o.value('choice2', 'The second choice');
8367 *
8368 * m.render().then(function(node) {
8369 * document.body.appendChild(node);
8370 * });
8371 * &lt;/pre>
8372 */
8373 return baseclass.extend(/** @lends LuCI.form.prototype */ {
8374 Map: CBIMap,
8375 JSONMap: CBIJSONMap,
8376 AbstractSection: CBIAbstractSection,
8377 AbstractValue: CBIAbstractValue,
8378
8379 TypedSection: CBITypedSection,
8380 TableSection: CBITableSection,
8381 GridSection: CBIGridSection,
8382 NamedSection: CBINamedSection,
8383
8384 Value: CBIValue,
8385 DynamicList: CBIDynamicList,
8386 ListValue: CBIListValue,
8387 Flag: CBIFlagValue,
8388 MultiValue: CBIMultiValue,
8389 TextValue: CBITextValue,
8390 DummyValue: CBIDummyValue,
8391 Button: CBIButtonValue,
8392 HiddenValue: CBIHiddenValue,
8393 FileUpload: CBIFileUpload,
8394 SectionValue: CBISectionValue
8395 });
8396 </code></pre>
8397 </article>
8398 </section>
8399
8400
8401
8402
8403
8404
8405
8406
8407 <footer>
8408 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Dec 28 2023 17:55:36 GMT+0000 (Coordinated Universal Time)
8409 </footer>
8410 </div>
8411 </div>
8412 <script>prettyPrint();</script>
8413 <script src="scripts/jaguar.js"></script>
8414 </body>
8415 </html>