blob: d46bfb0aa78f13716e286cc69b0b035598b6112c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
'use strict';
'require form';
'require shadowsocks-libev as ss';
function startsWith(str, search) {
return str.substring(0, search.length) === search;
}
return L.view.extend({
render: function() {
var m, s, o;
m = new form.Map('shadowsocks-libev', _('Remote Servers'),
_('Definition of remote shadowsocks servers. \
Disable any of them will also disable instances referring to it.'));
s = m.section(form.GridSection, 'server');
s.addremove = true;
o = s.option(form.Flag, 'disabled', _('Disable'));
o.editable = true;
ss.options_server(s);
return m.render();
},
addFooter: function() {
var p = '#edit=';
if (startsWith(location.hash, p)) {
var section_id = location.hash.substring(p.length);
var editBtn = document.querySelector('#cbi-shadowsocks-libev-' + section_id + ' button.cbi-button-edit');
if (editBtn)
editBtn.click();
}
return this.super('addFooter', arguments);
}
});
|