mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-25 03:38:21 +01:00
update all packages
This commit is contained in:
parent
68b2b87f1f
commit
6c5d0193de
@ -1,35 +1 @@
|
||||
(function() {
|
||||
void 0;
|
||||
var About;
|
||||
|
||||
About = class About extends this.OS.GUI.BaseApplication {
|
||||
constructor(args) {
|
||||
super("About", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var me, path;
|
||||
me = this;
|
||||
this.container = this.find("container");
|
||||
path = "os://README.md";
|
||||
path.asFileHandle().read().then(function(txt) {
|
||||
var converter;
|
||||
converter = new showdown.Converter();
|
||||
return ($(me.container)).html(converter.makeHtml(txt));
|
||||
}).catch(() => {
|
||||
return this.notify(__("Unable to read: {0}", path));
|
||||
});
|
||||
return this.find("btnclose").set("onbtclick", () => {
|
||||
return this.quit();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
About.singleton = true;
|
||||
|
||||
About.dependencies = ["os://scripts/showdown.min.js"];
|
||||
|
||||
this.OS.register("About", About);
|
||||
|
||||
}).call(this);
|
||||
(function(){var t;(t=class extends this.OS.GUI.BaseApplication{constructor(t){super("About",t)}main(){var t,n;return t=this,this.container=this.find("container"),(n="os://README.md").asFileHandle().read().then((function(n){var e;return e=new showdown.Converter,$(t.container).html(e.makeHtml(n))})).catch(()=>this.notify(__("Unable to read: {0}",n))),this.find("btnclose").set("onbtclick",()=>this.quit())}}).singleton=!0,t.dependencies=["os://scripts/showdown.min.js"],this.OS.register("About",t)}).call(this);
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"app":"About",
|
||||
"name":"__(About AntOS)",
|
||||
"name":"About AntOS",
|
||||
"description":"AntOS about",
|
||||
"info":{
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-question-circle",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -1,12 +1,12 @@
|
||||
{
|
||||
"app":"About",
|
||||
"name":"__(About AntOS)",
|
||||
"name":"About AntOS",
|
||||
"description":"AntOS about",
|
||||
"info":{
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-question-circle",
|
||||
"mimes":["none"],
|
||||
|
14
ActivityMonitor/build/debug/main.css
Normal file
14
ActivityMonitor/build/debug/main.css
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
afx-app-window[data-id="am-window"] afx-button{
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
afx-app-window[data-id="am-window"] afx-grid-view afx-grid-row afx-grid-cell{
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
|
||||
afx-app-window[data-id="am-window"] afx-grid-view .grid_row_header afx-grid-cell{
|
||||
border: 1px solid #a6a6a6;
|
||||
padding: 5px;
|
||||
}
|
@ -1,131 +1 @@
|
||||
(function() {
|
||||
void 0;
|
||||
var ActivityMonitor, _APP, _PM;
|
||||
|
||||
// Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
|
||||
|
||||
// AnTOS Web desktop is is licensed under the GNU General Public
|
||||
// License v3.0, see the LICENCE file for more information
|
||||
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// 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/.
|
||||
_PM = this.OS.PM;
|
||||
|
||||
_APP = this.OS.APP;
|
||||
|
||||
ActivityMonitor = class ActivityMonitor extends this.OS.GUI.BaseApplication {
|
||||
constructor(args) {
|
||||
super("ActivityMonitor", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var header;
|
||||
this.scheme.set("apptitle", "Activity Monitor");
|
||||
this.grid = this.find("mygrid");
|
||||
this.on("btclick", (e) => {
|
||||
var app, data, item;
|
||||
if (e.id !== "btkill") {
|
||||
return;
|
||||
}
|
||||
item = this.grid.get("selectedRow");
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
data = item.get("data")[0];
|
||||
app = _PM.appByPid(data.text);
|
||||
if (app) {
|
||||
return app.quit(true);
|
||||
}
|
||||
});
|
||||
header = [
|
||||
{
|
||||
width: 50,
|
||||
text: "__(Pid)"
|
||||
},
|
||||
{
|
||||
text: "__(Name)"
|
||||
},
|
||||
{
|
||||
text: "__(Type)",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
width: 80,
|
||||
text: "__(Alive (ms))"
|
||||
}
|
||||
];
|
||||
this.gdata = {
|
||||
processes: {},
|
||||
alive: []
|
||||
};
|
||||
this.grid.set("header", header);
|
||||
return this.monitor();
|
||||
}
|
||||
|
||||
monitor() {
|
||||
var now;
|
||||
//get all current running process
|
||||
this.gdata.alive = [];
|
||||
now = (new Date()).getTime();
|
||||
$.each(_PM.processes, (i, d) => {
|
||||
return $.each(d, (j, a) => {
|
||||
if (this.gdata.processes[a.pid]) {
|
||||
this.gdata.processes[a.pid][3].text = now - a.birth;
|
||||
this.gdata.processes[a.pid][3].domel.update(); //add it
|
||||
} else {
|
||||
this.gdata.processes[a.pid] = [
|
||||
{
|
||||
text: a.pid
|
||||
},
|
||||
{
|
||||
icon: _APP[a.name].type === 1 ? _APP[a.name].meta.icon : a.icon,
|
||||
iconclass: _APP[a.name].type === 1 ? _APP[a.name].meta.iconclass : a.iconclass,
|
||||
text: a.name
|
||||
},
|
||||
{
|
||||
text: _APP[a.name].type === 1 ? "__(Application)" : "__(Service)"
|
||||
},
|
||||
{
|
||||
text: now - a.birth
|
||||
}
|
||||
];
|
||||
this.grid.push(this.gdata.processes[a.pid]);
|
||||
}
|
||||
return this.gdata.alive.push(a.pid);
|
||||
});
|
||||
});
|
||||
$.each(this.gdata.processes, (i, e) => {
|
||||
if (($.inArray(Number(i), this.gdata.alive)) < 0) {
|
||||
this.grid.remove(this.gdata.processes[i].domel);
|
||||
this.gdata.processes[i] = void 0;
|
||||
return delete this.gdata.processes[i];
|
||||
}
|
||||
});
|
||||
return this.timer = setTimeout((() => {
|
||||
return this.monitor();
|
||||
}), 500);
|
||||
}
|
||||
|
||||
cleanup(e) {
|
||||
if (this.timer) {
|
||||
return clearTimeout(this.timer);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ActivityMonitor.singleton = true;
|
||||
|
||||
this.OS.register("ActivityMonitor", ActivityMonitor);
|
||||
|
||||
}).call(this);
|
||||
(function(){var t,i,e;e=this.OS.PM,i=this.OS.APP,(t=class extends this.OS.GUI.BaseApplication{constructor(t){super("ActivityMonitor",t)}main(){var t;return this.scheme.set("apptitle","Activity Monitor"),this.grid=this.find("mygrid"),this.on("btclick",t=>{var i,s,a;if("btkill"===t.id&&(a=this.grid.get("selectedRow")))return s=a.get("data")[0],(i=e.appByPid(s.text))?i.quit(!0):void 0}),t=[{width:50,text:"__(Pid)"},{text:"__(Name)"},{text:"__(Type)",width:80},{width:80,text:"__(Alive (ms))"}],this.gdata={processes:{},alive:[]},this.grid.set("header",t),this.monitor()}monitor(){var t;return this.gdata.alive=[],t=(new Date).getTime(),$.each(e.processes,(e,s)=>$.each(s,(e,s)=>(this.gdata.processes[s.pid]?(this.gdata.processes[s.pid][3].text=t-s.birth,this.gdata.processes[s.pid][3].domel.update()):(this.gdata.processes[s.pid]=[{text:s.pid},{icon:1===i[s.name].type?i[s.name].meta.icon:s.icon,iconclass:1===i[s.name].type?i[s.name].meta.iconclass:s.iconclass,text:s.name},{text:1===i[s.name].type?"__(Application)":"__(Service)"},{text:t-s.birth}],this.grid.push(this.gdata.processes[s.pid])),this.gdata.alive.push(s.pid)))),$.each(this.gdata.processes,(t,i)=>{if($.inArray(Number(t),this.gdata.alive)<0)return this.grid.remove(this.gdata.processes[t].domel),this.gdata.processes[t]=void 0,delete this.gdata.processes[t]}),this.timer=setTimeout(()=>this.monitor(),500)}cleanup(t){if(this.timer)return clearTimeout(this.timer)}}).singleton=!0,this.OS.register("ActivityMonitor",t)}).call(this);
|
@ -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-heartbeat",
|
||||
"mimes":["none"]
|
||||
|
Binary file not shown.
@ -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-heartbeat",
|
||||
"mimes":["none"]
|
||||
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "ActivityMonitor",
|
||||
"root": "home://workspace/antosdk-apps/ActivityMonitor",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee"],
|
||||
"copies": ["scheme.html", "package.json", "README.md"]
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LEs",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"]
|
||||
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LEs",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"]
|
||||
|
@ -1,242 +1 @@
|
||||
(function() {
|
||||
void 0;
|
||||
var MarkOn;
|
||||
|
||||
// Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
|
||||
|
||||
// AnTOS Web desktop is is licensed under the GNU General Public
|
||||
// License v3.0, see the LICENCE file for more information
|
||||
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// 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/.
|
||||
MarkOn = class MarkOn extends this.OS.GUI.BaseApplication {
|
||||
constructor(args) {
|
||||
super("MarkOn", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var markarea;
|
||||
markarea = this.find("markarea");
|
||||
this.container = this.find("mycontainer");
|
||||
this.previewOn = false;
|
||||
if (this.args && this.args.length > 0) {
|
||||
this.currfile = this.args[0].path.asFileHandle();
|
||||
} else {
|
||||
this.currfile = "Untitled".asFileHandle();
|
||||
}
|
||||
this.editormux = false;
|
||||
this.editor = new SimpleMDE({
|
||||
element: markarea,
|
||||
autofocus: true,
|
||||
tabSize: 4,
|
||||
indentWithTabs: true,
|
||||
toolbar: [
|
||||
"bold",
|
||||
"italic",
|
||||
"heading",
|
||||
"|",
|
||||
"quote",
|
||||
"code",
|
||||
"unordered-list",
|
||||
"ordered-list",
|
||||
"|",
|
||||
"link",
|
||||
"image",
|
||||
"table",
|
||||
"horizontal-rule",
|
||||
"|",
|
||||
{
|
||||
name: "preview",
|
||||
className: "fa fa-eye no-disable",
|
||||
action: (e) => {
|
||||
this.previewOn = !this.previewOn;
|
||||
return SimpleMDE.togglePreview(e);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
//if(self.previewOn) toggle the highlight
|
||||
//{
|
||||
// var container = self._scheme.find(self,"Text")
|
||||
// .$element.getElementsByClassName("editor-preview");
|
||||
// if(container.length == 0) return;
|
||||
// var codes = container[0].getElementsByTagName('pre');
|
||||
// codes.forEach(function(el){
|
||||
// hljs.highlightBlock(el);
|
||||
// });
|
||||
// //console.log(code);
|
||||
//}
|
||||
this.editor.codemirror.on("change", () => {
|
||||
if (this.editormux) {
|
||||
return;
|
||||
}
|
||||
if (this.currfile.dirty === false) {
|
||||
this.currfile.dirty = true;
|
||||
return this.scheme.set("apptitle", `${this.currfile.basename}*`);
|
||||
}
|
||||
});
|
||||
this.on("hboxchange", (e) => {
|
||||
return this.resizeContent();
|
||||
});
|
||||
this.bindKey("ALT-N", () => {
|
||||
return this.actionFile(`${this.name}-New`);
|
||||
});
|
||||
this.bindKey("ALT-O", () => {
|
||||
return this.actionFile(`${this.name}-Open`);
|
||||
});
|
||||
this.bindKey("CTRL-S", () => {
|
||||
return this.actionFile(`${this.name}-Save`);
|
||||
});
|
||||
this.bindKey("ALT-W", () => {
|
||||
return this.actionFile(`${this.name}-Saveas`);
|
||||
});
|
||||
this.resizeContent();
|
||||
return this.open(this.currfile);
|
||||
}
|
||||
|
||||
resizeContent() {
|
||||
var cheight, children, statusbar, titlebar, toolbar;
|
||||
children = ($(this.container)).children();
|
||||
titlebar = (($(this.scheme)).find(".afx-window-top"))[0];
|
||||
toolbar = children[1];
|
||||
statusbar = children[4];
|
||||
cheight = ($(this.scheme)).height() - ($(titlebar)).height() - ($(toolbar)).height() - ($(statusbar)).height() - 40;
|
||||
return ($(children[2])).css("height", cheight + "px");
|
||||
}
|
||||
|
||||
open(file) {
|
||||
//find table
|
||||
if (file.path === "Untitled") {
|
||||
return;
|
||||
}
|
||||
file.dirty = false;
|
||||
return file.read().then((d) => {
|
||||
this.currfile = file;
|
||||
this.editormux = true;
|
||||
this.editor.value(d);
|
||||
this.scheme.set("apptitle", `${this.currfile.basename}`);
|
||||
return this.editormux = false;
|
||||
}).catch((e) => {
|
||||
return this.error(__("Unable to open: {0}", file.path), e);
|
||||
});
|
||||
}
|
||||
|
||||
save(file) {
|
||||
return file.write("text/plain").then((d) => {
|
||||
if (d.error) {
|
||||
return this.error(__("Error saving file {0}: {1}", file.basename, d.error));
|
||||
}
|
||||
file.dirty = false;
|
||||
file.text = file.basename;
|
||||
return this.scheme.set("apptitle", `${this.currfile.basename}`);
|
||||
}).catch((e) => {
|
||||
return this.error(__("Unable to save file: {0}", file.path), e);
|
||||
});
|
||||
}
|
||||
|
||||
menu() {
|
||||
var menu;
|
||||
menu = [
|
||||
{
|
||||
text: "__(File)",
|
||||
child: [
|
||||
{
|
||||
text: "__(New)",
|
||||
dataid: `${this.name}-New`,
|
||||
shortcut: "A-N"
|
||||
},
|
||||
{
|
||||
text: "__(Open)",
|
||||
dataid: `${this.name}-Open`,
|
||||
shortcut: "A-O"
|
||||
},
|
||||
{
|
||||
text: "__(Save)",
|
||||
dataid: `${this.name}-Save`,
|
||||
shortcut: "C-S"
|
||||
},
|
||||
{
|
||||
text: "__(Save as)",
|
||||
dataid: `${this.name}-Saveas`,
|
||||
shortcut: "A-W"
|
||||
}
|
||||
],
|
||||
onchildselect: (e) => {
|
||||
return this.actionFile(e.data.item.get("data").dataid);
|
||||
}
|
||||
}
|
||||
];
|
||||
return menu;
|
||||
}
|
||||
|
||||
actionFile(e) {
|
||||
var saveas;
|
||||
saveas = () => {
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Save as"),
|
||||
file: this.currfile
|
||||
}).then((f) => {
|
||||
var d;
|
||||
d = f.file.path.asFileHandle();
|
||||
if (f.file.type === "file") {
|
||||
d = d.parent();
|
||||
}
|
||||
this.currfile.setPath(`${d.path}/${f.name}`);
|
||||
return this.save(this.currfile);
|
||||
});
|
||||
};
|
||||
switch (e) {
|
||||
case `${this.name}-Open`:
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Open file")
|
||||
}).then((f) => {
|
||||
return this.open(f.file.path.asFileHandle());
|
||||
});
|
||||
case `${this.name}-Save`:
|
||||
this.currfile.cache = this.editor.value();
|
||||
if (this.currfile.basename) {
|
||||
return this.save(this.currfile);
|
||||
}
|
||||
return saveas();
|
||||
case `${this.name}-Saveas`:
|
||||
this.currfile.cache = this.editor.value();
|
||||
return saveas();
|
||||
case `${this.name}-New`:
|
||||
this.currfile = "Untitled".asFileHandle();
|
||||
this.currfile.cache = "";
|
||||
return this.editor.value("");
|
||||
}
|
||||
}
|
||||
|
||||
cleanup(evt) {
|
||||
if (!this.currfile.dirty) {
|
||||
return;
|
||||
}
|
||||
evt.preventDefault();
|
||||
return this.openDialog("YesNoDialog", (d) => {
|
||||
if (d) {
|
||||
this.currfile.dirty = false;
|
||||
return this.quit();
|
||||
}
|
||||
}, __("Quit"), {
|
||||
text: __("Quit without saving ?")
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
MarkOn.dependencies = ["os://scripts/mde/simplemde.min.js", "os://scripts/mde/simplemde.min.css"];
|
||||
|
||||
this.OS.register("MarkOn", MarkOn);
|
||||
|
||||
}).call(this);
|
||||
(function(){var e;(e=class extends this.OS.GUI.BaseApplication{constructor(e){super("MarkOn",e)}main(){var e;return e=this.find("markarea"),this.container=this.find("mycontainer"),this.previewOn=!1,this.args&&this.args.length>0?this.currfile=this.args[0].path.asFileHandle():this.currfile="Untitled".asFileHandle(),this.editormux=!1,this.editor=new SimpleMDE({element:e,autofocus:!0,tabSize:4,indentWithTabs:!0,toolbar:["bold","italic","heading","|","quote","code","unordered-list","ordered-list","|","link","image","table","horizontal-rule","|",{name:"preview",className:"fa fa-eye no-disable",action:e=>(this.previewOn=!this.previewOn,SimpleMDE.togglePreview(e))}]}),this.editor.codemirror.on("change",()=>{if(!this.editormux)return!1===this.currfile.dirty?(this.currfile.dirty=!0,this.scheme.set("apptitle",this.currfile.basename+"*")):void 0}),this.on("hboxchange",e=>this.resizeContent()),this.bindKey("ALT-N",()=>this.actionFile(this.name+"-New")),this.bindKey("ALT-O",()=>this.actionFile(this.name+"-Open")),this.bindKey("CTRL-S",()=>this.actionFile(this.name+"-Save")),this.bindKey("ALT-W",()=>this.actionFile(this.name+"-Saveas")),this.resizeContent(),this.open(this.currfile)}resizeContent(){var e,t,i,s,a;return t=$(this.container).children(),s=$(this.scheme).find(".afx-window-top")[0],a=t[1],i=t[4],e=$(this.scheme).height()-$(s).height()-$(a).height()-$(i).height()-40,$(t[2]).css("height",e+"px")}open(e){if("Untitled"!==e.path)return e.dirty=!1,e.read().then(t=>(this.currfile=e,this.editormux=!0,this.editor.value(t),this.scheme.set("apptitle",""+this.currfile.basename),this.editormux=!1)).catch(t=>this.error(__("Unable to open: {0}",e.path),t))}save(e){return e.write("text/plain").then(t=>t.error?this.error(__("Error saving file {0}: {1}",e.basename,t.error)):(e.dirty=!1,e.text=e.basename,this.scheme.set("apptitle",""+this.currfile.basename))).catch(t=>this.error(__("Unable to save file: {0}",e.path),t))}menu(){return[{text:"__(File)",child:[{text:"__(New)",dataid:this.name+"-New",shortcut:"A-N"},{text:"__(Open)",dataid:this.name+"-Open",shortcut:"A-O"},{text:"__(Save)",dataid:this.name+"-Save",shortcut:"C-S"},{text:"__(Save as)",dataid:this.name+"-Saveas",shortcut:"A-W"}],onchildselect:e=>this.actionFile(e.data.item.get("data").dataid)}]}actionFile(e){var t;switch(t=()=>this.openDialog("FileDialog",{title:__("Save as"),file:this.currfile}).then(e=>{var t;return t=e.file.path.asFileHandle(),"file"===e.file.type&&(t=t.parent()),this.currfile.setPath(`${t.path}/${e.name}`),this.save(this.currfile)}),e){case this.name+"-Open":return this.openDialog("FileDialog",{title:__("Open file")}).then(e=>this.open(e.file.path.asFileHandle()));case this.name+"-Save":return this.currfile.cache=this.editor.value(),this.currfile.basename?this.save(this.currfile):t();case this.name+"-Saveas":return this.currfile.cache=this.editor.value(),t();case this.name+"-New":return this.currfile="Untitled".asFileHandle(),this.currfile.cache="",this.editor.value("")}}cleanup(e){if(this.currfile.dirty)return e.preventDefault(),this.openDialog("YesNoDialog",e=>{if(e)return this.currfile.dirty=!1,this.quit()},__("Quit"),{text:__("Quit without saving ?")})}}).dependencies=["os://scripts/mde/simplemde.min.js","os://scripts/mde/simplemde.min.css"],this.OS.register("MarkOn",e)}).call(this);
|
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Utils",
|
||||
"iconclass":"fa fa-leanpub",
|
||||
"mimes":["text/.*"]
|
||||
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"version":"0.0.2-a",
|
||||
"category":"Utils",
|
||||
"iconclass":"fa fa-leanpub",
|
||||
"mimes":["text/.*"]
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.4-a",
|
||||
"version":"0.0.5-a",
|
||||
"category":"Utils",
|
||||
"iconclass":"fa fa-eye",
|
||||
"mimes":["[^\/]*/.*pdf", "image/.*"]
|
||||
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.4-a",
|
||||
"version":"0.0.5-a",
|
||||
"category":"Utils",
|
||||
"iconclass":"fa fa-eye",
|
||||
"mimes":["[^\/]*/.*pdf", "image/.*"]
|
||||
|
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
||||
"email": "xsang.le@gmail.com",
|
||||
"licences": "GPLv3"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"Other",
|
||||
"mimes":["none"],
|
||||
"iconclass": "fa fa-delicious",
|
||||
|
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
"email": "xsang.le@gmail.com",
|
||||
"licences": "GPLv3"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"Other",
|
||||
"mimes":["none"],
|
||||
"iconclass": "fa fa-delicious",
|
||||
|
@ -1,144 +1 @@
|
||||
(function() {
|
||||
void 0;
|
||||
var TinyEditor;
|
||||
|
||||
TinyEditor = class TinyEditor extends this.OS.GUI.BaseApplication {
|
||||
constructor(args) {
|
||||
super("TinyEditor", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
this.editor = this.find("editor");
|
||||
this.bindKey("ALT-N", () => {
|
||||
return this.newFile();
|
||||
});
|
||||
this.bindKey("ALT-O", () => {
|
||||
return this.openFile();
|
||||
});
|
||||
this.bindKey("CTRL-S", () => {
|
||||
return this.saveFile();
|
||||
});
|
||||
this.filehandle = this.args && this.args.length > 0 ? this.args[0].path.asFileHandle() : null;
|
||||
$(this.editor).on('input', (e) => {
|
||||
if (this.filehandle.dirty === true) {
|
||||
return;
|
||||
}
|
||||
this.filehandle.dirty = true;
|
||||
return this.scheme.set("apptitle", `${this.filehandle.path}*`);
|
||||
});
|
||||
return this.read();
|
||||
}
|
||||
|
||||
menu() {
|
||||
var m;
|
||||
m = [
|
||||
{
|
||||
text: "__(File)",
|
||||
child: [
|
||||
{
|
||||
text: "__(New)",
|
||||
dataid: "new",
|
||||
shortcut: 'A-N'
|
||||
},
|
||||
{
|
||||
text: "__(Open)",
|
||||
dataid: "open",
|
||||
shortcut: 'A-O'
|
||||
},
|
||||
{
|
||||
text: "__(Save)",
|
||||
dataid: "save",
|
||||
shortcut: 'C-S'
|
||||
}
|
||||
],
|
||||
onchildselect: (e) => {
|
||||
switch (e.data.item.get("data").dataid) {
|
||||
case "new":
|
||||
return this.newFile();
|
||||
case "open":
|
||||
return this.openFile();
|
||||
case "save":
|
||||
return this.saveFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
return m;
|
||||
}
|
||||
|
||||
newFile() {
|
||||
this.filehandle = null;
|
||||
return this.read();
|
||||
}
|
||||
|
||||
openFile() {
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Open file")
|
||||
}).then((d) => {
|
||||
this.filehandle = d.file.path.asFileHandle();
|
||||
return this.read();
|
||||
});
|
||||
}
|
||||
|
||||
saveFile() {
|
||||
this.filehandle.cache = this.editor.value;
|
||||
if (this.filehandle.path !== "Untitled") {
|
||||
return this.write();
|
||||
}
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Save as"),
|
||||
file: this.filehandle
|
||||
}).then((f) => {
|
||||
var d;
|
||||
d = f.file.path.asFileHandle();
|
||||
if (f.file.type === "file") {
|
||||
d = d.parent();
|
||||
}
|
||||
this.filehandle.setPath(`${d.path}/${f.name}`);
|
||||
return this.write();
|
||||
});
|
||||
}
|
||||
|
||||
read() {
|
||||
this.editor.value = "";
|
||||
if (this.filehandle === null) {
|
||||
this.filehandle = "Untitled".asFileHandle();
|
||||
this.scheme.set("apptitle", "Untitled");
|
||||
return;
|
||||
}
|
||||
return this.filehandle.read().then((d) => {
|
||||
this.scheme.set("apptitle", this.filehandle.path);
|
||||
return this.editor.value = d;
|
||||
}).catch((e) => {
|
||||
return this.error(__("Unable to read file content"));
|
||||
});
|
||||
}
|
||||
|
||||
write() {
|
||||
return this.filehandle.write("text/plain").then((d) => {
|
||||
this.filehandle.dirty = false;
|
||||
return this.scheme.set("apptitle", `${this.filehandle.path}`);
|
||||
}).catch((e) => {
|
||||
return this.error(__("Error saving file {0}", this.filehandle.path), e);
|
||||
});
|
||||
}
|
||||
|
||||
cleanup(e) {
|
||||
if (!this.filehandle.dirty) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
return this.ask({
|
||||
title: "__(Quit)",
|
||||
text: "__(Quit without saving?)"
|
||||
}).then(() => {
|
||||
this.filehandle.dirty = false;
|
||||
return this.quit();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.OS.register("TinyEditor", TinyEditor);
|
||||
|
||||
}).call(this);
|
||||
(function(){var e;e=class extends this.OS.GUI.BaseApplication{constructor(e){super("TinyEditor",e)}main(){return this.editor=this.find("editor"),this.bindKey("ALT-N",()=>this.newFile()),this.bindKey("ALT-O",()=>this.openFile()),this.bindKey("CTRL-S",()=>this.saveFile()),this.filehandle=this.args&&this.args.length>0?this.args[0].path.asFileHandle():null,$(this.editor).on("input",e=>{if(!0!==this.filehandle.dirty)return this.filehandle.dirty=!0,this.scheme.set("apptitle",this.filehandle.path+"*")}),this.read()}menu(){return[{text:"__(File)",child:[{text:"__(New)",dataid:"new",shortcut:"A-N"},{text:"__(Open)",dataid:"open",shortcut:"A-O"},{text:"__(Save)",dataid:"save",shortcut:"C-S"}],onchildselect:e=>{switch(e.data.item.get("data").dataid){case"new":return this.newFile();case"open":return this.openFile();case"save":return this.saveFile()}}}]}newFile(){return this.filehandle=null,this.read()}openFile(){return this.openDialog("FileDialog",{title:__("Open file")}).then(e=>(this.filehandle=e.file.path.asFileHandle(),this.read()))}saveFile(){return this.filehandle.cache=this.editor.value,"Untitled"!==this.filehandle.path?this.write():this.openDialog("FileDialog",{title:__("Save as"),file:this.filehandle}).then(e=>{var t;return t=e.file.path.asFileHandle(),"file"===e.file.type&&(t=t.parent()),this.filehandle.setPath(`${t.path}/${e.name}`),this.write()})}read(){return this.editor.value="",null===this.filehandle?(this.filehandle="Untitled".asFileHandle(),void this.scheme.set("apptitle","Untitled")):this.filehandle.read().then(e=>(this.scheme.set("apptitle",this.filehandle.path),this.editor.value=e)).catch(e=>this.error(__("Unable to read file content")))}write(){return this.filehandle.write("text/plain").then(e=>(this.filehandle.dirty=!1,this.scheme.set("apptitle",""+this.filehandle.path))).catch(e=>this.error(__("Error saving file {0}",this.filehandle.path),e))}cleanup(e){if(this.filehandle.dirty)return e.preventDefault(),this.ask({title:"__(Quit)",text:"__(Quit without saving?)"}).then(()=>(this.filehandle.dirty=!1,this.quit()))}},this.OS.register("TinyEditor",e)}).call(this);
|
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["text/.*"]
|
||||
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.2-a",
|
||||
"version":"0.0.3-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["text/.*"]
|
||||
|
@ -1,11 +1,11 @@
|
||||
[
|
||||
{
|
||||
"pkgname": "About",
|
||||
"name": "__(About AntOS)",
|
||||
"name": "About AntOS",
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/About/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/About/build/release/About.zip"
|
||||
},
|
||||
{
|
||||
@ -14,7 +14,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ActivityMonitor/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/ActivityMonitor/build/release/ActivityMonitor.zip"
|
||||
},
|
||||
{
|
||||
@ -23,7 +23,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/README.md",
|
||||
"category": "System",
|
||||
"author": "Xuan Sang LEs",
|
||||
"version": "0.0.2-a",
|
||||
"version": "0.0.3-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/build/release/LuaPlayground.zip"
|
||||
},
|
||||
{
|
||||
@ -32,7 +32,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/MarkOn/README.md",
|
||||
"category": "Utils",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.1-a",
|
||||
"version": "0.0.2-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/MarkOn/build/release/MarkOn.zip"
|
||||
},
|
||||
{
|
||||
@ -41,7 +41,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Preview/README.md",
|
||||
"category": "Utils",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.4-a",
|
||||
"version": "0.0.5-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Preview/build/release/Preview.zip"
|
||||
},
|
||||
{
|
||||
@ -50,7 +50,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/README.md",
|
||||
"category": "Other",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.2-a",
|
||||
"version": "0.0.3-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ShowCase/build/release/ShowCase.zip"
|
||||
},
|
||||
{
|
||||
@ -59,7 +59,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/TinyEditor/README.md",
|
||||
"category": "Other",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.2-a",
|
||||
"version": "0.0.3-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/TinyEditor/build/release/TinyEditor.zip"
|
||||
},
|
||||
{
|
||||
@ -68,7 +68,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/README.md",
|
||||
"category": "System",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.0.3-a",
|
||||
"version": "0.0.4-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/wTerm/build/release/wTerm.zip"
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.3-a",
|
||||
"version":"0.0.4-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.0.3-a",
|
||||
"version":"0.0.4-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
Loading…
Reference in New Issue
Block a user