debug msgbox in sciter ui

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-10-17 09:41:02 +08:00
parent 77de0d05f9
commit 9385e95b4e
7 changed files with 57 additions and 48 deletions

View File

@@ -76,28 +76,34 @@ class AddressBook: Reactor.Component
event click $(#add-id) (_, __) {
var me = this;
msgbox("custom-add-id", translate("Add ID"), <div .form>
msgbox(
"custom-add-id",
translate("Add ID"),
<div .form>
<div>{translate("whitelist_sep")}</div>
<textarea .outline-focus spellcheck="false" name="text" style="overflow: scroll-indicator; width:*; height: 160px; font-size: 1.2em; padding: 0.5em;"></textarea>
</div>, function(res=null) {
if (!res) return;
var value = (res.text || "").trim();
var values = value.split(/[\s,;\n]+/g);
if (values.length == 0) return;
for (var v in values) {
var found;
for (var i = 0; i < ab.peers.length; ++i) {
if (ab.peers[i].id == v) {
found = true;
break;
</div>,
"",
function(res=null) {
if (!res) return;
var value = (res.text || "").trim();
var values = value.split(/[\s,;\n]+/g);
if (values.length == 0) return;
for (var v in values) {
var found;
for (var i = 0; i < ab.peers.length; ++i) {
if (ab.peers[i].id == v) {
found = true;
break;
}
}
if (found) continue;
ab.peers.push({ id: v });
}
if (found) continue;
ab.peers.push({ id: v });
}
updateAb();
me.update();
}, 300);
updateAb();
me.update();
},
300);
}
event click $(#add-tag) (_, __) {
@@ -105,7 +111,7 @@ class AddressBook: Reactor.Component
msgbox("custom-add-tag", translate("Add Tag"), <div .form>
<div>{translate("whitelist_sep")}</div>
<textarea .outline-focus spellcheck="false" name="text" style="overflow: scroll-indicator; width:*; height: 160px; font-size: 1.2em; padding: 0.5em;"></textarea>
</div>, function(res=null) {
</div>, "", function(res=null) {
if (!res) return;
var value = (res.text || "").trim();
var values = value.split(/[\s,;\n]+/g);
@@ -483,7 +489,7 @@ class SessionList: Reactor.Component {
msgbox("custom-rename", "Rename", "<div .form> \
<div><input|text name='name' .outline-focus style='width: *; height: 23px', value='" + old_name + "' /></div> \
</div> \
", function(res=null) {
", "", function(res=null) {
if (!res) return;
var name = (res.name || "").trim();
if (name != old_name) {
@@ -506,7 +512,7 @@ class SessionList: Reactor.Component {
}
}
if (!peer) return;
msgbox("custom-edit-tag", "Edit Tag", <SelectTags tags={peer.tags || []} />, function(res=null) {
msgbox("custom-edit-tag", "Edit Tag", <SelectTags tags={peer.tags || []} />, "", function(res=null) {
if (!res) return;
peer.tags = selectTags.tags;
updateAb();
@@ -738,7 +744,7 @@ function editRdpPort() {
<div><span>{translate('Port')}:</span>{port}</div>
<div><span>{translate('Username')}:</span><input|text name="username" value={name0} /></div>
<div><span>{translate('Password')}:</span><PasswordComponent value={pass0} /></div>
</div>, function(res=null) {
</div>, "", function(res=null) {
if (!res) return;
var p = (res.port || '').trim();
if (p != p0) {