mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-25 11:48:21 +01:00
update some package
This commit is contained in:
parent
6cda32bd3c
commit
04225e74fb
@ -349,6 +349,10 @@
|
||||
{
|
||||
text: "File dialog",
|
||||
id: "file"
|
||||
},
|
||||
{
|
||||
text: "Text dialog",
|
||||
id: "text"
|
||||
}
|
||||
]);
|
||||
return btrun.set("onbtclick", (e) => {
|
||||
@ -419,6 +423,13 @@
|
||||
}).then((f, name) => {
|
||||
return this.notify(f, name);
|
||||
});
|
||||
case "text":
|
||||
return this.openDialog("TextDialog", {
|
||||
title: "Text dialog review",
|
||||
value: "txt data"
|
||||
}).then((d) => {
|
||||
return this.notify(d);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
"email": "xsang.le@gmail.com",
|
||||
"licences": "GPLv3"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"mimes":["none"],
|
||||
"iconclass": "fa fa-delicious",
|
||||
|
Binary file not shown.
@ -153,7 +153,8 @@ class ShowCase extends this.OS.GUI.BaseApplication
|
||||
{ text: "YesNo dialog", id: "yesno" },
|
||||
{ text: "Selection dialog", id: "selection" },
|
||||
{ text: "About dialog", id: "about" },
|
||||
{ text: "File dialog", id: "file" }
|
||||
{ text: "File dialog", id: "file" },
|
||||
{ text: "Text dialog", id: "text" }
|
||||
]
|
||||
|
||||
btrun.set "onbtclick", (e) =>
|
||||
@ -216,6 +217,14 @@ class ShowCase extends this.OS.GUI.BaseApplication
|
||||
})
|
||||
.then (f, name) =>
|
||||
@notify f, name
|
||||
|
||||
when "text"
|
||||
@openDialog("TextDialog", {
|
||||
title: "Text dialog review",
|
||||
value: "txt data"
|
||||
})
|
||||
.then (d) =>
|
||||
@notify d
|
||||
else return
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
"email": "xsang.le@gmail.com",
|
||||
"licences": "GPLv3"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"mimes":["none"],
|
||||
"iconclass": "fa fa-delicious",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/README.md",
|
||||
"category": "Other",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.1-a",
|
||||
"version": "0.0.2-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/build/release/ShowCase.zip"
|
||||
},
|
||||
{
|
||||
@ -50,7 +50,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/README.md",
|
||||
"category": "System",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.1-a",
|
||||
"version": "0.0.2-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/build/release/wTerm.zip"
|
||||
}
|
||||
|
||||
|
@ -171,6 +171,3 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
afx-app-window[data-id="ClipboardDialog"] textarea {
|
||||
resize: none
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function() {
|
||||
void 0;
|
||||
var ClipboardDialog, wTerm;
|
||||
var wTerm;
|
||||
|
||||
// Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
|
||||
|
||||
@ -18,50 +18,7 @@
|
||||
// General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
//along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
ClipboardDialog = class ClipboardDialog extends this.OS.GUI.BasicDialog {
|
||||
constructor() {
|
||||
super("ClipboardDialog", ClipboardDialog.scheme);
|
||||
}
|
||||
|
||||
init() {
|
||||
this.find("btnOk").set("onbtclick", (e) => {
|
||||
var value;
|
||||
value = $(this.find("txtInput")).val();
|
||||
if (!(value && value !== "")) {
|
||||
return;
|
||||
}
|
||||
if (this.handle) {
|
||||
this.handle(value);
|
||||
}
|
||||
return this.quit();
|
||||
});
|
||||
return this.find("btnCancel").set("onbtclick", (e) => {
|
||||
return this.quit();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ClipboardDialog.scheme = `<afx-app-window data-id = "ClipboardDialog" width='400' height='300' apptitle = "__(Clipboard)">
|
||||
<afx-vbox>
|
||||
<afx-hbox>
|
||||
<div data-width = "10" />
|
||||
<afx-vbox>
|
||||
<div data-height="10" />
|
||||
<textarea data-id= "txtInput" />
|
||||
<div data-height="10" />
|
||||
<afx-hbox data-height="30">
|
||||
<div />
|
||||
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" />
|
||||
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" />
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
<div data-width = "10" />
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
</afx-app-window>`;
|
||||
|
||||
//along with this program. If not, see https://www.gnu.org/licenses/
|
||||
wTerm = class wTerm extends this.OS.GUI.BaseApplication {
|
||||
constructor(args) {
|
||||
super("wTerm", args);
|
||||
@ -122,22 +79,26 @@
|
||||
var text;
|
||||
switch (data.id) {
|
||||
case "paste":
|
||||
return this.openDialog(new ClipboardDialog()).then((d) => {
|
||||
return this._api.getClipboard().then((text) => {
|
||||
var i, len, results, v;
|
||||
if (!(text && text !== "")) {
|
||||
return;
|
||||
}
|
||||
results = [];
|
||||
for (i = 0, len = d.length; i < len; i++) {
|
||||
v = d[i];
|
||||
for (i = 0, len = text.length; i < len; i++) {
|
||||
v = text[i];
|
||||
results.push(this.socket.send(`i${v}`));
|
||||
}
|
||||
return results;
|
||||
}).catch((e) => {
|
||||
return this.error(__("Unable to paste"), e);
|
||||
});
|
||||
case "copy":
|
||||
text = this.term.getSelection();
|
||||
if (!(text && text !== "")) {
|
||||
return;
|
||||
}
|
||||
this._api.setClipboard(text);
|
||||
return console.log(this._api.getClipboard());
|
||||
return this._api.setClipboard(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -14,41 +14,7 @@
|
||||
# General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
#along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
class ClipboardDialog extends this.OS.GUI.BasicDialog
|
||||
constructor: () ->
|
||||
super "ClipboardDialog", ClipboardDialog.scheme
|
||||
|
||||
init: () ->
|
||||
@find("btnOk").set "onbtclick", (e) =>
|
||||
value = $(@find "txtInput").val()
|
||||
return unless value and value isnt ""
|
||||
@handle value if @handle
|
||||
@quit()
|
||||
|
||||
@find("btnCancel").set "onbtclick", (e) =>
|
||||
@quit()
|
||||
|
||||
ClipboardDialog.scheme = """
|
||||
<afx-app-window data-id = "ClipboardDialog" width='400' height='300' apptitle = "__(Clipboard)">
|
||||
<afx-vbox>
|
||||
<afx-hbox>
|
||||
<div data-width = "10" />
|
||||
<afx-vbox>
|
||||
<div data-height="10" />
|
||||
<textarea data-id= "txtInput" />
|
||||
<div data-height="10" />
|
||||
<afx-hbox data-height="30">
|
||||
<div />
|
||||
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" />
|
||||
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" />
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
<div data-width = "10" />
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
</afx-app-window>
|
||||
"""
|
||||
#along with this program. If not, see https://www.gnu.org/licenses/
|
||||
|
||||
class wTerm extends this.OS.GUI.BaseApplication
|
||||
constructor: (args) ->
|
||||
@ -89,13 +55,14 @@ class wTerm extends this.OS.GUI.BaseApplication
|
||||
mctxHandle: (data) ->
|
||||
switch data.id
|
||||
when "paste"
|
||||
@openDialog(new ClipboardDialog()).then (d) =>
|
||||
@socket.send "i#{v}" for v in d
|
||||
@_api.getClipboard().then (text) =>
|
||||
return unless text and text isnt ""
|
||||
@socket.send "i#{v}" for v in text
|
||||
.catch (e) => @error __("Unable to paste"), e
|
||||
when "copy"
|
||||
text = @term.getSelection()
|
||||
return unless text and text isnt ""
|
||||
@_api.setClipboard text
|
||||
console.log @_api.getClipboard()
|
||||
else
|
||||
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
afx-app-window[data-id="ClipboardDialog"] textarea {
|
||||
resize: none
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
Loading…
Reference in New Issue
Block a user