mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-26 04:08:21 +01:00
Regen package
This commit is contained in:
parent
2462e97e81
commit
15bad22de6
@ -1,214 +1 @@
|
|||||||
(function() {
|
(function(){var t,i,e;(t=class t extends this.OS.GUI.BasicDialog{constructor(){super("ClientDialog",t.scheme)}main(){var t,i,e,n;if(super.main(),e=$(this.scheme).find("input[type=text]"),this.data)for(i=0,n=e.length;i<n;i++)t=e[i],this.data[t.name]&&(t.value=this.data[t.name]);return this.find("btncancel").onbtclick=()=>this.quit(),this.find("btnok").onbtclick=i=>{var n,a,s;for(n={},a=0,s=e.length;a<s;a++){if(""===(t=e[a]).value)return this.notify(__("Please enter all the fields"));n[t.name]=t.value}return this.handle&&this.handle(n),this.quit()}}}).scheme='<afx-app-window width=\'300\' height=\'160\'>\n <afx-hbox>\n <div data-width="5"></div>\n <afx-vbox>\n <div data-height="5"></div>\n <afx-label data-height="25" text = "__(Client name)"></afx-label>\n <input type="text" name="text" data-height="25" />\n <div data-height="5"></div>\n <afx-label data-height="25" text = "__(URL)"></afx-label>\n <input type="text" name="url" data-height="25" />\n <div data-height="30" style="text-align: right;">\n <afx-button data-id="btnok" text="__(Ok)"></afx-button>\n <afx-button data-id="btncancel" text="__(Cancel)"></afx-button>\n </div>\n </afx-vbox>\n <div data-width="5"></div>\n </afx-hbox>\n</afx-app-window>',(i=class i extends this.OS.GUI.BasicDialog{constructor(){super("ClientListDialog",i.scheme)}main(){return super.main(),this.clist=this.find("client-list"),this.clist.buttons=[{text:"",iconclass:"fa fa-plus-circle",onbtclick:i=>this.openDialog(new t,{title:__("Add new client")}).then(t=>(this.parent.setting.clients.push(t),this.clist.data=this.parent.setting.clients))},{text:"",iconclass:"fa fa-minus-circle",onbtclick:t=>{var i,e;if(e=this.clist.selectedItem,i=this.clist.selected,e)return this.ask({text:__("Do you realy want to delete: `{0}`",e.data.text)}).then(t=>{if(t)return this.parent.setting.clients.splice(i,1),this.clist.data=this.parent.setting.clients})}},{text:"",iconclass:"fa fa-pencil-square-o",onbtclick:i=>{var e;if(e=this.clist.selectedItem)return this.openDialog(new t,{title:__("Add new client"),text:e.data.text,url:e.data.url}).then(t=>{if(t)return e.data.text=t.text,e.data.url=t.url,this.clist.data=this.parent.setting.clients})}}],this.find("btnswitch").onbtclick=t=>{var i;if(i=this.clist.selectedItem)return this.parent.setting.curl=i.data.url,this.parent.setting.cname=i.data.text,this.parent.switchClient(),this.quit()},this.clist.data=this.parent.setting.clients}}).scheme='<afx-app-window width=\'200\' height=\'200\'>\n <afx-vbox>\n <afx-list-view data-id="client-list"></afx-list-view>\n <div data-height="30" style="text-align: right;">\n <afx-button text="__(Switch client)" data-id="btnswitch"></afx-button>\n <div>\n </afx-vbox>\n</afx-app-window>',(e=class extends this.OS.application.BaseApplication{constructor(t){super("GPClient",t)}main(){return this.setting.clients||(this.setting.clients=[]),this.container=this.find("container"),this.bindKey("CTRL-M",()=>this.openDialog(new i,{title:__("Client Manager")})),this.switchClient()}switchClient(){return this.setting.curl?(this.container.src=this.setting.curl,this.scheme.apptitle=this.setting.cname):this.notify(__("No client selected, manager client in menu Options > Client manager"))}menu(){return[{text:"__(Options)",nodes:[{text:"__(Client manager)",shortcut:"C-M"}],onchildselect:t=>this.openDialog(new i,{title:__("Client Manager")})}]}}).singleton=!0,this.OS.register("GPClient",e)}).call(this);
|
||||||
var ClientDialog, ClientListDialog, GPClient;
|
|
||||||
|
|
||||||
ClientDialog = class ClientDialog extends this.OS.GUI.BasicDialog {
|
|
||||||
constructor() {
|
|
||||||
super("ClientDialog", ClientDialog.scheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
var el, i, inputs, len;
|
|
||||||
super.main();
|
|
||||||
inputs = $(this.scheme).find("input[type=text]");
|
|
||||||
if (this.data) {
|
|
||||||
for (i = 0, len = inputs.length; i < len; i++) {
|
|
||||||
el = inputs[i];
|
|
||||||
if (this.data[el.name]) {
|
|
||||||
el.value = this.data[el.name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.find("btncancel").onbtclick = () => {
|
|
||||||
return this.quit();
|
|
||||||
};
|
|
||||||
return this.find("btnok").onbtclick = (e) => {
|
|
||||||
var data, j, len1;
|
|
||||||
data = {};
|
|
||||||
for (j = 0, len1 = inputs.length; j < len1; j++) {
|
|
||||||
el = inputs[j];
|
|
||||||
if (el.value === "") {
|
|
||||||
return this.notify(__("Please enter all the fields"));
|
|
||||||
}
|
|
||||||
data[el.name] = el.value;
|
|
||||||
}
|
|
||||||
if (this.handle) {
|
|
||||||
this.handle(data);
|
|
||||||
}
|
|
||||||
return this.quit();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
ClientDialog.scheme = `<afx-app-window width='300' height='160'>
|
|
||||||
<afx-hbox>
|
|
||||||
<div data-width="5"></div>
|
|
||||||
<afx-vbox>
|
|
||||||
<div data-height="5"></div>
|
|
||||||
<afx-label data-height="25" text = "__(Client name)"></afx-label>
|
|
||||||
<input type="text" name="text" data-height="25" />
|
|
||||||
<div data-height="5"></div>
|
|
||||||
<afx-label data-height="25" text = "__(URL)"></afx-label>
|
|
||||||
<input type="text" name="url" data-height="25" />
|
|
||||||
<div data-height="30" style="text-align: right;">
|
|
||||||
<afx-button data-id="btnok" text="__(Ok)"></afx-button>
|
|
||||||
<afx-button data-id="btncancel" text="__(Cancel)"></afx-button>
|
|
||||||
</div>
|
|
||||||
</afx-vbox>
|
|
||||||
<div data-width="5"></div>
|
|
||||||
</afx-hbox>
|
|
||||||
</afx-app-window>`;
|
|
||||||
|
|
||||||
|
|
||||||
ClientListDialog = class ClientListDialog extends this.OS.GUI.BasicDialog {
|
|
||||||
constructor() {
|
|
||||||
super("ClientListDialog", ClientListDialog.scheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
super.main();
|
|
||||||
this.clist = this.find("client-list");
|
|
||||||
this.clist.buttons = [
|
|
||||||
{
|
|
||||||
text: "",
|
|
||||||
iconclass: "fa fa-plus-circle",
|
|
||||||
onbtclick: (e) => {
|
|
||||||
return this.openDialog(new ClientDialog(),
|
|
||||||
{
|
|
||||||
title: __("Add new client")
|
|
||||||
}).then((data) => {
|
|
||||||
//console.log(data)
|
|
||||||
this.parent.setting.clients.push(data);
|
|
||||||
return this.clist.data = this.parent.setting.clients;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "",
|
|
||||||
iconclass: "fa fa-minus-circle",
|
|
||||||
onbtclick: (e) => {
|
|
||||||
var index,
|
|
||||||
item;
|
|
||||||
item = this.clist.selectedItem;
|
|
||||||
index = this.clist.selected;
|
|
||||||
if (!item) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return this.ask({
|
|
||||||
text: __("Do you realy want to delete: `{0}`",
|
|
||||||
item.data.text)
|
|
||||||
}).then((d) => {
|
|
||||||
if (!d) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.parent.setting.clients.splice(index,
|
|
||||||
1);
|
|
||||||
return this.clist.data = this.parent.setting.clients;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "",
|
|
||||||
iconclass: "fa fa-pencil-square-o",
|
|
||||||
onbtclick: (e) => {
|
|
||||||
var item;
|
|
||||||
item = this.clist.selectedItem;
|
|
||||||
if (!item) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return this.openDialog(new ClientDialog(),
|
|
||||||
{
|
|
||||||
title: __("Add new client"),
|
|
||||||
text: item.data.text,
|
|
||||||
url: item.data.url
|
|
||||||
}).then((data) => {
|
|
||||||
//console.log(data)
|
|
||||||
if (!data) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
item.data.text = data.text;
|
|
||||||
item.data.url = data.url;
|
|
||||||
return this.clist.data = this.parent.setting.clients;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
this.find("btnswitch").onbtclick = (e) => {
|
|
||||||
var item;
|
|
||||||
item = this.clist.selectedItem;
|
|
||||||
if (!item) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.parent.setting.curl = item.data.url;
|
|
||||||
this.parent.setting.cname = item.data.text;
|
|
||||||
this.parent.switchClient();
|
|
||||||
return this.quit();
|
|
||||||
};
|
|
||||||
return this.clist.data = this.parent.setting.clients;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
ClientListDialog.scheme = `<afx-app-window width='200' height='200'>
|
|
||||||
<afx-vbox>
|
|
||||||
<afx-list-view data-id="client-list"></afx-list-view>
|
|
||||||
<div data-height="30" style="text-align: right;">
|
|
||||||
<afx-button text="__(Switch client)" data-id="btnswitch"></afx-button>
|
|
||||||
<div>
|
|
||||||
</afx-vbox>
|
|
||||||
</afx-app-window>`;
|
|
||||||
|
|
||||||
GPClient = class GPClient extends this.OS.application.BaseApplication {
|
|
||||||
constructor(args) {
|
|
||||||
super("GPClient", args);
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
if (!this.setting.clients) {
|
|
||||||
this.setting.clients = [];
|
|
||||||
}
|
|
||||||
this.container = this.find("container");
|
|
||||||
this.bindKey("CTRL-M", () => {
|
|
||||||
return this.openDialog(new ClientListDialog(), {
|
|
||||||
title: __("Client Manager")
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return this.switchClient();
|
|
||||||
}
|
|
||||||
|
|
||||||
switchClient() {
|
|
||||||
if (this.setting.curl) {
|
|
||||||
this.container.src = this.setting.curl;
|
|
||||||
return this.scheme.apptitle = this.setting.cname;
|
|
||||||
} else {
|
|
||||||
return this.notify(__("No client selected, manager client in menu Options > Client manager"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
menu() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
text: "__(Options)",
|
|
||||||
nodes: [
|
|
||||||
{
|
|
||||||
text: "__(Client manager)",
|
|
||||||
shortcut: "C-M"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
onchildselect: (e) => {
|
|
||||||
return this.openDialog(new ClientListDialog(),
|
|
||||||
{
|
|
||||||
title: __("Client Manager")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
GPClient.singleton = true;
|
|
||||||
|
|
||||||
this.OS.register("GPClient", GPClient);
|
|
||||||
|
|
||||||
}).call(this);
|
|
Binary file not shown.
@ -109,6 +109,16 @@
|
|||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip"
|
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Docify/build/release/Docify.zip"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pkgname": "GPClient",
|
||||||
|
"name": "Generic Purpose client",
|
||||||
|
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GPClient/README.md",
|
||||||
|
"category": "Internet",
|
||||||
|
"author": "Xuan Sang LE",
|
||||||
|
"version": "0.1.0-a",
|
||||||
|
"dependencies": [],
|
||||||
|
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GPClient/build/release/GPClient.zip"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pkgname": "GraphEditor",
|
"pkgname": "GraphEditor",
|
||||||
"name": "Graph Editor",
|
"name": "Graph Editor",
|
||||||
@ -119,16 +129,6 @@
|
|||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip"
|
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GraphEditor/build/release/GraphEditor.zip"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"pkgname": "IOMail",
|
|
||||||
"name": "IOHub mail",
|
|
||||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/IOMail/README.md",
|
|
||||||
"category": "Other",
|
|
||||||
"author": "",
|
|
||||||
"version": "0.1.0-a",
|
|
||||||
"dependencies": [],
|
|
||||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/IOMail/build/release/IOMail.zip"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"pkgname": "Katex",
|
"pkgname": "Katex",
|
||||||
"name": "Katex",
|
"name": "Katex",
|
||||||
|
Loading…
Reference in New Issue
Block a user