mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-07 22:18:29 +01:00
Add more packages, disable Antunnel auto connect
This commit is contained in:
parent
fcaa1e9b1c
commit
21f560d2b6
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "About",
|
||||
"root": "home://workspace/antosdk-apps/About",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
6
AceDiff/README.md
Normal file
6
AceDiff/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# AceDiff
|
||||
This is a wrapper for Ace Editor to provide a 2-panel diffing/merging tool that visualizes differences in two documents and allows users to copy changes from to the other.
|
||||
|
||||
It's built on top of google-diff-match-patch library. That lib handles the hard part: the computation of the document diffs. Ace-diff just visualizes that information as line-diffs in the editors.
|
||||
|
||||
Github page: [https://github.com/ace-diff/ace-diff](https://github.com/ace-diff/ace-diff)
|
2
AceDiff/ace-diff-dark.min.css
vendored
Normal file
2
AceDiff/ace-diff-dark.min.css
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.acediff__wrap{display:flex;flex-direction:row;position:absolute;bottom:0;top:0;left:0;height:100%;width:100%;overflow:auto}.acediff__gutter{flex:0 0 60px;border-left:1px solid #000;border-right:1px solid #000;overflow:hidden}.acediff__gutter,.acediff__gutter svg{background-color:#272727}.acediff__left,.acediff__right{height:100%;flex:1}.acediff__diffLine{background-color:#004d7a;border-top:1px solid #003554;border-bottom:1px solid #003554;position:absolute;z-index:4}.acediff__diffLine.targetOnly{height:0!important;border-top:1px solid #003554;border-bottom:0;position:absolute}.acediff__connector{fill:#004d7a;stroke:#003554}.acediff__copy--left,.acediff__copy--right{position:relative}.acediff__copy--left div,.acediff__copy--right div{color:#fff;text-shadow:1px 1px rgba(0,0,0,.7);position:absolute;margin:2px 3px;cursor:pointer}.acediff__copy--right div:hover{color:#61a2e7}.acediff__copy--left{float:right}.acediff__copy--left div{right:0}.acediff__copy--left div:hover{color:#f7b742}
|
||||
/*# sourceMappingURL=/ace-diff-dark.min.css.map */
|
32
AceDiff/ace-diff.min.js
vendored
Normal file
32
AceDiff/ace-diff.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
AceDiff/build/debug/README.md
Normal file
6
AceDiff/build/debug/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# AceDiff
|
||||
This is a wrapper for Ace Editor to provide a 2-panel diffing/merging tool that visualizes differences in two documents and allows users to copy changes from to the other.
|
||||
|
||||
It's built on top of google-diff-match-patch library. That lib handles the hard part: the computation of the document diffs. Ace-diff just visualizes that information as line-diffs in the editors.
|
||||
|
||||
Github page: [https://github.com/ace-diff/ace-diff](https://github.com/ace-diff/ace-diff)
|
3
AceDiff/build/debug/main.css
Normal file
3
AceDiff/build/debug/main.css
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
.acediff__wrap{display:flex;flex-direction:row;position:absolute;bottom:0;top:0;left:0;height:100%;width:100%;overflow:auto}.acediff__gutter{flex:0 0 60px;border-left:1px solid #000;border-right:1px solid #000;overflow:hidden}.acediff__gutter,.acediff__gutter svg{background-color:#272727}.acediff__left,.acediff__right{height:100%;flex:1}.acediff__diffLine{background-color:#004d7a;border-top:1px solid #003554;border-bottom:1px solid #003554;position:absolute;z-index:4}.acediff__diffLine.targetOnly{height:0!important;border-top:1px solid #003554;border-bottom:0;position:absolute}.acediff__connector{fill:#004d7a;stroke:#003554}.acediff__copy--left,.acediff__copy--right{position:relative}.acediff__copy--left div,.acediff__copy--right div{color:#fff;text-shadow:1px 1px rgba(0,0,0,.7);position:absolute;margin:2px 3px;cursor:pointer}.acediff__copy--right div:hover{color:#61a2e7}.acediff__copy--left{float:right}.acediff__copy--left div{right:0}.acediff__copy--left div:hover{color:#f7b742}
|
||||
/*# sourceMappingURL=/ace-diff-dark.min.css.map */
|
1
AceDiff/build/debug/main.js
Normal file
1
AceDiff/build/debug/main.js
Normal file
File diff suppressed because one or more lines are too long
15
AceDiff/build/debug/package.json
Normal file
15
AceDiff/build/debug/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"pkgname": "AceDiff",
|
||||
"name":"AceDiff addon library",
|
||||
"description":"AceDiff add on library",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"3.0.3-r",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-cog",
|
||||
"mimes":["none"],
|
||||
"dependencies":[],
|
||||
"locale": {}
|
||||
}
|
BIN
AceDiff/build/release/AceDiff.zip
Normal file
BIN
AceDiff/build/release/AceDiff.zip
Normal file
Binary file not shown.
15
AceDiff/package.json
Normal file
15
AceDiff/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"pkgname": "AceDiff",
|
||||
"name":"AceDiff addon library",
|
||||
"description":"AceDiff add on library",
|
||||
"info":{
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"3.0.3-r",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-cog",
|
||||
"mimes":["none"],
|
||||
"dependencies":[],
|
||||
"locale": {}
|
||||
}
|
7
AceDiff/project.json
Normal file
7
AceDiff/project.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "AceDiff",
|
||||
"css": ["ace-diff-dark.min.css"],
|
||||
"javascripts": ["ace-diff.min.js"],
|
||||
"coffees": [],
|
||||
"copies": ["package.json", "README.md"]
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "ActivityMonitor",
|
||||
"root": "home://workspace/antosdk-apps/ActivityMonitor",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee"],
|
||||
|
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@lxsang.me"
|
||||
},
|
||||
"version":"0.1.4-a",
|
||||
"version":"0.1.5-a",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -13,7 +13,7 @@ class AntunnelService extends OS.application.BaseService
|
||||
@onchildselect = (e) => @action e
|
||||
|
||||
init: () ->
|
||||
@start() if @systemsetting.system.tunnel_uri
|
||||
# @start() if @systemsetting.system.tunnel_uri
|
||||
@watch 1500, () =>
|
||||
new_status = false
|
||||
new_status = true if Antunnel.tunnel isnt undefined
|
||||
|
@ -9,7 +9,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@lxsang.me"
|
||||
},
|
||||
"version":"0.1.4-a",
|
||||
"version":"0.1.5-a",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Antunnel",
|
||||
"root": "home://workspace/antosdk-apps/Antunnel",
|
||||
"css": [],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/Antunnel.coffee", "coffees/AntunnelService.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Archive",
|
||||
"root": "home://workspace/antosdk-apps/Archive",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Blogger",
|
||||
"root": "home://workspace/antosdk-apps/Blogger",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee", "dialogs.coffee", "tags.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Booklet",
|
||||
"root": "home://workspace/antosdk-apps/Booklet",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee", "coffees/common.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Clipper",
|
||||
"root": "home://workspace/antosdk-apps/Clipper",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": ["javascripts/html2canvas.js"],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "DBDecoder",
|
||||
"root": "home://workspace/antosdk-apps/DBDecoder",
|
||||
"css": [],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
2
DiffEditor/README.md
Normal file
2
DiffEditor/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# DiffEditor
|
||||
View and edit files in diff mode
|
19
DiffEditor/assets/scheme.html
Normal file
19
DiffEditor/assets/scheme.html
Normal file
@ -0,0 +1,19 @@
|
||||
<afx-app-window apptitle="Diff Editor" width="650" height="400" data-id="DiffEditor">
|
||||
<afx-vbox>
|
||||
<afx-hbox >
|
||||
<afx-file-view data-id="fileview" min-width="150" data-width="150" view="tree" status="false"></afx-file-view>
|
||||
<afx-resizer data-width="3"></afx-resizer>
|
||||
<afx-vbox>
|
||||
<afx-hbox data-height="20">
|
||||
<afx-label data-id="left-file" class="file-label"></afx-label>
|
||||
<afx-label data-id="right-file" class="file-label"></afx-label>
|
||||
</afx-hbox>
|
||||
<div data-id="diffeditor" style="position: relative;" ></div>
|
||||
</afx-vbox>
|
||||
</afx-hbox>
|
||||
<afx-hbox data-height="25" data-id="status-bar">
|
||||
<div class="status-text"></div>
|
||||
<afx-list-view data-id="langmode" dropdown="true" data-width="150"></afx-list-view>
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
</afx-app-window>
|
2
DiffEditor/build/debug/README.md
Normal file
2
DiffEditor/build/debug/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# DiffEditor
|
||||
View and edit files in diff mode
|
13
DiffEditor/build/debug/main.css
Normal file
13
DiffEditor/build/debug/main.css
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
afx-app-window[data-id="DiffEditor"] afx-hbox[data-id="status-bar"] {
|
||||
background-color: #007ACC;
|
||||
}
|
||||
afx-app-window[data-id="DiffEditor"] .status-text {
|
||||
color: white;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
afx-app-window[data-id="DiffEditor"] afx-label.file-label {
|
||||
background-color: #333333;
|
||||
color: white;
|
||||
}
|
275
DiffEditor/build/debug/main.js
Normal file
275
DiffEditor/build/debug/main.js
Normal file
@ -0,0 +1,275 @@
|
||||
(function() {
|
||||
var DiffEditor;
|
||||
|
||||
DiffEditor = class DiffEditor extends this.OS.application.BaseApplication {
|
||||
constructor(args) {
|
||||
super("DiffEditor", args);
|
||||
}
|
||||
|
||||
main() {
|
||||
var j, len, list, opts, ref, v;
|
||||
this.editor_cnt = this.find("diffeditor");
|
||||
this.fileview = this.find("fileview");
|
||||
this.fileview.fetch = (path) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
return path.asFileHandle().read().then((d) => {
|
||||
if (d.error) {
|
||||
return reject(d.error);
|
||||
}
|
||||
return resolve(d.result);
|
||||
}).catch((e) => {
|
||||
return reject(__e(e));
|
||||
});
|
||||
});
|
||||
};
|
||||
this.fileview.onfileopen = (e) => {
|
||||
if (!(e.data && e.data.path)) {
|
||||
return;
|
||||
}
|
||||
if (e.data.type === "dir") {
|
||||
return;
|
||||
}
|
||||
return this.openFile(e.data.path.asFileHandle());
|
||||
};
|
||||
this.currdir = void 0;
|
||||
ace.config.set('basePath', "scripts/ace");
|
||||
ace.require("ace/ext/language_tools");
|
||||
this.modelist = ace.require("ace/ext/modelist");
|
||||
list = [];
|
||||
ref = this.modelist.modes;
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
v = ref[j];
|
||||
list.push({
|
||||
text: v.caption,
|
||||
mode: v.mode
|
||||
});
|
||||
}
|
||||
this.langlist = this.find("langmode");
|
||||
this.langlist.data = list;
|
||||
this.langlist.onlistselect = (e) => {
|
||||
this.editors.left.getSession().setMode(e.data.item.data.mode);
|
||||
return this.editors.right.getSession().setMode(e.data.item.data.mode);
|
||||
};
|
||||
this.differ = new AceDiff({
|
||||
// ace: window.ace,
|
||||
element: this.editor_cnt,
|
||||
theme: "ace/theme/monokai",
|
||||
left: {
|
||||
content: ''
|
||||
},
|
||||
right: {
|
||||
content: ''
|
||||
}
|
||||
});
|
||||
this.editors = this.differ.getEditors();
|
||||
opts = {
|
||||
enableBasicAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
enableLiveAutocompletion: true,
|
||||
highlightActiveLine: true,
|
||||
highlightSelectedWord: true,
|
||||
behavioursEnabled: true,
|
||||
//wrap: true,
|
||||
fontSize: "10pt",
|
||||
showInvisibles: true
|
||||
};
|
||||
this.editors.left.setOptions(opts);
|
||||
this.editors.right.setOptions(opts);
|
||||
this.editors.left.current_file = void 0;
|
||||
this.editors.right.current_file = void 0;
|
||||
this.editors.left.afx_label = this.find("left-file");
|
||||
this.editors.right.afx_label = this.find("right-file");
|
||||
this.editors.left.mux = false;
|
||||
this.editors.right.mux = false;
|
||||
this.on("resize", () => {
|
||||
this.editors = this.differ.getEditors();
|
||||
this.editors.left.resize();
|
||||
return this.editors.right.resize();
|
||||
});
|
||||
$('.acediff__left .ace_scrollbar-v', this.editor_cnt).scroll(() => {
|
||||
return this.editors.right.session.setScrollTop(this.editors.left.session.getScrollTop());
|
||||
});
|
||||
$('.acediff__right .ace_scrollbar-v', this.editor_cnt).scroll(() => {
|
||||
return this.editors.left.session.setScrollTop(this.editors.right.session.getScrollTop());
|
||||
});
|
||||
this.editors.left.on("focus", (e) => {
|
||||
return this.current_editor = this.editors.left;
|
||||
});
|
||||
this.editors.right.on("focus", (e) => {
|
||||
return this.current_editor = this.editors.right;
|
||||
});
|
||||
this.editors.left.on("input", (e) => {
|
||||
if (this.editors.left.mux) {
|
||||
return this.editors.left.mux = false;
|
||||
}
|
||||
if (!this.editors.left.current_file) {
|
||||
return this.editors.left.afx_label.text = __("Temporary file");
|
||||
}
|
||||
if (this.editors.left.current_file.dirty) {
|
||||
return;
|
||||
}
|
||||
this.editors.left.current_file.dirty = true;
|
||||
return this.editors.left.afx_label.text += "*";
|
||||
});
|
||||
this.editors.right.on("input", (e) => {
|
||||
if (this.editors.right.mux) {
|
||||
return this.editors.right.mux = false;
|
||||
}
|
||||
if (!this.editors.right.current_file) {
|
||||
return this.editors.right.afx_label.text = __("Temporary file");
|
||||
}
|
||||
if (this.editors.right.current_file.dirty) {
|
||||
return;
|
||||
}
|
||||
this.editors.right.current_file.dirty = true;
|
||||
return this.editors.right.afx_label.text += "*";
|
||||
});
|
||||
this.current_editor = this.editors.left;
|
||||
this.current_editor.focus();
|
||||
this.bindKey("ALT-O", () => {
|
||||
return this.menuAction("open");
|
||||
});
|
||||
this.bindKey("ALT-F", () => {
|
||||
return this.menuAction("opendir");
|
||||
});
|
||||
this.bindKey("CTRL-S", () => {
|
||||
return this.menuAction("save");
|
||||
});
|
||||
return this.toggleSideBar();
|
||||
}
|
||||
|
||||
toggleSideBar() {
|
||||
if (this.currdir) {
|
||||
$(this.fileview).show();
|
||||
this.fileview.path = this.currdir.path;
|
||||
} else {
|
||||
$(this.fileview).hide();
|
||||
}
|
||||
return this.trigger("resize");
|
||||
}
|
||||
|
||||
menu() {
|
||||
return [
|
||||
{
|
||||
text: __("File"),
|
||||
nodes: [
|
||||
{
|
||||
text: __("Open"),
|
||||
dataid: "open",
|
||||
shortcut: "A-O"
|
||||
},
|
||||
{
|
||||
text: __("Open Folder"),
|
||||
dataid: "opendir",
|
||||
shortcut: "A-F"
|
||||
},
|
||||
{
|
||||
text: __("Save"),
|
||||
dataid: "save",
|
||||
shortcut: "C-S"
|
||||
}
|
||||
],
|
||||
onchildselect: (e) => {
|
||||
return this.menuAction(e.data.item.data.dataid);
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
openFile(file) {
|
||||
this.current_editor.mux = true;
|
||||
return file.read().then((d) => {
|
||||
var i, item, j, len, m, ref, v;
|
||||
file.cache = d;
|
||||
this.current_editor.current_file = file;
|
||||
this.current_editor.afx_label.text = file.path;
|
||||
this.current_editor.setValue(d, -1);
|
||||
// select current mode
|
||||
m = this.modelist.getModeForPath(file.path);
|
||||
ref = this.langlist.data;
|
||||
for (i = j = 0, len = ref.length; j < len; i = ++j) {
|
||||
v = ref[i];
|
||||
if (v.mode === m.mode) {
|
||||
item = i;
|
||||
}
|
||||
}
|
||||
if (item === void 0) {
|
||||
return;
|
||||
}
|
||||
return this.langlist.selected = item;
|
||||
});
|
||||
}
|
||||
|
||||
menuAction(dataid) {
|
||||
var fn;
|
||||
switch (dataid) {
|
||||
case "open":
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Open file"),
|
||||
mimes: ["text/.*", "application/json", "application/javascript"]
|
||||
}).then((f) => {
|
||||
return this.openFile(f.file.path.asFileHandle());
|
||||
});
|
||||
case "opendir":
|
||||
return this.openDialog("FileDialog", {
|
||||
title: __("Open folder"),
|
||||
mimes: ["dir"]
|
||||
}).then((f) => {
|
||||
this.currdir = f.file.path.asFileHandle();
|
||||
return this.toggleSideBar();
|
||||
});
|
||||
case "save":
|
||||
fn = (ed) => {
|
||||
if (!(ed.current_file && ed.current_file.dirty)) {
|
||||
return;
|
||||
}
|
||||
ed.current_file.cache = ed.getValue();
|
||||
return ed.current_file.write("text/plain").then((r) => {
|
||||
ed.current_file.dirty = false;
|
||||
ed.afx_label.text = ed.current_file.path;
|
||||
return this.notify(__("File {0} saved", ed.current_file.path));
|
||||
}).catch((e) => {
|
||||
return this.error(__("Unable to save to: {0}", ed.current_file.path), e);
|
||||
});
|
||||
};
|
||||
fn(this.editors.left);
|
||||
return fn(this.editors.right);
|
||||
default:
|
||||
return console.log(dataid);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup(evt) {
|
||||
var dirty;
|
||||
dirty = false;
|
||||
if (this.editors.left.current_file && this.editors.left.current_file.dirty) {
|
||||
dirty = true;
|
||||
}
|
||||
if (this.editors.right.current_file && this.editors.right.current_file.dirty) {
|
||||
dirty = true;
|
||||
}
|
||||
if (dirty) {
|
||||
evt.preventDefault();
|
||||
return this.ask({
|
||||
title: __("Unsaved changes"),
|
||||
text: __("Ignore modification ?")
|
||||
}).then((d) => {
|
||||
if (!d) {
|
||||
return;
|
||||
}
|
||||
this.editors.left.current_file.dirty = false;
|
||||
this.editors.right.current_file.dirty = false;
|
||||
return this.quit();
|
||||
});
|
||||
} else {
|
||||
return this.differ.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
DiffEditor.dependencies = ["os://scripts/ace/ace.js", "pkg://AceDiff/main.js", "pkg://AceDiff/main.css"];
|
||||
|
||||
this.OS.register("DiffEditor", DiffEditor);
|
||||
|
||||
}).call(this);
|
16
DiffEditor/build/debug/package.json
Normal file
16
DiffEditor/build/debug/package.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"pkgname": "DiffEditor",
|
||||
"app":"DiffEditor",
|
||||
"name":"Diff Editor",
|
||||
"description":"Diff Editor",
|
||||
"info":{
|
||||
"author": "",
|
||||
"edsdmail": ""
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"dependencies":["AceDiff@3.0.3-r"],
|
||||
"locale": {}
|
||||
}
|
19
DiffEditor/build/debug/scheme.html
Normal file
19
DiffEditor/build/debug/scheme.html
Normal file
@ -0,0 +1,19 @@
|
||||
<afx-app-window apptitle="Diff Editor" width="650" height="400" data-id="DiffEditor">
|
||||
<afx-vbox>
|
||||
<afx-hbox >
|
||||
<afx-file-view data-id="fileview" min-width="150" data-width="150" view="tree" status="false"></afx-file-view>
|
||||
<afx-resizer data-width="3"></afx-resizer>
|
||||
<afx-vbox>
|
||||
<afx-hbox data-height="20">
|
||||
<afx-label data-id="left-file" class="file-label"></afx-label>
|
||||
<afx-label data-id="right-file" class="file-label"></afx-label>
|
||||
</afx-hbox>
|
||||
<div data-id="diffeditor" style="position: relative;" ></div>
|
||||
</afx-vbox>
|
||||
</afx-hbox>
|
||||
<afx-hbox data-height="25" data-id="status-bar">
|
||||
<div class="status-text"></div>
|
||||
<afx-list-view data-id="langmode" dropdown="true" data-width="150"></afx-list-view>
|
||||
</afx-hbox>
|
||||
</afx-vbox>
|
||||
</afx-app-window>
|
BIN
DiffEditor/build/release/DiffEditor.zip
Normal file
BIN
DiffEditor/build/release/DiffEditor.zip
Normal file
Binary file not shown.
204
DiffEditor/coffees/main.coffee
Normal file
204
DiffEditor/coffees/main.coffee
Normal file
@ -0,0 +1,204 @@
|
||||
class DiffEditor extends @OS.application.BaseApplication
|
||||
constructor: ( args ) ->
|
||||
super "DiffEditor", args
|
||||
|
||||
main: () ->
|
||||
@editor_cnt = @find "diffeditor"
|
||||
@fileview = @find "fileview"
|
||||
|
||||
@fileview.fetch = (path) =>
|
||||
return new Promise (resolve, reject) =>
|
||||
path.asFileHandle().read()
|
||||
.then (d) =>
|
||||
return reject(d.error) if d.error
|
||||
return resolve(d.result)
|
||||
.catch (e) =>
|
||||
return reject(__e(e))
|
||||
@fileview.onfileopen = (e) =>
|
||||
return unless e.data and e.data.path
|
||||
return if e.data.type is "dir"
|
||||
return @openFile e.data.path.asFileHandle()
|
||||
|
||||
@currdir = undefined
|
||||
ace.config.set('basePath', "scripts/ace")
|
||||
ace.require("ace/ext/language_tools")
|
||||
@modelist = ace.require("ace/ext/modelist")
|
||||
list = []
|
||||
for v in @modelist.modes
|
||||
list.push {
|
||||
text: v.caption,
|
||||
mode: v.mode
|
||||
}
|
||||
@langlist = @find("langmode")
|
||||
@langlist.data = list
|
||||
@langlist.onlistselect = (e) =>
|
||||
@editors.left.getSession().setMode e.data.item.data.mode
|
||||
@editors.right.getSession().setMode e.data.item.data.mode
|
||||
|
||||
@differ = new AceDiff({
|
||||
# ace: window.ace,
|
||||
element: @editor_cnt,
|
||||
theme: "ace/theme/monokai",
|
||||
left: {
|
||||
content: '',
|
||||
},
|
||||
right: {
|
||||
content: '',
|
||||
}
|
||||
})
|
||||
@editors = @differ.getEditors()
|
||||
opts = {
|
||||
enableBasicAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
enableLiveAutocompletion: true,
|
||||
highlightActiveLine: true,
|
||||
highlightSelectedWord: true,
|
||||
behavioursEnabled: true,
|
||||
#wrap: true,
|
||||
fontSize: "10pt",
|
||||
showInvisibles: true,
|
||||
}
|
||||
|
||||
@editors.left.setOptions(opts)
|
||||
@editors.right.setOptions(opts)
|
||||
@editors.left.current_file = undefined
|
||||
@editors.right.current_file = undefined
|
||||
@editors.left.afx_label = @find("left-file")
|
||||
@editors.right.afx_label = @find("right-file")
|
||||
@editors.left.mux = false
|
||||
@editors.right.mux = false
|
||||
|
||||
@on "resize", () =>
|
||||
@editors = @differ.getEditors()
|
||||
@editors.left.resize()
|
||||
@editors.right.resize()
|
||||
|
||||
$('.acediff__left .ace_scrollbar-v',@editor_cnt).scroll(() =>
|
||||
@editors.right.session.setScrollTop(@editors.left.session.getScrollTop()))
|
||||
$('.acediff__right .ace_scrollbar-v', @editor_cnt).scroll(() =>
|
||||
@editors.left.session.setScrollTop(@editors.right.session.getScrollTop()))
|
||||
|
||||
@editors.left.on "focus", (e) =>
|
||||
@current_editor = @editors.left
|
||||
@editors.right.on "focus", (e) =>
|
||||
@current_editor = @editors.right
|
||||
|
||||
@editors.left.on "input", (e) =>
|
||||
return @editors.left.mux = false if @editors.left.mux
|
||||
return @editors.left.afx_label.text = __("Temporary file") unless @editors.left.current_file
|
||||
return if @editors.left.current_file.dirty
|
||||
@editors.left.current_file.dirty = true
|
||||
@editors.left.afx_label.text += "*"
|
||||
|
||||
@editors.right.on "input", (e) =>
|
||||
return @editors.right.mux = false if @editors.right.mux
|
||||
return @editors.right.afx_label.text = __("Temporary file") unless @editors.right.current_file
|
||||
return if @editors.right.current_file.dirty
|
||||
@editors.right.current_file.dirty = true
|
||||
@editors.right.afx_label.text += "*"
|
||||
|
||||
@current_editor = @editors.left
|
||||
@current_editor.focus()
|
||||
|
||||
@bindKey "ALT-O", () => @menuAction("open")
|
||||
@bindKey "ALT-F", () => @menuAction("opendir")
|
||||
@bindKey "CTRL-S", () => @menuAction("save")
|
||||
@toggleSideBar()
|
||||
|
||||
toggleSideBar: () ->
|
||||
if @currdir
|
||||
$(@fileview).show()
|
||||
@fileview.path = @currdir.path
|
||||
else
|
||||
$(@fileview).hide()
|
||||
|
||||
@trigger("resize")
|
||||
|
||||
menu: () ->
|
||||
return [
|
||||
{
|
||||
text: __("File"),
|
||||
nodes: [
|
||||
{ text: __("Open"), dataid: "open", shortcut: "A-O" },
|
||||
{
|
||||
text: __("Open Folder"),
|
||||
dataid: "opendir",
|
||||
shortcut: "A-F",
|
||||
},
|
||||
{ text: __("Save"), dataid: "save", shortcut: "C-S" }
|
||||
],
|
||||
onchildselect: (e) =>
|
||||
@menuAction(e.data.item.data.dataid)
|
||||
}
|
||||
]
|
||||
|
||||
openFile: (file) ->
|
||||
@current_editor.mux = true
|
||||
file.read()
|
||||
.then (d) =>
|
||||
file.cache = d
|
||||
@current_editor.current_file = file
|
||||
@current_editor.afx_label.text = file.path
|
||||
@current_editor.setValue d, -1
|
||||
# select current mode
|
||||
m = @modelist.getModeForPath(file.path)
|
||||
item = i for v,i in @langlist.data when v.mode is m.mode
|
||||
return unless item isnt undefined
|
||||
@langlist.selected = item
|
||||
|
||||
menuAction:(dataid) ->
|
||||
switch dataid
|
||||
when "open"
|
||||
@openDialog "FileDialog", {
|
||||
title: __("Open file"),
|
||||
mimes: ["text/.*", "application/json", "application/javascript"],
|
||||
}
|
||||
.then (f) =>
|
||||
@openFile(f.file.path.asFileHandle())
|
||||
|
||||
when "opendir"
|
||||
@openDialog("FileDialog", {
|
||||
title: __("Open folder"),
|
||||
mimes: ["dir"],
|
||||
})
|
||||
.then (f) =>
|
||||
@currdir = f.file.path.asFileHandle()
|
||||
@toggleSideBar()
|
||||
|
||||
when "save"
|
||||
fn = (ed) =>
|
||||
return unless ed.current_file and ed.current_file.dirty
|
||||
ed.current_file.cache = ed.getValue()
|
||||
ed.current_file.write("text/plain")
|
||||
.then (r) =>
|
||||
ed.current_file.dirty = false
|
||||
ed.afx_label.text = ed.current_file.path
|
||||
@notify __("File {0} saved", ed.current_file.path)
|
||||
.catch (e) =>
|
||||
@error __("Unable to save to: {0}", ed.current_file.path), e
|
||||
fn @editors.left
|
||||
fn @editors.right
|
||||
else
|
||||
return console.log(dataid)
|
||||
|
||||
cleanup: (evt) ->
|
||||
dirty = false
|
||||
dirty = true if @editors.left.current_file and @editors.left.current_file.dirty
|
||||
dirty = true if @editors.right.current_file and @editors.right.current_file.dirty
|
||||
if dirty
|
||||
evt.preventDefault()
|
||||
@ask { title: __("Unsaved changes"), text: __("Ignore modification ?")}
|
||||
.then (d) =>
|
||||
return unless d
|
||||
@editors.left.current_file.dirty = false
|
||||
@editors.right.current_file.dirty = false
|
||||
@quit()
|
||||
else
|
||||
@differ.destroy()
|
||||
|
||||
DiffEditor.dependencies = [
|
||||
"os://scripts/ace/ace.js",
|
||||
"pkg://AceDiff/main.js",
|
||||
"pkg://AceDiff/main.css"
|
||||
]
|
||||
@OS.register "DiffEditor", DiffEditor
|
12
DiffEditor/css/main.css
Normal file
12
DiffEditor/css/main.css
Normal file
@ -0,0 +1,12 @@
|
||||
afx-app-window[data-id="DiffEditor"] afx-hbox[data-id="status-bar"] {
|
||||
background-color: #007ACC;
|
||||
}
|
||||
afx-app-window[data-id="DiffEditor"] .status-text {
|
||||
color: white;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
afx-app-window[data-id="DiffEditor"] afx-label.file-label {
|
||||
background-color: #333333;
|
||||
color: white;
|
||||
}
|
16
DiffEditor/package.json
Normal file
16
DiffEditor/package.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"pkgname": "DiffEditor",
|
||||
"app":"DiffEditor",
|
||||
"name":"Diff Editor",
|
||||
"description":"Diff Editor",
|
||||
"info":{
|
||||
"author": "",
|
||||
"edsdmail": ""
|
||||
},
|
||||
"version":"0.0.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
"dependencies":["AceDiff@3.0.3-r"],
|
||||
"locale": {}
|
||||
}
|
7
DiffEditor/project.json
Normal file
7
DiffEditor/project.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "DiffEditor",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
"copies": ["assets/scheme.html", "package.json", "README.md"]
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Docify",
|
||||
"root": "home://workspace/antosdk-apps/Docify",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/dialogs.coffee", "coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "GraphEditor",
|
||||
"root": "home://workspace/antosdk-apps/GraphEditor",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": ["javascripts/svg-pan-zoom.js", "javascripts/mermaid.min.js"],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "JarvisControl",
|
||||
"root": "home://workspace/antosdk-apps/JarvisControl",
|
||||
"css": ["css/epoch.css"],
|
||||
"javascripts": ["javascripts/d3.v3.js", "javascripts/epoch.js"],
|
||||
"coffees": ["coffees/JarvisService.coffee", "coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Katex",
|
||||
"root": "home://workspace/antosdk-apps/Katex",
|
||||
"css": ["katex.css"],
|
||||
"javascripts": ["katex.js", "auto-render.js"],
|
||||
"coffees": [],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "LuaPlayground",
|
||||
"root": "home://workspace/antosdk-apps/LuaPlayground",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": ["javascripts/paper-core.min.js"],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "MarkOn",
|
||||
"root": "home://workspace/antosdk-apps/MarkOn",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "OpenPage",
|
||||
"root": "home://workspace/antosdk-apps/OpenPage",
|
||||
"css": ["css/main.css", "css/dialog.css"],
|
||||
"javascripts": ["javascripts/webodf.js", "javascripts/EditorSession.js"],
|
||||
"coffees": ["coffees/main.coffee", "coffees/dialogs.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "Preview",
|
||||
"root": "home://workspace/antosdk-apps/Preview",
|
||||
"css": ["main.css"],
|
||||
"javascripts": ["pdf.js"],
|
||||
"coffees": ["main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "RemoteDesktop",
|
||||
"root": "home://workspace/antosdk-apps/RemoteDesktop",
|
||||
"css": ["assets/main.css"],
|
||||
"javascripts": ["javascripts/wvnc.js"],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "ShowCase",
|
||||
"root": "home://workspace/antosdk-apps/ShowCase",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "SimpleMDE",
|
||||
"root": "home://workspace/antosdk-apps/SimpleMDE",
|
||||
"css": ["simplemde.min.css"],
|
||||
"javascripts": ["simplemde.min.js"],
|
||||
"coffees": [],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "TinyEditor",
|
||||
"root": "home://workspace/antosdk-apps/TinyEditor",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["coffees/main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "VizApp",
|
||||
"root": "home://workspace/antosdk-apps/VizApp",
|
||||
"css": ["css/main.css"],
|
||||
"javascripts": [
|
||||
"javascripts/svg-pan-zoom.js",
|
||||
|
@ -9,6 +9,16 @@
|
||||
"dependencies": [],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/About/build/release/About.zip"
|
||||
},
|
||||
{
|
||||
"pkgname": "AceDiff",
|
||||
"name": "AceDiff addon library",
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/AceDiff/README.md",
|
||||
"category": "Library",
|
||||
"author": "",
|
||||
"version": "3.0.3-r",
|
||||
"dependencies": [],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/AceDiff/build/release/AceDiff.zip"
|
||||
},
|
||||
{
|
||||
"pkgname": "ActivityMonitor",
|
||||
"name": "Activity monitor",
|
||||
@ -25,7 +35,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/README.md",
|
||||
"category": "Library",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.1.4-a",
|
||||
"version": "0.1.5-a",
|
||||
"dependencies": [],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip"
|
||||
},
|
||||
@ -79,6 +89,16 @@
|
||||
"dependencies": [],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DBDecoder/build/release/DBDecoder.zip"
|
||||
},
|
||||
{
|
||||
"pkgname": "DiffEditor",
|
||||
"name": "Diff Editor",
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DiffEditor/README.md",
|
||||
"category": "Other",
|
||||
"author": "",
|
||||
"version": "0.0.1-a",
|
||||
"dependencies": ["AceDiff@3.0.3-r"],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/DiffEditor/build/release/DiffEditor.zip"
|
||||
},
|
||||
{
|
||||
"pkgname": "Docify",
|
||||
"name": "Docify",
|
||||
@ -216,7 +236,7 @@
|
||||
"category": "System",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.1.7-a",
|
||||
"dependencies": ["Antunnel@0.1.4-a","xTerm@4.8.1-r"],
|
||||
"dependencies": ["Antunnel@0.1.5-a","xTerm@4.8.1-r"],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip"
|
||||
},
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
"dependencies": [
|
||||
"Antunnel@0.1.4-a",
|
||||
"Antunnel@0.1.5-a",
|
||||
"xTerm@4.8.1-r"
|
||||
],
|
||||
"locales":{
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
"dependencies": [
|
||||
"Antunnel@0.1.4-a",
|
||||
"Antunnel@0.1.5-a",
|
||||
"xTerm@4.8.1-r"
|
||||
],
|
||||
"locales":{
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "vTerm",
|
||||
"root": "home://workspace/antosdk-apps/vTerm",
|
||||
"css": [ "main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "wTerm",
|
||||
"root": "home://workspace/antosdk-apps/wTerm",
|
||||
"css": ["main.css"],
|
||||
"javascripts": [],
|
||||
"coffees": ["main.coffee"],
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "xTerm",
|
||||
"root": "home://workspace/antosdk-apps/xTerm",
|
||||
"css": ["xterm.css"],
|
||||
"javascripts": ["xterm-addon-fit.js", "xterm.js"],
|
||||
"coffees": [],
|
||||
|
Loading…
Reference in New Issue
Block a user