diff --git a/src/ui/ab.js b/src/ui/ab.js
new file mode 100644
index 000000000..c72d475df
--- /dev/null
+++ b/src/ui/ab.js
@@ -0,0 +1,283 @@
+import { handler, string2RGB, platformSvg, msgbox,translate,is_win,OS } from "./common.js";
+import { app, formatId, createNewConnect,svg_menu } from "./index.js"; // TODO check app obj
+// TODO transform
+const svg_tile = ;
+const svg_list = ;
+const search_icon = ;
+const clear_icon = ;
+
+function getSessionsStyleOption(type) {
+ return (type || "recent") + "-sessions-style";
+}
+
+export function getSessionsStyle(type) {
+ var v = handler.xcall("get_local_option",getSessionsStyleOption(type));
+ if (!v) v = type == "ab" ? "list" : "tile";
+ return v;
+}
+
+var searchPatterns = {};
+
+export class SearchBar extends Element {
+
+ this(props) {
+ this.type = (props || {}).type || "";
+ }
+
+ render() {
+
+ let value = searchPatterns[this.type] || "";
+ setTimeout(() => { this.$("input").value = value; }, 1);
+ return (
+
+
+
+ {c.name[0].toUpperCase()}
+
+
+
{c.name}
+
({c.peer_id})
+
{translate('Connected')} {" "} {getElaspsed(c.time)}
+
+
+
+ {c.is_file_transfer || c.port_forward ? "" :
{translate('Permissions')}
}
+ {c.is_file_transfer || c.port_forward ? "" :
}
+ {c.port_forward ?
Port Forwarding: {c.port_forward}
: ""}
+
+
+ {auth ? "" : }
+ {auth ? "" : }
+ {auth ? : ""}
+
+ {c.is_file_transfer || c.port_forward ? "" :
{svg_chat}
}
+
+
+ {c.is_file_transfer || c.port_forward ? "" : }
+
+
);
+ }
+
+ sendMsg(text) {
+ if (!text) return;
+ let { cid, connection } = this;
+ checkClickTime(function() {
+ connection.msgs.push({ name: "me", text: text, time: getNowStr()});
+ handler.xcall("send_msg",cid, text);
+ body.componentUpdate();
+ });
+ }
+
+ ["on click at icon.keyboard"](e) {
+ let { cid, connection } = this;
+ checkClickTime(function() {
+ connection.keyboard = !connection.keyboard;
+ body.componentUpdate();
+ handler.xcall("switch_permission",cid, "keyboard", connection.keyboard);
+ });
+ }
+
+ ["on click at icon.clipboard"]() {
+ let { cid, connection } = this;
+ checkClickTime(function() {
+ connection.clipboard = !connection.clipboard;
+ body.componentUpdate();
+ handler.xcall("switch_permission",cid, "clipboard", connection.clipboard);
+ });
+ }
+
+ ["on click at icon.audio"]() {
+ let { cid, connection } = this;
+ checkClickTime(function() {
+ connection.audio = !connection.audio;
+ body.componentUpdate();
+ handler.xcall("switch_permission",cid, "audio", connection.audio);
+ });
+ }
+
+ ["on click at button#accept"]() {
+ let { cid, connection } = this;
+ checkClickTime(function() {
+ connection.authorized = true;
+ body.componentUpdate();
+ handler.xcall("authorize",cid);
+ setTimeout(()=>view.state = Window.WINDOW_MINIMIZED,30);
+ });
+ }
+
+ ["on click at button#dismiss"]() {
+ let cid = this.cid;
+ checkClickTime(function() {
+ handler.close(cid); // TEST
+ });
+ }
+
+ ["on click at button#disconnect"]() {
+ let cid = this.cid;
+ checkClickTime(function() {
+ handler.close(cid); // TEST
+ });
+ }
+ ["on click at div.chaticon"]() {
+ checkClickTime(function() {
+ show_chat = !show_chat;
+ adaptSize();
+ });
+ }
+}
+
+$("body").content(