Merge pull request #36 from lxsang/next-1.2.0

Next 1.2.0
This commit is contained in:
Xuan Sang LE 2021-06-13 12:12:07 +02:00 committed by GitHub
commit 6d078ce5e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
514 changed files with 75322 additions and 8398 deletions

View File

@ -8,19 +8,13 @@ platform:
clone:
disable: true
steps:
- name: clone
- name: download
commands:
- pwd
- git clone git@iohub.dev:lxsang/antos.git
- cd ./antos && git checkout master
- cd /opt/www/htdocs/os && wget https://github.com/lxsang/antos/raw/next-1.2.0/release/antos-1.2.0.tar.gz
- name: build
commands:
- cd ./antos
- npm link typescript jest @types/jest ts-jest typedoc
- npm link @types/jquery
#- make test
- BUILDDIR=//opt/www/htdocs/os make release
# - DOCDIR=/opt/cloud/cuser/os/doc make doc
- cd /opt/www/htdocs/os && tar xvzf antos-1.2.0.tar.gz
- rm /opt/www/htdocs/os/antos-1.2.0.tar.gz
trigger:
branch:
- master
- next-1.2.0

View File

@ -5,7 +5,7 @@ DOCDIR?=/opt/www/htdocs/doc/antos
BLUE=\033[1;34m
NC=\033[0m
VERSION=1.1.2
VERSION=1.2.0
GSED=sed
UNAME_S := $(shell uname -s)
@ -54,7 +54,7 @@ javascripts= dist/core/core.js \
antfx = $(tags) \
dist/core/Announcerment.js
packages = Syslog CodePad Files MarketPlace Setting
packages = Syslog Files MarketPlace Setting NotePad
main: initd build_javascripts build_themes libs build_packages languages
- cp src/index.html $(BUILDDIR)/
@ -69,6 +69,11 @@ lite: build_javascripts build_themes build_packages
ts:
-rm -rf dist
tsc -p tsconfig.json
cat `find dist/core/ -name "*.d.ts"` > d.ts/antos.d.ts
rm `find dist/ -name "*.d.ts"`
cat d.ts/core.d.ts d.ts/jquery.d.ts d.ts/antos.d.ts > /tmp/corelib.d.ts
#-rm src/packages/CodePad/libs/corelib.d.ts.zip
#zip -j src/packages/CodePad/libs/corelib.d.ts.zip /tmp/corelib.d.ts
standalone_tags: ts
@echo "$(BLUE)Bundling standalone tags files$(NC)"
@ -198,6 +203,7 @@ ar:
BUILDDIR=/tmp/antos-$(VERSION) make release
cd /tmp/antos-$(VERSION) && tar cvzf ../antos-$(VERSION).tar.gz .
mv /tmp/antos-$(VERSION).tar.gz release/
echo -n $(VERSION) > release/latest
release: main uglify

View File

@ -1,7 +1,4 @@
# AntOS v1.0.0-alpha
**This version 1.0.0a removes the dependencies on Riot.js by reimplementing the major API for GUI and Announcement system. The entire core API is also rewritten in TypeScript**
# antOS v1.2.0
[![Build Status](https://travis-ci.org/lxsang/antos.svg?branch=master)](https://travis-ci.org/lxsang/antos)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flxsang%2Fantos.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flxsang%2Fantos?ref=badge_shield)
@ -14,55 +11,53 @@ development and deployment of user specific applications.
Github: [https://github.com/lxsang/antos](https://github.com/lxsang/antos)
## Change logs
* Improvement GUI API
- [x] File dialog should remember last opened folder
- [x] Add dynamic key-value dialog that work on any object
- [x] Window list panel should show window title in tooltip when mouse hovering on application icon
- [x] Allow pinning application to system panel
- [x] Improvement application list in market place
- [x] Allow triplet keyboard shortcut in GUI
- [x] CodePad allows setting shortcut in CommandPalette commands
- [ ] Improvement multi-window application support
- [x] CodePad should have recent menu entry that remember top n file opened
- [x] Improve File application grid view
- [x] Label text should be selectable
- [x] switch window using shortcut
- [x] Loading bar animation on system pannel
- [x] Multiple file upload support
- [x] Generic key-value dialog
- [x] Add bootstrap font support for icons
- [x] Class applications by categories in start menu
- [x] Support vertical and horizontal resize window
* Market place now classifies application by categories
* CodePad is no longer default system application, it has been moved to MarketPlace
* More applications added to MarketPlace
* Antos SDK
- SDK is no longer included in base Antos release, it can be installed via MarketPlace
- The SDK now has a generic API that can be used in different development tasks other than AntOS application
- Heavy SDK tasks are now offloaded to workers
- Introduce new JSON based syntax for SDK task/target definition
* From this version, docker image of All-in-one AntOS system is available at: [https://hub.docker.com/r/xsangle/antosaio](https://hub.docker.com/r/xsangle/antosaio)
## Demo
A demo of the VDE is available at [https://app.iohub.dev/antos/](https://app.iohub.dev/antos/) using username: demo and password: demo.
The demo use the **antosaio** docker image available at:
- [https://hub.docker.com/r/xsangle/antosaio](https://hub.docker.com/r/xsangle/antosaio)
- Instruction: [https://github.com/lxsang/antosaio](https://github.com/lxsang/antosaio)
If one want to run AntOS VDE locally in their system, a docker image is available at:
[https://github.com/lxsang/antosaio](https://github.com/lxsang/antosaio)
## AntOS applications
## AntOS applications (Available on the MarketPlace)
[https://github.com/lxsang/antosdk-apps](https://github.com/lxsang/antosdk-apps)
## Documentation
- API Documentation: [https://doc.iohub.dev/antos/api/](https://doc.iohub.dev/antos/api/)
- Documentation : [https://doc.iohub.dev/antos](https://doc.iohub.dev/antos)
-----
## Change logs
It has been a long time since version 0.x.x and now AntOS hits a major changes in its API. From version 1.0.0, AntOS no longer depends on **Riot.js** in its core UI API. This version introduces a brand new AntOS UI API called **AFX** API which is rewritten from bottom up. The entire AntOS core API is rewritten in Typescript (from Coffeescript) for better debugging, code maintenance and documenting.
**Browser support**: tested on Chrome, Firefox and partly Safari. Any browser that supports custom elements API should work. May have problem with Microsoft Edge
* Say goodbye to Riot.js and welcome **Afx**, the brand new AntOS UI API
* Rewrite the entire core system in **Typescript** for better maintenance
* Core API now has Unit test using **jest**
* Introduce **AntOS dark** and **AntOS light** theme
* Default core applications are: **Files**, **CodePad**, **Setting**, **Syslog**, and **MarketPlace**
* More application can be install via **MarketPlace**
* **AntOSDK** is now integrated into **CodePad**
* Other applications are now developed with **CodePad** using **AntOSDK** and are hosted in a [separated repository](https://github.com/lxsang/antosdk-apps)
* System errors are reported in **Syslog**
## Credits
The core of AntOS is based on some open source libraries:
* Mandatory
* JQuery: [https://jquery.com/](https://jquery.com)
* Optional
* ACE editor library : [https://ace.c9.io/](https://ace.c9.io/)
* Font Awesome for default icon: [https://fontawesome.com](https://fontawesome.com)
* Showdown JS for markdown rendering: [https://github.com/showdownjs/showdown](https://github.com/showdownjs/showdown)
* Simple MDE for default Markdown editor: [https://simplemde.com/](https://simplemde.com/)
* JSZIP for in browser Zip file handle : [https://stuk.github.io/jszip/](https://stuk.github.io/jszip/)
* Other opensource libraries used by different application (see in each application README)..
- Documentation: [https://doc.iohub.dev/antos](https://doc.iohub.dev/antos)
- API: (https://doc.iohub.dev/antos/api/)[https://doc.iohub.dev/antos/api/]
## Licence
Copyright 2017-2021 Xuan Sang LE <xsang.le AT gmail DOT com>
Copyright 2017-2021 Xuan Sang LE <mrsang AT iohub DOT dev>
AnTOS is is licensed under the GNU General Public License v3.0, see the LICENCE file for more information

10079
d.ts/antos.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

27299
d.ts/core.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

33477
d.ts/jquery.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
release/antos-1.2.0.tar.gz Normal file

Binary file not shown.

1
release/latest Normal file
View File

@ -0,0 +1 @@
1.2.0

View File

@ -82,12 +82,7 @@ namespace OS {
setting.applications[this.name] = {};
}
this.setting = setting.applications[this.name];
this.keycomb = {
ALT: {},
CTRL: {},
SHIFT: {},
META: {},
};
this.keycomb = {};
this.subscribe("appregistry", (m) => {
if (m.name === this.name) {
this.applySetting(m.data.m);
@ -139,7 +134,7 @@ namespace OS {
return this.trigger("exit", undefined);
}
});
this.on("apptitlechange", () => this.sysdock.update(undefined));
this.on("apptitlechange", () => this.sysdock.update(this));
this.updateLocale(this.systemsetting.system.locale);
return this.loadScheme();
}
@ -199,14 +194,29 @@ namespace OS {
k: string,
f: (e: JQuery.KeyboardEventBase) => void
): void {
const arr = k.split("-");
if (arr.length !== 2) {
const arr = k.toUpperCase().split("-");
const c = arr.pop();
let fnk = "";
if (arr.includes("META")) {
fnk += "META";
}
if (arr.includes("CTRL")) {
fnk += "CTRL";
}
if (arr.includes("ALT")) {
fnk += "ALT";
}
if (arr.includes("SHIFT")) {
fnk += "SHIFT";
}
if ( fnk == "") {
return;
}
const fnk = arr[0].toUpperCase();
const c = arr[1].toUpperCase();
fnk = `fn_${fnk.hash()}`;
if (!this.keycomb[fnk]) {
return;
this.keycomb[fnk] = {};
}
this.keycomb[fnk][c] = f;
}
@ -242,7 +252,7 @@ namespace OS {
*
* @param {string} fnk meta or modifier key e.g. `CTRL`, `ALT`, `SHIFT` or `META`
* @param {string} c a regular key
* @param {JQuery.KeyboardEventBase} e JQuery keyboard event
* @param {JQuery.KeyDownEvent} e JQuery keyboard event
* @returns {boolean} return whether the shortcut is executed
* @memberof BaseApplication
*/

View File

@ -63,6 +63,7 @@ namespace OS {
*/
quit(): void {
const evt = new BaseEvent("exit", false);
this.onexit(evt);
if (!evt.prevent) {
delete this._observable;
if (this.scheme) {
@ -71,7 +72,6 @@ namespace OS {
if (this.dialog) {
return this.dialog.quit();
}
this.onexit(evt);
}
}
@ -173,11 +173,11 @@ namespace OS {
* Function called when dialog exits
*
* @protected
* @param {BaseEvent} e
* @param {BaseEvent} _e
* @returns {void}
* @memberof BaseDialog
*/
protected onexit(e: BaseEvent): void {
protected onexit(_e: BaseEvent): void {
if (this.parent) {
return (this.parent.dialog = undefined);
}
@ -199,11 +199,11 @@ namespace OS {
* be either the string definition of the scheme or
* the VFS file handle of the scheme file
*
* @private
* @protected
* @type {(string | OS.API.VFS.BaseFileHandle)}
* @memberof BasicDialog
*/
private markup: string | OS.API.VFS.BaseFileHandle;
protected markup: string | OS.API.VFS.BaseFileHandle;
/**
* If the `markup` variable is not provided, then
@ -238,6 +238,7 @@ namespace OS {
* @memberof BasicDialog
*/
init(): void {
//this._onenter = undefined;
if (this.markup) {
if (typeof this.markup === "string") {
return GUI.htmlToScheme(this.markup, this, this.host);
@ -263,11 +264,27 @@ namespace OS {
*/
main(): void {
const win = this.scheme as tag.WindowTag;
$(win).attr("tabindex", 0);
$(win).on('keydown', (e) => {
switch (e.which) {
case 27:
return this.quit();
case 13:
const btn = $("afx-button", win).filter(function () {
const did = $(this).attr('data-id').toLowerCase();
return did === "btnok" || did === "btnyes";
});
return $("button", btn).trigger("click");
default:
return;
}
});
if (this.data && this.data.title) {
win.apptitle = this.data.title;
}
win.resizable = false;
win.minimizable = false;
$(win).trigger("focus");
}
}
@ -322,12 +339,11 @@ namespace OS {
$input.val(this.data.value);
}
if (this.data && this.data.type)
{
if (this.data && this.data.type) {
($input[0] as HTMLInputElement).type = this.data.type
}
(this.find("btnOk") as tag.ButtonTag).onbtclick = (e) => {
(this.find("btnOk") as tag.ButtonTag).onbtclick = (_e) => {
if (this.handle) {
this.handle($input.val());
}
@ -335,12 +351,12 @@ namespace OS {
};
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
) => {
return this.quit();
};
$input.keyup((e) => {
$input.on("keyup", (e) => {
if (e.which !== 13) {
return;
}
@ -350,7 +366,7 @@ namespace OS {
return this.quit();
});
$input.focus();
$input.trigger("focus");
}
}
/**
@ -360,19 +376,19 @@ namespace OS {
<afx-app-window width='200' height='150' apptitle = "Prompt">
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-label data-id = "lbl" />
<input type = "text" data-id= "txtInput" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-label data-id = "lbl" ></afx-label>
<input type = "text" data-id= "txtInput" ></input>
<div data-height="10" ></div>
<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" />
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -409,11 +425,10 @@ namespace OS {
if (this.data && this.data.value) {
$input.val(this.data.value);
}
if(this.data && this.data.disable)
{
if (this.data && this.data.disable) {
$input.prop('disabled', true);
}
(this.find("btnOk") as tag.ButtonTag).onbtclick = (e) => {
(this.find("btn-Ok") as tag.ButtonTag).onbtclick = (_e) => {
const value = $input.val();
if (!value || value === "") {
return;
@ -425,7 +440,7 @@ namespace OS {
};
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -440,18 +455,18 @@ namespace OS {
<afx-app-window data-id = "TextDialog" width='400' height='300'>
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<textarea data-id= "txtInput" />
<div data-height="10" />
<div data-height="10" ></div>
<textarea data-id= "txtInput" ></textarea>
<div data-height="10" ></div>
<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" />
<div ></div>
<afx-button data-id = "btn-Ok" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -493,7 +508,7 @@ namespace OS {
main(): void {
super.main();
(this.find("btnOk") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
const date = (this.find("cal") as tag.CalendarTag)
.selectedDate;
@ -507,7 +522,7 @@ namespace OS {
};
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -520,19 +535,19 @@ namespace OS {
<afx-app-window width='300' height='230' apptitle = "Calendar" >
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-calendar-view data-id = "cal" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-calendar-view data-id = "cal" ></afx-calendar-view>
<div data-height="10" ></div>
<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" />
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
<div data-height="10" />
<div data-height="10" ></div>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -571,7 +586,7 @@ namespace OS {
main(): void {
super.main();
(this.find("btnOk") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
const color = (this.find(
"cpicker"
@ -586,7 +601,7 @@ namespace OS {
};
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -599,19 +614,19 @@ namespace OS {
<afx-app-window width='320' height='250' apptitle = "Color picker" >
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-color-picker data-id = "cpicker" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-color-picker data-id = "cpicker" ></afx-color-picker>
<div data-height="10" ></div>
<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" />
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
<div data-height="10" />
<div data-height="10" ></div>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -666,7 +681,7 @@ namespace OS {
];
grid.rows = rows;
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -679,18 +694,18 @@ namespace OS {
<afx-app-window width='250' height='300' apptitle = "Info" >
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-grid-view data-id = "grid" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-grid-view data-id = "grid" ></afx-grid-view>
<div data-height="10" ></div>
<afx-hbox data-height="30">
<div />
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" />
<div ></div>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
<div data-height="10" />
<div data-height="10" ></div>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -736,7 +751,7 @@ namespace OS {
(this.find("lbl") as tag.LabelTag).set(this.data);
}
(this.find("btnYes") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
if (this.handle) {
this.handle(true);
@ -744,7 +759,7 @@ namespace OS {
return this.quit();
};
(this.find("btnNo") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
if (this.handle) {
this.handle(false);
@ -760,18 +775,18 @@ namespace OS {
<afx-app-window width='200' height='150' apptitle = "Prompt">
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-label data-id = "lbl" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-label data-id = "lbl" ></afx-label>
<div data-height="10" ></div>
<afx-hbox data-height="30">
<div />
<afx-button data-id = "btnYes" text = "__(Yes)" data-width = "40" />
<afx-button data-id = "btnNo" text = "__(No)" data-width = "40" />
<div ></div>
<afx-button data-id = "btnYes" text = "__(Yes)" data-width = "40" ></afx-button>
<afx-button data-id = "btnNo" text = "__(No)" data-width = "40" ></afx-button>
</afx-hbox>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -819,7 +834,7 @@ namespace OS {
if (this.data && this.data.data) {
listview.data = this.data.data;
}
const fn = (e: TagEventType<GUI.tag.ListItemEventData>) => {
const fn = (_e: TagEventType<GUI.tag.ListItemEventData>) => {
const data = listview.selectedItem;
if (!data) {
return this.notify(__("Please select an item"));
@ -833,7 +848,7 @@ namespace OS {
(this.find("btnOk") as tag.ButtonTag).onbtclick = fn;
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -846,18 +861,18 @@ namespace OS {
<afx-app-window width='250' height='300' apptitle = "Selection">
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<div data-width = "10" ></div>
<afx-vbox>
<div data-height="10" />
<afx-list-view data-id = "list" />
<div data-height="10" />
<div data-height="10" ></div>
<afx-list-view data-id = "list" ></afx-list-view>
<div data-height="10" ></div>
<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" />
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
</afx-vbox>
<div data-width = "10" />
<div data-width = "10" ></div>
</afx-hbox>
</afx-vbox>
</afx-app-window>\
@ -916,7 +931,7 @@ namespace OS {
grid.header = [{ text: "", width: 100 }, { text: "" }];
grid.rows = rows;
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (
e
_e
): void => {
return this.quit();
};
@ -940,10 +955,10 @@ namespace OS {
</afx-hbox>
<afx-hbox data-height="30">
<div />
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "60" />
<div ></div>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "60" ></afx-button>
</afx-hbox>
<div data-height = "10"/>
<div data-height = "10"></div>
</afx-vbox>
</afx-app-window>\
`;
@ -987,12 +1002,21 @@ namespace OS {
super("FileDialog");
}
/**
* Store the last opened directory
*
* @static
* @type {string}
* @memberof FileDialog
*/
static last_opened: string;
/**
*
*
* @returns {void}
* @memberof FileDialog
*/
main(): void {
super.main();
const fileview = this.find("fileview") as tag.FileViewTag;
@ -1003,13 +1027,20 @@ namespace OS {
if (!path) {
return resolve(undefined);
}
return path
.asFileHandle()
let dir = path.asFileHandle();
return dir
.read()
.then(function (d) {
if (d.error) {
return reject(d);
}
FileDialog.last_opened = path;
if (!dir.isRoot()) {
const p = dir.parent();
p.filename = "[..]";
p.type = "dir";
d.result.unshift(p);
}
return resolve(d.result);
})
.catch((e: Error): void => reject(__e(e)));
@ -1033,10 +1064,19 @@ namespace OS {
};
location.data = this.systemsetting.VFS.mountpoints.filter(
(i) => i.type !== "app"
).map(
(i) => {
if (FileDialog.last_opened)
i.selected = false;
return i;
}
);
if (location.selectedItem === undefined) {
if (location.selectedItem === undefined && !FileDialog.last_opened) {
location.selected = 0;
}
else if (FileDialog.last_opened) {
setroot(FileDialog.last_opened);
}
} else {
$(location).hide();
this.trigger("resize");
@ -1047,7 +1087,7 @@ namespace OS {
return $(filename).val(e.data.filename);
}
};
(this.find("bt-ok") as tag.ButtonTag).onbtclick = (e) => {
(this.find("btnOk") as tag.ButtonTag).onbtclick = (_e) => {
const f = fileview.selectedFile;
if (!f) {
return this.notify(
@ -1096,7 +1136,7 @@ namespace OS {
};
(this.find("bt-cancel") as tag.ButtonTag).onbtclick = (
e
_e
) => {
return this.quit();
};
@ -1112,6 +1152,8 @@ namespace OS {
}
}
}
FileDialog.last_opened = undefined;
/**
* Scheme definition
*/
@ -1121,10 +1163,10 @@ namespace OS {
<afx-list-view data-id = "location" dropdown = "false" data-width = "120"></afx-list-view>
<afx-vbox>
<afx-file-view data-id = "fileview" view="tree" status = "false"></afx-file-view>
<input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" />
<input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" ></input>
<afx-hbox data-height = '30'>
<div style=' text-align:right;'>
<afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button>
<afx-button data-id = "btnOk" text = "__(Ok)"></afx-button>
<afx-button data-id = "bt-cancel" text = "__(Cancel)"></afx-button>
</div>
<div data-width="5"></div>
@ -1133,6 +1175,298 @@ namespace OS {
</afx-hbox>
</afx-app-window>\
`;
/**
* Generic & dynamic key-value dialog. The content
* of the dialog consist of an array of label and input elements
* which are generated based on the input model
*
* The input data of the dialog should be:
*
* ```typescript
* {
* title: string, // window title
* model: {
* [propName:string]: string
* },
* data: {
* [propName:string]: string
* },
* allow_empty: boolean
* }
* ```
* Where:
* - keys of `model` are data fields, each key correspond to an input element
* - values of `model` are description texts of fields, each value correspond to a label text
* - data is the input data object in the format of model (optional)
*
* ```
* Example:
* {
* title: "Greeting",
* model: {
* name: "Your name",
* email: "Your email"
* },
* allow_empty: false
* }
*```
* The data passing from the dialog to the callback function is
* the user input data corresponding to the input model
*
* Example of callback data for the above model:
*
* ```
* {
* name: "John Doe",
* email: "jd@mail.com"
* }
* ```
*
* @export
* @class MultiInputDialog
* @extends {BasicDialog}
*/
export class MultiInputDialog extends BasicDialog {
/**
* References to all the input fields in the
* dialog
*
* @private
* @type {HTMLElement[]}
* @memberof MultiInputDialog
*/
private inputs: JQuery<HTMLElement>;
/**
*Creates an instance of MultiInputDialog.
* @memberof MultiInputDialog
*/
constructor() {
super("MultiInputDialog");
}
/**
* Generate the scheme before rendering
*
* @memberof MultiInputDialog
*/
init(): void {
let height = 60;
let html = "";
if (this.data && this.data.model) {
const model = this.data.model;
for (const key in model) {
html += `\
<afx-label data-height="25" text="{0}" ></afx-label>
<input data-height="25" type="text" name="{1}" ></input>
<div data-height="10" ></div>
`.format(model[key], key);
height += 60;
}
}
this.markup = MultiInputDialog.scheme.format(height, html);
super.init();
}
/**
* Main entry point
*
* @memberof MultiInputDialog
*/
main(): void {
super.main();
this.inputs = $("input", this.scheme);
if (this.data && this.data.data) {
const that = this;
this.inputs.each(function (_i) {
const input = this as HTMLInputElement;
input.value = that.data.data[input.name];
});
}
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (_e) => this.quit();
(this.find("btnOk") as tag.ButtonTag).onbtclick = (_e) => {
let cdata: GenericObject<string> = {};
for (const el of this.inputs) {
let input = el as HTMLInputElement;
if (!this.data.allow_empty && input.value.trim() == "") {
return this.notify(__("All fields should be filled"));
}
cdata[input.name] = input.value.trim();
}
if (this.handle)
this.handle(cdata);
this.quit();
}
}
}
/**
* Scheme definition
*/
MultiInputDialog.scheme = `\
<afx-app-window width='350' height='{0}'>
<afx-hbox>
<div data-width="10" ></div>
<afx-vbox>
<div data-height="5" ></div>
{1}
<afx-hbox data-height="30">
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
<div data-height="5" ></div>
</afx-vbox>
<div data-width="10" ></div>
</afx-hbox>
</afx-app-window>`;
/**
* Generic dynamic key-value dialog
*
* Allow user to input any data key-value based object:
*
* {
* [prop:string]: string;
* }
*
* @export
* @class KeyValueDialog
* @extends {BasicDialog}
*/
export class KeyValueDialog extends BasicDialog {
/**
* Reference to the form container
*
* @private
* @type {HTMLDivElement}
* @memberof KeyValueDialog
*/
private container: HTMLDivElement;
/**
* Creates an instance of KeyValueDialog.
* @memberof KeyValueDialog
*/
constructor() {
super("KeyValueDialog");
}
/**
* Main entry point
*
* @memberof KeyValueDialog
*/
main(): void {
super.main();
this.container = this.find("container") as HTMLDivElement;
(this.find("btnCancel") as tag.ButtonTag).onbtclick = (e) => this.quit();
(this.find("btnAdd") as tag.ButtonTag).onbtclick = (e) => this.addField("", "", true);
$(this.find("wrapper"))
$(this.container)
.css("overflow-y", "auto");
if (this.data && this.data.data) {
for (const key in this.data.data) {
const value = this.data.data[key];
this.addField(key, value, false);
}
}
else {
this.addField("key", "value", false);
}
(this.find("btnOk") as tag.ButtonTag).onbtclick = (e) => {
const inputs = $("input", this.scheme) as JQuery<HTMLInputElement>;
let cdata: GenericObject<string> = {};
for (let i = 0; i < inputs.length; i += 2) {
const key = inputs[i].value.trim();
if (key === "") {
return this.notify(__("Key cannot be empty"));
}
if (cdata[key]) {
return this.notify(__("Duplicate key: {0}", key));
}
cdata[key] = inputs[i + 1].value.trim();
}
if (this.handle)
this.handle(cdata);
this.quit();
}
}
/**
* Add new input key-value field to the dialog
*
* @private
* @memberof KeyValueDialog
*/
private addField(key: string, value: string, removable: boolean): void {
const div = $("<div>")
.css("width", "100%")
.css("display", "flex")
.css("flex-direction", "row")
.appendTo(this.container);
$("<input>")
.attr("type", "text")
.css("width", "120px")
.css("height", "23px")
.val(key)
.appendTo(div);
$("<input>")
.attr("type", "text")
.css("width", "200px")
.css("height", "23px")
.val(value)
.appendTo(div);
if (removable) {
const btn = $("<afx-button>");
btn[0].uify(undefined);
$("button", btn)
.css("width", "23px")
.css("height", "23px");
(btn[0] as tag.ButtonTag).iconclass = "fa fa-minus";
btn
.on("click", () => {
div.remove();
})
.appendTo(div);
}
else {
$("<div>")
.css("width", "23px")
.appendTo(div);
}
}
}
/**
* Scheme definition
*/
KeyValueDialog.scheme = `\
<afx-app-window width='350' height='300'>
<afx-hbox>
<div data-width="10" ></div>
<afx-vbox>
<div data-height="5" ></div>
<afx-label text="__(Enter key-value data)" data-height="30"></afx-label>
<div data-id="container"></div>
<afx-hbox data-height="30">
<afx-button data-id = "btnAdd" iconclass="fa fa-plus" data-width = "30" ></afx-button>
<div ></div>
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
</afx-hbox>
<div data-height="5" ></div>
</afx-vbox>
<div data-width="10" ></div>
</afx-hbox>
</afx-app-window>`;
}
}
}

View File

@ -239,7 +239,7 @@ namespace OS {
return range;
}
Ant.__ = function(...args: any[]): FormattedString | string {
Ant.__ = function (...args: any[]): FormattedString | string {
if (!(args.length > 0)) {
return "Undefined";
}
@ -251,7 +251,7 @@ namespace OS {
);
};
Ant.__e = function(e: Error): Error {
Ant.__e = function (e: Error): Error {
const reason = new Error(e.toString());
reason.stack += "\nCaused By:\n" + e.stack;
return reason;
@ -611,7 +611,7 @@ namespace OS {
writable: true,
});
String.prototype.hash = function(): number {
String.prototype.hash = function (): number {
let hash = 5381;
let i = this.length;
while (i) {
@ -619,10 +619,10 @@ namespace OS {
}
return hash >>> 0;
};
String.prototype.__v = function(): Version {
String.prototype.__v = function (): Version {
return new Version(this);
};
String.prototype.asBase64 = function(): string {
String.prototype.asBase64 = function (): string {
const tmp = encodeURIComponent(this);
return btoa(
tmp.replace(/%([0-9A-F]{2})/g, (match, p1) =>
@ -630,8 +630,8 @@ namespace OS {
)
);
};
String.prototype.escape = function(): string {
return this.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function(
String.prototype.escape = function (): string {
return this.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function (
c: string
) {
switch (c) {
@ -658,11 +658,11 @@ namespace OS {
}
});
};
String.prototype.unescape = function(): string {
String.prototype.unescape = function (): string {
let json = JSON.parse(`{ "text": "${this}"}`)
return json.text;
};
String.prototype.asUint8Array = function(): Uint8Array {
String.prototype.asUint8Array = function (): Uint8Array {
let bytes = [];
for (
let i = 0, end = this.length - 1, asc = 0 <= end;
@ -675,8 +675,8 @@ namespace OS {
};
if (!String.prototype.format) {
String.prototype.format = function(...args: any[]): string {
return this.replace(/{(\d+)}/g, function(
String.prototype.format = function (...args: any[]): string {
return this.replace(/{(\d+)}/g, function (
match: string,
number: number
) {
@ -689,38 +689,38 @@ namespace OS {
};
}
String.prototype.f = function(...args: any[]): FormattedString {
String.prototype.f = function (...args: any[]): FormattedString {
return new FormattedString(this, args);
};
String.prototype.__ = function(): string {
String.prototype.__ = function (): string {
const match = this.match(/^__\((.*)\)$/);
if (match) {
return match[1].l();
}
return this;
};
String.prototype.l = function(): string {
String.prototype.l = function (): string {
if (!API.lang[this]) {
API.lang[this] = this;
}
return API.lang[this];
};
String.prototype.trimFromLeft = function(charlist: string): string {
String.prototype.trimFromLeft = function (charlist: string): string {
if (charlist === undefined) charlist = "s";
return this.replace(new RegExp("^[" + charlist + "]+"), "") as string;
};
String.prototype.trimFromRight = function(charlist: string): string {
String.prototype.trimFromRight = function (charlist: string): string {
if (charlist === undefined) charlist = "s";
return this.replace(new RegExp("[" + charlist + "]+$"), "") as string;
};
String.prototype.trimBy = function(charlist: string): string {
String.prototype.trimBy = function (charlist: string): string {
return this.trimFromLeft(charlist).trimFromRight(charlist) as string;
};
Date.prototype.toString = function(): string {
Date.prototype.toString = function (): string {
let dd = this.getDate();
let mm = this.getMonth() + 1;
const yyyy = this.getFullYear();
@ -746,7 +746,7 @@ namespace OS {
return `${dd}/${mm}/${yyyy} ${hh}:${mi}:${se}`;
};
Date.prototype.timestamp = function(): number {
Date.prototype.timestamp = function (): number {
return (this.getTime() / 1000) | 0;
};
@ -825,7 +825,7 @@ namespace OS {
console.log("Booting system");
API.handle
.auth()
.then(function(d: API.RequestResult) {
.then(function (d: API.RequestResult) {
// in case someone call it more than once :)
if (d.error) {
// show login screen
@ -860,7 +860,7 @@ namespace OS {
}
API.handle
.setting()
.then(function(r: any) {
.then(function (r: any) {
cleanup();
return API.handle.logout().then((d: any) => boot());
})
@ -1132,7 +1132,7 @@ namespace OS {
* @returns {Promise<any>} a promise on the result data
*/
export function post(p: string, d: any): Promise<any> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const q = announcer.getMID();
API.loading(q, p);
return $.ajax({
@ -1141,7 +1141,7 @@ namespace OS {
contentType: "application/json",
data: JSON.stringify(
d,
function(k, v) {
function (k, v) {
if (k === "domel") {
return undefined;
}
@ -1152,11 +1152,11 @@ namespace OS {
dataType: "json",
success: null,
})
.done(function(data) {
.done(function (data) {
API.loaded(q, p, "OK");
return resolve(data);
})
.fail(function(j, s, e) {
.fail(function (j, s, e) {
API.loaded(q, p, "FAIL");
return reject(API.throwe(s));
});
@ -1175,12 +1175,12 @@ namespace OS {
* @returns {Promise<ArrayBuffer>} a promise on the returned binary data
*/
export function blob(p: string): Promise<ArrayBuffer> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const q = announcer.getMID();
const r = new XMLHttpRequest();
r.open("GET", p, true);
r.responseType = "arraybuffer";
r.onload = function(e) {
r.onload = function (e) {
if (this.status === 200 && this.readyState === 4) {
API.loaded(q, p, "OK");
resolve(this.response);
@ -1205,38 +1205,51 @@ namespace OS {
* @returns {Promise<any>}
*/
export function upload(p: string, d: string): Promise<any> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const q = announcer.getMID();
//insert a temporal file selector
const o = $("<input>")
.attr("type", "file")
.css("display", "none");
o.change(function() {
API.loading(q, p);
const formd = new FormData();
formd.append("path", d);
// TODO: only one file is selected at this time
formd.append("upload", (o[0] as HTMLInputElement).files[0]);
return $.ajax({
url: p,
data: formd,
type: "POST",
contentType: false,
processData: false,
})
.done(function(data) {
API.loaded(q, p, "OK");
resolve(data);
return o.remove();
const o =
$("<input>")
.attr("type","file")
.attr("multiple","true");
o.on("change", function () {
const files = (o[0] as HTMLInputElement).files;
const n_files = files.length;
const tasks = [];
if (n_files > 0)
API.loading(q, p);
Array.from(files).forEach(file => {
const formd = new FormData();
formd.append("path", d);
formd.append("upload", file);
return $.ajax({
url: p,
data: formd,
type: "POST",
contentType: false,
processData: false,
})
.fail(function(j, s, e) {
API.loaded(q, p, "FAIL");
reject(API.throwe(s));
return o.remove();
});
.done(function (data) {
tasks.push("OK");
if (tasks.length == n_files)
{
API.loaded(q, p, "OK");
resolve(data);
o.remove();
}
})
.fail(function (j, s, e) {
tasks.push("FAIL");
if (tasks.length == n_files)
{
API.loaded(q, p, "FAIL");
o.remove();
}
reject(API.throwe(s));
});
});
});
return o.click();
return o.trigger("click");
});
}
@ -1310,7 +1323,7 @@ namespace OS {
* @returns {Promise<any>} a Promise on the requested data
*/
export function get(p: string, t: string = undefined): Promise<any> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const conf: any = {
type: "GET",
url: p,
@ -1321,11 +1334,11 @@ namespace OS {
const q = announcer.getMID();
API.loading(q, p);
return $.ajax(conf)
.done(function(data) {
.done(function (data) {
API.loaded(q, p, "OK");
return resolve(data);
})
.fail(function(j, s, e) {
.fail(function (j, s, e) {
API.loaded(q, p, "FAIL");
return reject(API.throwe(s));
});
@ -1382,43 +1395,37 @@ namespace OS {
* @returns {Promise<void>} a promise on the result data
*/
export function requires(l: string, force: boolean = false): Promise<void> {
return new Promise(function(resolve, reject) {
if (!API.shared[l] || force) {
const libfp = l.asFileHandle();
switch (libfp.ext) {
case "css":
return libfp
.onready()
.then(function() {
$("<link>", {
rel: "stylesheet",
type: "text/css",
href: `${libfp.getlink()}`,
}).appendTo("head");
API.shared[l] = true;
console.log("Loaded :", l);
announcer.trigger("sharedlibraryloaded", l);
return resolve(undefined);
})
.catch((e: Error) => reject(__e(e)));
case "js":
return API.script(libfp.getlink())
.then(function(data: any) {
API.shared[l] = true;
console.log("Loaded :", l);
announcer.trigger("sharedlibraryloaded", l);
return resolve(data);
})
.catch((e: Error) => reject(__e(e)));
default:
return reject(
API.throwe(__("Invalid library: {0}", l))
);
return new Promise(async (resolve, reject) =>{
try {
if (!API.shared[l] || force) {
const libfp = l.asFileHandle();
switch (libfp.ext) {
case "css":
await libfp.onready();
$("<link>", {
rel: "stylesheet",
type: "text/css",
href: `${libfp.getlink()}`,
}).appendTo("head");
API.shared[l] = true;
console.log("Loaded :", l);
return resolve(undefined);
case "js":
await API.script(libfp.getlink());
API.shared[l] = true;
console.log("Loaded :", l);
return resolve(undefined);
default:
return reject(
API.throwe(__("Invalid library: {0}", l))
);
}
} else {
console.log(l, "Library exist, no need to load");
return resolve();
}
} else {
console.log(l, "Library exist, no need to load");
announcer.trigger("sharedlibraryloaded", l);
return resolve();
} catch (error) {
reject(__e(error));
}
});
}
@ -1431,25 +1438,18 @@ namespace OS {
* @returns {Promise<void>}
*/
export function require(libs: string[]): Promise<void> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
if (!(libs.length > 0)) {
return resolve();
}
announcer.observable.one("sharedlibraryloaded", async function(
l
) {
libs.splice(0, 1);
let r: void;
try {
r = await API.require(libs);
} catch (e) {
r = reject(__e(e));
}
return resolve(r);
});
return API.requires(libs[0], false).catch((e: Error) =>
reject(__e(e))
);
const l = libs.splice(0, 1)[0];
return API.requires(l, false)
.catch((e: Error) => reject(__e(e)))
.then((_l) => {
API.require(libs)
.then(() => resolve())
.catch((e) => reject(__e(e)))
});
});
}
/**
@ -1606,7 +1606,7 @@ namespace OS {
* @returns {Promise<any>}
*/
export function setLocale(name: string): Promise<any> {
return new Promise(async function(resolve, reject) {
return new Promise(async function (resolve, reject) {
const path = `resources/languages/${name}.json`;
try {
const d = await API.get(path, "json");
@ -1661,7 +1661,7 @@ namespace OS {
* @returns {Promise<any>} Promise on the clipboard data
*/
export function getClipboard(): Promise<any> {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
const $el = $("#clipboard");
if (!navigator.clipboard) {
return resolve($el.val());
@ -1705,7 +1705,7 @@ namespace OS {
enumerable: false,
value: p,
});
const fn = function(o: any, v: any) {
const fn = function (o: any, v: any) {
return Object.defineProperty(o, v, {
enumerable: true,
set(value) {

View File

@ -34,47 +34,16 @@ namespace OS {
*/
export interface ShortcutType {
/**
* Placeholder for all shortcut callbacks attached to `ALT` key, eg.
* Placeholder for all shortcut callbacks, example:
* ```typescript
* ALT.c = function() {..}
* fn_193462204.c = function() {..}
* // this function will be called when the hotkey `ALT-C` is triggered
* // fn_${"ALT".hash()} is fn_193462204
* ```
*
* @memberof ShortcutType
*/
ALT: GenericObject<(e: JQuery.MouseDownEvent) => void>;
/**
* Placeholder for all shortcut callbacks attached to `CTRL` key, eg.
* ```typescript
* CTRL.c = function() {..}
* // this function will be called when the hotkey `CTRL-C` is triggered
* ```
*
* @memberof ShortcutType
*/
CTRL: GenericObject<(e: JQuery.MouseDownEvent) => void>;
/**
* Placeholder for all shortcut callbacks attached to `SHIFT` key, eg.
* ```typescript
* SHIFT.c = function() {..}
* // this function will be called when the hotkey `SHIFT-C` is triggered
* ```
*
* @memberof ShortcutType
*/
SHIFT: GenericObject<(e: JQuery.MouseDownEvent) => void>;
/**
* Placeholder for all shortcut callbacks attached to `META` key, eg.
* ```typescript
* META[" "] = function() {..}
* // this function will be called when the hotkey `META-[space]` is triggered
* ```
*
* @memberof ShortcutType
*/
META: GenericObject<(e: JQuery.MouseDownEvent) => void>;
[propName: string]: GenericObject<(e: JQuery.KeyDownEvent) => void>;
}
/**
@ -129,12 +98,7 @@ namespace OS {
/**
* Placeholder for system shortcuts
*/
var shortcut: ShortcutType = {
ALT: {},
CTRL: {},
SHIFT: {},
META: {},
};
var shortcut: ShortcutType = {};
/**
* Convert an application html scheme to
@ -156,7 +120,6 @@ namespace OS {
parent: Element | string
): void {
const scheme = $.parseHTML(html);
if (app.scheme) {
$(app.scheme).remove();
}
@ -353,7 +316,8 @@ namespace OS {
return;
}
if (it.type === "app" && it.app) {
return launch(it.app, []);
launch(it.app, []);
return;
}
if (it.type === "app") {
return announcer.osinfo(
@ -367,17 +331,19 @@ namespace OS {
);
}
if (apps.length === 1) {
return launch(apps[0].app, [it]);
launch(apps[0].app, [it]);
return;
}
const list = apps.map((e) => ({
text: e.app,
text: e.name,
app: e.app,
icon: e.icon,
iconclass: e.iconclass,
}));
openDialog("SelectionDialog", {
title: __("Open with"),
data: list,
}).then((d) => launch(d.text, [it]));
}).then((d) => launch(d.app, [it]));
}
/**
@ -400,7 +366,7 @@ namespace OS {
"This method is used for developing only, please use the launch method instead"
);
unloadApp(app);
return launch(app, args);
launch(app, args);
}
/**
@ -565,50 +531,61 @@ namespace OS {
* @param {string} app application class name
* @param {AppArgumentsType[]} args application arguments
*/
export function launch(app: string, args: AppArgumentsType[]): void {
if (!application[app]) {
// first load it
loadApp(app)
.then((a) =>
{
if (!application[app]){
return announcer.oserror(
export function launch(app: string, args: AppArgumentsType[]): Promise<OS.PM.ProcessType> {
return new Promise((resolve, reject) => {
if (!application[app]) {
// first load it
loadApp(app)
.then((a) => {
if (!application[app]) {
const e = API.throwe(__("Application not found"));
announcer.oserror(
__("{0} is not an application", app),
API.throwe(__("Application not found"))
);
e);
return reject(e);
}
PM.createProcess(
app,
application[app],
args
).catch((e) =>
).catch((e) => {
announcer.osfail(
__("Unable to launch: {0}", app),
e
)
)
);
return reject(e);
}
).then((p: PM.ProcessType) => resolve(p));
}
)
.catch((e) =>
announcer.osfail(__("Unable to launch: {0}", app), e)
);
} else {
// now launch it
if (application[app]) {
PM.createProcess(
app,
application[app],
args
).catch((e: Error) =>
announcer.osfail(__("Unable to launch: {0}", app), e)
);
)
.catch((e) => {
announcer.osfail(__("Unable to launch: {0}", app), e);
reject(e);
}
);
} else {
announcer.osfail(
__("Unable to find: {0}", app),
API.throwe("Application not found")
);
// now launch it
if (application[app]) {
PM.createProcess(
app,
application[app],
args
).catch((e: Error) => {
announcer.osfail(__("Unable to launch: {0}", app), e);
return reject(e);
}
);
} else {
const e = API.throwe(__("Application not found"));
announcer.osfail(
__("Unable to find: {0}", app),
e
);
return reject(e);
}
}
}
});
}
/**
@ -643,9 +620,9 @@ namespace OS {
data.iconclass = "fa fa-cogs";
}
const dock = $("#sysdock")[0] as tag.AppDockTag;
app.sysdock = dock;
app.init();
app.observable.one("rendered", function () {
app.sysdock = dock;
app.appmenu = $(
"[data-id = 'appmenu']",
"#syspanel"
@ -739,7 +716,7 @@ namespace OS {
var handle = function (e: HTMLElement) {
if (e.contextmenuHandle) {
const m = $("#contextmenu")[0] as tag.MenuTag;
m.onmenuselect = () => {};
m.onmenuselect = () => { };
return e.contextmenuHandle(event, m);
} else {
const p = $(e).parent().get(0);
@ -758,23 +735,38 @@ namespace OS {
*
* @export
* @param {string} k the hotkey e.g. `ALT-C`
* @param {(e: JQuery.MouseDownEvent) => void} f handle function
* @param {(e: JQuery.KeyPressEvent) => void} f handle function
* @param {boolean} force force to rebind the hotkey
* @returns {void}
*/
export function bindKey(
k: string,
f: (e: JQuery.MouseDownEvent) => void,
f: (e: JQuery.KeyDownEvent) => void,
force: boolean = true
): void {
const arr = k.split("-");
if (arr.length !== 2) {
const arr = k.toUpperCase().split("-");
const c = arr.pop();
let fnk = "";
if (arr.includes("META")) {
fnk += "META";
}
if (arr.includes("CTRL")) {
fnk += "CTRL";
}
if (arr.includes("ALT")) {
fnk += "ALT";
}
if (arr.includes("SHIFT")) {
fnk += "SHIFT";
}
if (fnk == "") {
return;
}
const fnk = arr[0].toUpperCase();
const c = arr[1].toUpperCase();
fnk = `fn_${fnk.hash()}`;
if (!shortcut[fnk]) {
return;
shortcut[fnk] = {};
}
if (shortcut[fnk][c] && !force) return;
shortcut[fnk][c] = f;
@ -838,6 +830,10 @@ namespace OS {
left = offset.left + w / 2 - $(label).width() / 2;
top = offset.top - $(label).height() - 5;
break;
case "cb": // center bottom
left = offset.left + w / 2 - $(label).width() / 2;
top = offset.top + $(label).height() + 10;
break;
default:
if (!e) {
return;
@ -907,7 +903,7 @@ namespace OS {
$("#wrapper").append(scheme);
announcer.observable.one("sysdockloaded", () => {
$(window).bind("keydown", function (event) {
$(window).on("keydown", function (event) {
const dock = $("#sysdock")[0] as tag.AppDockTag;
if (!dock) {
return;
@ -915,20 +911,24 @@ namespace OS {
const app = dock.selectedApp;
//return true unless app
const c = String.fromCharCode(event.which).toUpperCase();
let fnk = undefined;
if (event.ctrlKey) {
fnk = "CTRL";
} else if (event.metaKey) {
fnk = "META";
} else if (event.shiftKey) {
fnk = "SHIFT";
} else if (event.altKey) {
fnk = "ALT";
let fnk = "";
if (event.metaKey) {
fnk += "META";
}
if (!fnk) {
if (event.ctrlKey) {
fnk += "CTRL";
}
if (event.altKey) {
fnk += "ALT";
}
if (event.shiftKey) {
fnk += "SHIFT";
}
//console.log(fnk, c);
if (fnk == "") {
return;
}
fnk = `fn_${fnk.hash()}`;
const r = app ? app.shortcut(fnk, c, event) : true;
if (!r) {
return event.preventDefault();
@ -949,9 +949,9 @@ namespace OS {
$("#systooltip")[0].uify(undefined);
$("#contextmenu")[0].uify(undefined);
$("#workspace").contextmenu((e) => bindContextMenu(e));
$("#wrapper").on("contextmenu",(e) => bindContextMenu(e));
// tooltip
$(document).mouseover(function (e) {
$(document).on("mouseover", function (e) {
const el: any = $(e.target).closest("[tooltip]");
if (!(el.length > 0)) {
return;
@ -1092,7 +1092,7 @@ namespace OS {
export function login(): void {
const scheme = $.parseHTML(schemes.login);
$("#wrapper").append(scheme);
$("#btlogin").click(async function () {
$("#btlogin").on("click", async function () {
const data: API.UserLoginType = {
username: $("#txtuser").val() as string,
password: $("#txtpass").val() as string,
@ -1107,14 +1107,14 @@ namespace OS {
return $("#login_error").html("Login: server error");
}
});
$("#txtpass").keyup(function (e) {
$("#txtpass").on("keyup", function (e) {
if (e.which === 13) {
return $("#btlogin").click();
return $("#btlogin").trigger("click");
}
});
$("#txtuser").keyup(function (e) {
if (e.which === 13) {
return $("#btlogin").click();
return $("#btlogin").trigger("click");
}
});
}
@ -1227,8 +1227,8 @@ namespace OS {
schemes.login = `\
<div id = "login_form">
<p>Welcome to AntOS, please login</p>
<input id = "txtuser" type = "text" value = "demo" />
<input id = "txtpass" type = "password" value = "demo" />
<input id = "txtuser" type = "text" value = "demo" ></input>
<input id = "txtpass" type = "password" value = "demo" ></input>
<button id = "btlogin">Login</button>
<div id = "login_error"></div>
</div>\

View File

@ -214,4 +214,153 @@
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url",
"Yes":"Yes",
"{0} is not a directory":"{0} is not a directory"
,
"{0}: {1}":"{0}: {1}",
"{0} is not a file":"{0} is not a file",
"{0} is not an application":"{0} is not an application",
"Add application":"Add application",
"Add mount point":"Add mount point",
"Add service":"Add service",
"All fields should be filled":"All fields should be filled",
"Appearance":"Appearance",
"Application {0} is not installed":"Application {0} is not installed",
"Application meta data isnt found":"Application meta data isnt found",
"Application not found":"Application not found",
"Applications and services setting":"Applications and services setting",
"Apps. and Services":"Apps. and Services",
"Cannot fetch system locales: {0}":"Cannot fetch system locales: {0}",
"Cannot load extension meta data":"Cannot load extension meta data",
"Cannot load scheme: {0}":"Cannot load scheme: {0}",
"Cannot read folder: {0}":"Cannot read folder: {0}",
"Change language mode":"Change language mode",
"Change theme":"Change theme",
"Command palete":"Command palete",
"Command palette":"Command palette",
"Command Palette":"Command Palette",
"Compiled successful":"Compiled successful",
"Confirm install":"Confirm install",
"ct:Logout":"ct:Logout",
"ct:Toggle fullscreen":"ct:Toggle fullscreen",
"Current folder is not found":"Current folder is not found",
"Desktop path":"Desktop path",
"Duplicate key: {0}":"Duplicate key: {0}",
"Edit mount point":"Edit mount point",
"Enter key-value data":"Enter key-value data",
"Enter URI":"Enter URI",
"Error reported":"Error reported",
"example string":"example string",
"Extension installed":"Extension installed",
"ExtensionName":"ExtensionName",
"Fail to create: {0}":"Fail to create: {0}",
"Fail to download: {0}":"Fail to download: {0}",
"Fail to publish: {0}":"Fail to publish: {0}",
"Fail to rename: {0}":"Fail to rename: {0}",
"Fail to upload: {0}":"Fail to upload: {0}",
"hello {0}":"hello {0}",
"Hide":"Hide",
"Install from zip":"Install from zip",
"Installing...":"Installing...",
"Invalid library: {0}":"Invalid library: {0}",
"Invalid package name: {0}":"Invalid package name: {0}",
"Invalid package path":"Invalid package path",
"Key cannot be empty":"Key cannot be empty",
"Languages":"Languages",
"Local packages path":"Local packages path",
"Mount points":"Mount points",
"Mount Points":"Mount Points",
"New CodePad extension at":"New CodePad extension at",
"New Project at":"New Project at",
"New window":"New window",
"No meta-data found":"No meta-data found",
"Open folder":"Open folder",
"Open Folder":"Open Folder",
"Open Recent":"Open Recent",
"Output":"Output",
"Packaged uninstalled":"Packaged uninstalled",
"Package installed: {0}":"Package installed: {0}",
"Package not found {0}":"Package not found {0}",
"Package updated":"Package updated",
"Path":"Path",
"Pinned applications":"Pinned applications",
"Please enter extension URI:":"Please enter extension URI:",
"Please enter mount point name":"Please enter mount point name",
"Please select {0} only":"Please select {0} only",
"Please select a day":"Please select a day",
"Please select a directory":"Please select a directory",
"Please select a file/fofler":"Please select a file/fofler",
"Please select an item":"Please select an item",
"Please select color":"Please select color",
"Preparing for release":"Preparing for release",
"ProjectName":"ProjectName",
"Remove: {0}?":"Remove: {0}?",
"Remove":"Remove",
"Report":"Report",
"Running {0}...":"Running {0}...",
"Select a directory":"Select a directory",
"Select build directory":"Select build directory",
"Select extension archive":"Select extension archive",
"Select package archive":"Select package archive",
"Service not found: {0}":"Service not found: {0}",
"Services":"Services",
"Show":"Show",
"Start":"Start",
"Startup applications":"Startup applications",
"Startup services":"Startup services",
"Startup":"Startup",
"System error log":"System error log",
"System locale":"System locale",
"System setting saved":"System setting saved",
"The folder is not empty: {0}":"The folder is not empty: {0}",
"Theme":"Theme",
"Toggle bottom bar":"Toggle bottom bar",
"Toggle split view":"Toggle split view",
"Unable to build extension: {0}":"Unable to build extension: {0}",
"Unable to build project: {0}":"Unable to build project: {0}",
"Unable to create archive: {0}":"Unable to create archive: {0}",
"Unable to create extension directories: {0}":"Unable to create extension directories: {0}",
"Unable to create extension template: {0}":"Unable to create extension template: {0}",
"Unable to create package archive: {0}":"Unable to create package archive: {0}",
"Unable to create project directory: {0}":"Unable to create project directory: {0}",
"Unable to create template files: {0}":"Unable to create template files: {0}",
"Unable to disable split view: Please save changes of modified files on the right panel":"Unable to disable split view: Please save changes of modified files on the right panel",
"Unable to find: {0}":"Unable to find: {0}",
"Unable to find action: {0}":"Unable to find action: {0}",
"Unable to find application meta-data: {0}":"Unable to find application meta-data: {0}",
"Unable to find dialog scheme":"Unable to find dialog scheme",
"Unable to find extension: {0}":"Unable to find extension: {0}",
"Unable to find package: {0}":"Unable to find package: {0}",
"Unable to get blob: {0}":"Unable to get blob: {0}",
"Unable to install extension: {0}":"Unable to install extension: {0}",
"Unable to install package":"Unable to install package",
"Unable to launch: {0}":"Unable to launch: {0}",
"Unable to load: {0}":"Unable to load: {0}",
"unable to load extension: {0}":"unable to load extension: {0}",
"Unable to load push notification service":"Unable to load push notification service",
"Unable to load repository: {0}: {1}":"Unable to load repository: {0}: {1}",
"Unable to move file/folder":"Unable to move file/folder",
"Unable to open: {0}":"Unable to open: {0}",
"Unable to preload extension":"Unable to preload extension",
"Unable to read: {0}":"Unable to read: {0}",
"Unable to read meta-data: {0}":"Unable to read meta-data: {0}",
"Unable to read meta-data:{0}":"Unable to read meta-data:{0}",
"Unable to read meta-data":"Unable to read meta-data",
"Unable to read package description":"Unable to read package description",
"Unable to report error: {0}":"Unable to report error: {0}",
"Unable to run extension: {0}":"Unable to run extension: {0}",
"Unable to run project: {0}":"Unable to run project: {0}",
"Unable to save file: {0}":"Unable to save file: {0}",
"Unable to uninstall package(s): {0}":"Unable to uninstall package(s): {0}",
"Uninstall successfully":"Uninstall successfully",
"Unknown extension action: {0}":"Unknown extension action: {0}",
"Unresolved dependencies on: {0}":"Unresolved dependencies on: {0}",
"Unresolved dependencies":"Unresolved dependencies",
"Update":"Update",
"Value":"Value",
"Verifying: {0}":"Verifying: {0}",
"Version string is in invalid format: {0}":"Version string is in invalid format: {0}",
"VFS unknown handle: {0}":"VFS unknown handle: {0}",
"VFS":"VFS",
"Wallpaper":"Wallpaper"
}

View File

@ -304,4 +304,116 @@
"Welcome to AntOSDK":"Welcome to AntOSDK",
"Your application version is older ({0} < {1})":"Your application version is older ({0} < {1})",
"zip file generated in release folder":"zip file generated in release folder"
,
"{0}: {1}":"{0}: {1}",
"{0} is not a file":"{0} is not a file",
"{0} is not an application":"{0} is not an application",
"All fields should be filled":"All fields should be filled",
"Application {0} is not installed":"Application {0} is not installed",
"Application meta data isnt found":"Application meta data isnt found",
"Application not found":"Application not found",
"Applications and services setting":"Applications and services setting",
"Apps. and Services":"Apps. and Services",
"Cannot load extension meta data":"Cannot load extension meta data",
"Cannot load scheme: {0}":"Cannot load scheme: {0}",
"Cannot read folder: {0}":"Cannot read folder: {0}",
"Change language mode":"Change language mode",
"Change theme":"Change theme",
"Command palete":"Command palete",
"Command palette":"Command palette",
"Command Palette":"Command Palette",
"Confirm install":"Confirm install",
"ct:Logout":"ct:Logout",
"ct:Toggle fullscreen":"ct:Toggle fullscreen",
"Current folder is not found":"Current folder is not found",
"Duplicate key: {0}":"Duplicate key: {0}",
"Enter key-value data":"Enter key-value data",
"Enter URI":"Enter URI",
"Error reported":"Error reported",
"example string":"example string",
"Extension installed":"Extension installed",
"ExtensionName":"ExtensionName",
"Fail to create: {0}":"Fail to create: {0}",
"Fail to download: {0}":"Fail to download: {0}",
"Fail to publish: {0}":"Fail to publish: {0}",
"Fail to rename: {0}":"Fail to rename: {0}",
"Fail to upload: {0}":"Fail to upload: {0}",
"hello {0}":"hello {0}",
"Install from zip":"Install from zip",
"Invalid library: {0}":"Invalid library: {0}",
"Invalid package name: {0}":"Invalid package name: {0}",
"Invalid package path":"Invalid package path",
"Key cannot be empty":"Key cannot be empty",
"Mount Points":"Mount Points",
"New CodePad extension at":"New CodePad extension at",
"New window":"New window",
"No meta-data found":"No meta-data found",
"Open folder":"Open folder",
"Open Folder":"Open Folder",
"Open Recent":"Open Recent",
"Packaged uninstalled":"Packaged uninstalled",
"Package installed: {0}":"Package installed: {0}",
"Package not found {0}":"Package not found {0}",
"Package updated":"Package updated",
"Pinned applications":"Pinned applications",
"Please enter extension URI:":"Please enter extension URI:",
"Please select a day":"Please select a day",
"Please select an item":"Please select an item",
"Please select color":"Please select color",
"Report":"Report",
"Select build directory":"Select build directory",
"Select extension archive":"Select extension archive",
"Select package archive":"Select package archive",
"Service not found: {0}":"Service not found: {0}",
"Services":"Services",
"Start":"Start",
"System error log":"System error log",
"The folder is not empty: {0}":"The folder is not empty: {0}",
"Toggle bottom bar":"Toggle bottom bar",
"Toggle split view":"Toggle split view",
"Unable to build extension: {0}":"Unable to build extension: {0}",
"Unable to build project: {0}":"Unable to build project: {0}",
"Unable to create archive: {0}":"Unable to create archive: {0}",
"Unable to create extension directories: {0}":"Unable to create extension directories: {0}",
"Unable to create extension template: {0}":"Unable to create extension template: {0}",
"Unable to create package archive: {0}":"Unable to create package archive: {0}",
"Unable to create project directory: {0}":"Unable to create project directory: {0}",
"Unable to create template files: {0}":"Unable to create template files: {0}",
"Unable to disable split view: Please save changes of modified files on the right panel":"Unable to disable split view: Please save changes of modified files on the right panel",
"Unable to find: {0}":"Unable to find: {0}",
"Unable to find action: {0}":"Unable to find action: {0}",
"Unable to find application meta-data: {0}":"Unable to find application meta-data: {0}",
"Unable to find dialog scheme":"Unable to find dialog scheme",
"Unable to find extension: {0}":"Unable to find extension: {0}",
"Unable to find package: {0}":"Unable to find package: {0}",
"Unable to get blob: {0}":"Unable to get blob: {0}",
"Unable to install extension: {0}":"Unable to install extension: {0}",
"Unable to install package":"Unable to install package",
"Unable to launch: {0}":"Unable to launch: {0}",
"Unable to load: {0}":"Unable to load: {0}",
"unable to load extension: {0}":"unable to load extension: {0}",
"Unable to load push notification service":"Unable to load push notification service",
"Unable to load repository: {0}: {1}":"Unable to load repository: {0}: {1}",
"Unable to move file/folder":"Unable to move file/folder",
"Unable to open: {0}":"Unable to open: {0}",
"Unable to preload extension":"Unable to preload extension",
"Unable to read: {0}":"Unable to read: {0}",
"Unable to read meta-data: {0}":"Unable to read meta-data: {0}",
"Unable to read meta-data:{0}":"Unable to read meta-data:{0}",
"Unable to read meta-data":"Unable to read meta-data",
"Unable to read package description":"Unable to read package description",
"Unable to report error: {0}":"Unable to report error: {0}",
"Unable to run extension: {0}":"Unable to run extension: {0}",
"Unable to run project: {0}":"Unable to run project: {0}",
"Unable to save file: {0}":"Unable to save file: {0}",
"Unable to uninstall package(s): {0}":"Unable to uninstall package(s): {0}",
"Uninstall successfully":"Uninstall successfully",
"Unknown extension action: {0}":"Unknown extension action: {0}",
"Unresolved dependencies on: {0}":"Unresolved dependencies on: {0}",
"Unresolved dependencies":"Unresolved dependencies",
"Value":"Value",
"Verifying: {0}":"Verifying: {0}",
"VFS unknown handle: {0}":"VFS unknown handle: {0}"
}

View File

@ -245,4 +245,63 @@
"Theme":"Thème",
"VFS":"VFS",
"Wallpaper":"Fond d'écran"
,
"add {0} to zip":"add {0} to zip",
"Add files to build target":"Add files to build target",
"and unsaved project":"and unsaved project",
"Build and Run":"Build and Run",
"Build":"Build",
"Build done":"Build done",
"Build Options":"Build Options",
"Build release":"Build release",
"Cannot create file: {0}":"Cannot create file: {0}",
"Cannot export: {0}":"Cannot export: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot save project: {0}":"Cannot save project: {0}",
"Cannot save the zip file {0} : {1}":"Cannot save the zip file {0} : {1}",
"Coffees":"Coffees",
"Compiled successful":"Compiled successful",
"Copied {0} -> {1}":"Copied {0} -> {1}",
"Copied files":"Copied files",
"Created directory: {0}":"Created directory: {0}",
"Created file: {0}":"Created file: {0}",
"Css":"Css",
"Error when create directory: {0}":"Error when create directory: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Generated {0}":"Generated {0}",
"Graph editor":"Graph editor",
"Hide":"Hide",
"Ignore: {0} unsaved files {1}?":"Ignore: {0} unsaved files {1}?",
"Ignore unsaved project ?":"Ignore unsaved project ?",
"Installing...":"Installing...",
"Javascripts":"Javascripts",
"Metadata found...":"Metadata found...",
"New Project at":"New Project at",
"New project":"New project",
"Opening {0}":"Opening {0}",
"Open project":"Open project",
"Open Project":"Open Project",
"Output":"Output",
"Please select {0} only":"Please select {0} only",
"Please select a file/fofler":"Please select a file/fofler",
"Preparing for release":"Preparing for release",
"ProjectName":"ProjectName",
"Project":"Project",
"project saved":"project saved",
"Render":"Render",
"Running {0}...":"Running {0}...",
"Select a file":"Select a file",
"Show":"Show",
"Syntax error: {0}":"Syntax error: {0}",
"Uninstall: {0}?":"Uninstall: {0}?",
"Unsaved project":"Unsaved project",
"Update":"Update",
"Verifying {0}":"Verifying {0}",
"Version string is in invalid format: {0}":"Version string is in invalid format: {0}",
"Welcome to AntOSDK":"Welcome to AntOSDK",
"Your application version is older ({0} < {1})":"Your application version is older ({0} < {1})",
"zip file generated in release folder":"zip file generated in release folder"
}

View File

@ -393,4 +393,66 @@
"Value":"Value",
"Verifying: {0}":"Verifying: {0}",
"VFS unknown handle: {0}":"VFS unknown handle: {0}"
,
"{0}: {1}":"{0}: {1}",
"{0} is not an application":"{0} is not an application",
"All fields should be filled":"All fields should be filled",
"Application {0} is not installed":"Application {0} is not installed",
"Application not found":"Application not found",
"Applications and services setting":"Applications and services setting",
"Apps. and Services":"Apps. and Services",
"Confirm install":"Confirm install",
"Duplicate key: {0}":"Duplicate key: {0}",
"Enter key-value data":"Enter key-value data",
"Enter URI":"Enter URI",
"example string":"example string",
"hello {0}":"hello {0}",
"Install from zip":"Install from zip",
"Invalid package name: {0}":"Invalid package name: {0}",
"Invalid package path":"Invalid package path",
"Key cannot be empty":"Key cannot be empty",
"New window":"New window",
"Open Recent":"Open Recent",
"Packaged uninstalled":"Packaged uninstalled",
"Package installed: {0}":"Package installed: {0}",
"Package not found {0}":"Package not found {0}",
"Package updated":"Package updated",
"Pinned applications":"Pinned applications",
"Please enter extension URI:":"Please enter extension URI:",
"Select build directory":"Select build directory",
"Select package archive":"Select package archive",
"Service not found: {0}":"Service not found: {0}",
"Toggle bottom bar":"Toggle bottom bar",
"Toggle split view":"Toggle split view",
"Unable to build extension: {0}":"Unable to build extension: {0}",
"Unable to build project: {0}":"Unable to build project: {0}",
"Unable to create archive: {0}":"Unable to create archive: {0}",
"Unable to create extension directories: {0}":"Unable to create extension directories: {0}",
"Unable to create extension template: {0}":"Unable to create extension template: {0}",
"Unable to create package archive: {0}":"Unable to create package archive: {0}",
"Unable to create project directory: {0}":"Unable to create project directory: {0}",
"Unable to create template files: {0}":"Unable to create template files: {0}",
"Unable to disable split view: Please save changes of modified files on the right panel":"Unable to disable split view: Please save changes of modified files on the right panel",
"Unable to find: {0}":"Unable to find: {0}",
"Unable to find application meta-data: {0}":"Unable to find application meta-data: {0}",
"Unable to find dialog scheme":"Unable to find dialog scheme",
"Unable to find package: {0}":"Unable to find package: {0}",
"Unable to get blob: {0}":"Unable to get blob: {0}",
"Unable to install extension: {0}":"Unable to install extension: {0}",
"Unable to install package":"Unable to install package",
"Unable to launch: {0}":"Unable to launch: {0}",
"Unable to load: {0}":"Unable to load: {0}",
"Unable to load push notification service":"Unable to load push notification service",
"Unable to load repository: {0}: {1}":"Unable to load repository: {0}: {1}",
"Unable to move file/folder":"Unable to move file/folder",
"Unable to read meta-data: {0}":"Unable to read meta-data: {0}",
"Unable to read meta-data:{0}":"Unable to read meta-data:{0}",
"Unable to read package description":"Unable to read package description",
"Unable to run extension: {0}":"Unable to run extension: {0}",
"Unable to run project: {0}":"Unable to run project: {0}",
"Unable to uninstall package(s): {0}":"Unable to uninstall package(s): {0}",
"Uninstall successfully":"Uninstall successfully",
"Unknown extension action: {0}":"Unknown extension action: {0}",
"Unresolved dependencies on: {0}":"Unresolved dependencies on: {0}",
"Unresolved dependencies":"Unresolved dependencies"
}

View File

@ -327,4 +327,70 @@
"Report":"Report",
"Select extension archive":"Select extension archive",
"System error log":"System error log"
,
"[^":"[^",
"{0} is not a file":"{0} is not a file",
"Action {0} is unsupported on: {1}":"Action {0} is unsupported on: {1}",
"Application meta data isnt found":"Application meta data isnt found",
"Cannot load extension meta data":"Cannot load extension meta data",
"Cannot load scheme: {0}":"Cannot load scheme: {0}",
"Cannot read folder: {0}":"Cannot read folder: {0}",
"Change language mode":"Change language mode",
"Change theme":"Change theme",
"Command palete":"Command palete",
"Command palette":"Command palette",
"ct:Logout":"ct:Logout",
"ct:Toggle fullscreen":"ct:Toggle fullscreen",
"ct:User: {0}":"ct:User: {0}",
"Current folder is not found":"Current folder is not found",
"Error reported":"Error reported",
"Error saving file {0}: {1}":"Error saving file {0}: {1}",
"Example action":"Example action",
"Extension installed":"Extension installed",
"ExtensionName":"ExtensionName",
"Fail to create: {0}":"Fail to create: {0}",
"Fail to download: {0}":"Fail to download: {0}",
"Fail to publish: {0}":"Fail to publish: {0}",
"Fail to read: {0}":"Fail to read: {0}",
"Fail to rename: {0}":"Fail to rename: {0}",
"Fail to upload: {0}":"Fail to upload: {0}",
"Install extension":"Install extension",
"Invalid library: {0}":"Invalid library: {0}",
"New Extension":"New Extension",
"New project from current folder":"New project from current folder",
"New Project":"New Project",
"No meta-data found":"No meta-data found",
"Open folder":"Open folder",
"Open Folder":"Open Folder",
"Package is generated in release folder":"Package is generated in release folder",
"Please select a day":"Please select a day",
"Please select an item":"Please select an item",
"Please select color":"Please select color",
"Start":"Start",
"The folder is not empty: {0}":"The folder is not empty: {0}",
"Unable to build extension":"Unable to build extension",
"Unable to build project":"Unable to build project",
"Unable to create archive":"Unable to create archive",
"Unable to create extension directories":"Unable to create extension directories",
"Unable to create extension template":"Unable to create extension template",
"Unable to create package archive":"Unable to create package archive",
"Unable to create project directory":"Unable to create project directory",
"Unable to create template files":"Unable to create template files",
"Unable to find action: {0}":"Unable to find action: {0}",
"Unable to find extension: {0}":"Unable to find extension: {0}",
"Unable to install extension":"Unable to install extension",
"unable to load extension: {0}":"unable to load extension: {0}",
"Unable to load libraries":"Unable to load libraries",
"Unable to open: {0}":"Unable to open: {0}",
"Unable to preload extension":"Unable to preload extension",
"Unable to read: {0}":"Unable to read: {0}",
"Unable to read meta-data":"Unable to read meta-data",
"Unable to report error: {0}":"Unable to report error: {0}",
"Unable to run extension":"Unable to run extension",
"Unable to run project":"Unable to run project",
"Unable to save file: {0}":"Unable to save file: {0}",
"Value":"Value",
"Verifying: {0}":"Verifying: {0}",
"VFS unknown handle: {0}":"VFS unknown handle: {0}"
}

View File

@ -356,6 +356,13 @@ namespace OS {
* @type {string[]}
*/
services: string[];
/**
* List of pinned applications
*
* @type {string[]}
*/
pinned: string[];
};
}
/**
@ -423,7 +430,7 @@ namespace OS {
setting.VFS = {
mountpoints: [
//TODO: multi app try to write to this object, it neet to be cloned
//TODO: multi app try to write to this object, it need to be cloned
{
text: "__(Applications)",
path: "app://",
@ -476,6 +483,7 @@ namespace OS {
startup: {
apps: [],
services: ["Syslog/PushNotification", "Syslog/Calendar"],
pinned: [],
},
};
}
@ -521,6 +529,55 @@ namespace OS {
SCOPES: "https://www.googleapis.com/auth/drive",
};
}
// default repo
if(!setting.system.repositories || setting.system.repositories.length === 0)
{
setting.system.repositories = [
{
text: "Github",
url: "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/packages.json"
}
]
}
setting.applications.categories = [
{
text: "__(Media)",
iconclass: "bi bi-disc"
},
{
text: "__(Development)",
iconclass: "bi bi-hammer"
},
{
text: "__(Education)",
iconclass: "fa fa-graduation-cap"
},
{
text: "__(Game)",
iconclass: "fa fa-gamepad"
},
{
text: "__(Graphics)",
iconclass: "bi bi-palette-fill"
},
{
text: "__(Internet)",
iconclass: "fa fa-globe"
},
{
text: "__(Office)",
iconclass: "bi bi-building"
},
{
text: "__(System)",
iconclass: "fa bi-gear-wide-connected"
},
{
text: "__(Utility)",
iconclass: "bi bi-tools"
},
]
}
// Register handle for application search
@ -530,7 +587,7 @@ namespace OS {
for (let k in setting.system.packages) {
const v = setting.system.packages[k];
if (v.app) {
var e, k1, v1;
var e: any, k1: string, v1: { [x: string]: any; detail?: any; path?: any; complex?: any; };
if (
v.name.match(term) ||
(v.description && v.description.match(term))

View File

@ -61,10 +61,10 @@ namespace OS {
* process in the dock
*
* @private
* @type {application.BaseApplication}
* @type {AppDockItemType}
* @memberof AppDockTag
*/
private _selectedApp: application.BaseApplication;
private _selectedItem: AppDockItemType;
/**
*Creates an instance of AppDockTag.
@ -83,7 +83,25 @@ namespace OS {
* @param {*} [d]
* @memberof AppDockTag
*/
protected reload(d?: any): void {}
protected reload(d?: any): void {
let app: application.BaseApplication = d as application.BaseApplication;
if(!app)
{
return;
}
let i = -1;
const iterable = this.items;
for (let k = 0; k < iterable.length; k++) {
const v = iterable[k];
if (v.app.pid === app.pid) {
i = k;
break;
}
}
if (i !== -1) {
$(this.items[i].domel).attr("tooltip", `cr:${app.title()}`);
}
}
/**
* Init the tag before mounting
@ -134,24 +152,39 @@ namespace OS {
* @memberof AppDockTag
*/
set selectedApp(v: application.BaseApplication) {
this._selectedApp = v;
let el = undefined;
for (let it of this.items) {
it.app.blur();
$(it.domel).removeClass();
if (v && v === it.app) {
el = it.domel;
el = it;
}
}
this._selectedItem = el;
if (!el) {
return;
}
$(el).addClass("selected");
$(el.domel).addClass("selected");
($(Ant.OS.GUI.workspace)[0] as FloatListTag).unselect();
}
get selectedApp(): application.BaseApplication {
return this._selectedApp;
if(!this._selectedItem)
return undefined;
return this._selectedItem.app;
}
/**
* Get selected item of the dock
*
* @readonly
* @type {AppDockItemType}
* @memberof AppDockTag
*/
get selectedItem(): AppDockItemType
{
return this._selectedItem;
}
/**
@ -171,8 +204,8 @@ namespace OS {
el[0].uify(this.observable);
bt.set(item);
bt.data = item.app;
el.attr("tooltip", `cr:${item.app.title()}`);
item.domel = bt;
$(bt).attr("tooltip", `cr:${item.app.title()}`);
bt.onbtclick = (e) => {
e.id = this.aid;
//e.data.item = item;
@ -222,8 +255,9 @@ namespace OS {
const bt = ($(e.target).closest(
"afx-button"
)[0] as any) as ButtonTag;
const app = bt.data;
const app = bt.data as application.BaseApplication;
m.items = [
{ text: "__(New window)", dataid: "new" },
{ text: "__(Show)", dataid: "show" },
{ text: "__(Hide)", dataid: "hide" },
{ text: "__(Close)", dataid: "quit" },
@ -233,10 +267,56 @@ namespace OS {
if (app[item.dataid]) {
return app[item.dataid]();
}
else
{
switch (item.dataid) {
case "new":
GUI.launch(app.name, []);
break;
default:
break;
}
}
};
return m.show(e);
};
announcer.trigger("sysdockloaded", undefined);
GUI.bindKey("CTRL-ALT-2", (e) =>{
if(!this.items || this.items.length === 0)
{
return;
}
let index = this.items.indexOf(this.selectedItem);
if(index < 0)
{
index = 0;
}
else
{
index++;
}
if(index >= this.items.length)
index = 0;
this.items[index].app.trigger("focus");
});
GUI.bindKey("CTRL-ALT-1", (e) =>{
if(!this.items || this.items.length === 0)
{
return;
}
let index = this.items.indexOf(this.selectedItem);
index--;
if(index < 0)
{
index = this.items.length - 1;
}
if(index < 0)
{
return;
}
this.items[index].app.trigger("focus");
});
}
}
define("afx-apps-dock", AppDockTag);

View File

@ -133,7 +133,7 @@ namespace OS {
* @memberof ButtonTag
*/
protected mount() {
$(this.refs.button).click((e) => {
$(this.refs.button).on("click", (e) => {
if (this.toggle) {
this.selected = !this.selected;
}

View File

@ -113,8 +113,8 @@ namespace OS {
* @memberof CalendarTag
*/
protected mount(): void {
$(this.refs.prev).click((e) => this.prevmonth());
$(this.refs.next).click((e) => this.nextmonth());
$(this.refs.prev).on("click",(e) => this.prevmonth());
$(this.refs.next).on("click",(e) => this.nextmonth());
const grid = this.refs.grid as GridViewTag;
grid.header = [
{ text: "__(Sun)" },

View File

@ -259,15 +259,15 @@ namespace OS {
);
};
$(this.refs.palette).mouseenter((e) => {
$(this.refs.palette).on("mouseenter",(e) => {
return $(this.refs.palette).on(
"mousemove",
mouse_move_h
);
});
$(this.refs.palette).mouseout((e) => {
$(this.refs.palette).unbind("mousemove", mouse_move_h);
$(this.refs.palette).on("mouseout", (e) => {
$(this.refs.palette).off("mousemove", mouse_move_h);
if (this.selectedColor) {
return $(this.refs.colorval).css(
"background-color",

View File

@ -184,8 +184,8 @@ namespace OS {
};
var mouse_up = function (e: JQuery.MouseEventBase) {
$(window).unbind("mousemove", mouse_move);
return $(window).unbind("mouseup", mouse_up);
$(window).off("mousemove", mouse_move);
return $(window).off("mouseup", mouse_up);
};
$(window).on("mousemove", mouse_move);
return $(window).on("mouseup", mouse_up);

View File

@ -237,11 +237,11 @@ namespace OS {
): void => {};
this.selected = false;
$(this).css("display", "block");
$(this).click((e) => {
$(this).on("click",(e) => {
let evt = { id: this.aid, data: this };
return this.cellselect(evt, false);
});
$(this).dblclick((e) => {
$(this).on("dblclick", (e) => {
let evt = { id: this.aid, data: this };
return this.cellselect(evt, true);
});

View File

@ -173,18 +173,18 @@ namespace OS {
*/
protected mount(): void {
$(this.refs.item).attr("dataref", "afx-list-item");
$(this.refs.item).contextmenu((e) => {
$(this.refs.item).on("contextmenu", (e) => {
this._onctxmenu({ id: this.aid, data: this });
});
$(this.refs.item).click((e) => {
$(this.refs.item).on("click",(e) => {
this._onclick({ id: this.aid, data: this });
});
$(this.refs.item).dblclick((e) => {
$(this.refs.item).on("dblclick",(e) => {
this._ondbclick({ id: this.aid, data: this });
});
$(this.refs.btcl).click((e) => {
$(this.refs.btcl).on("click",(e) => {
this._onclose({ id: this.aid, data: this });
e.preventDefault();
e.stopPropagation();
@ -788,7 +788,7 @@ namespace OS {
* @returns {ListViewItemTag} the added list item element
* @memberof ListViewTag
*/
unshift(item: GenericObject<any>) {
unshift(item: GenericObject<any>): ListViewItemTag {
return this.push(item, true);
}

View File

@ -191,7 +191,7 @@ namespace OS {
// ensure that the data is in sync
this._data.nodes = v;
if (this.is_root()) {
$(this.refs.container).mouseleave((e) => {
$(this.refs.container).on("mouseleave",(e) => {
return $(this.refs.submenu).attr("style", "");
});
}
@ -209,7 +209,7 @@ namespace OS {
* @memberof MenuEntryTag
*/
protected mount(): void {
$(this.refs.entry).click((e) => this.select(e));
$(this.refs.entry).on("click",(e) => this.select(e));
}
/**
@ -730,7 +730,7 @@ namespace OS {
if (!this.context) {
return;
}
$(this.refs.wrapper).mouseleave((e) => {
$(this.refs.wrapper).on("mouseleave",(e) => {
if (!this.is_root()) {
return;
}

View File

@ -81,11 +81,11 @@ namespace OS {
*/
protected mount(): void {
$(this.refs.holder).attr("type", "text");
$(this.refs.incr).click((e) => {
$(this.refs.incr).on("click",(e) => {
this.value = this.value + this.step;
});
$(this.refs.decr).click((e) => {
$(this.refs.decr).on("click",(e) => {
this.value = this.value - this.step;
});
@ -93,7 +93,7 @@ namespace OS {
this.observable.on("resize", () => this.calibrate());
$(this.refs.holder).on("keyup", (e) => {
if (e.keyCode === 13) {
if (e.which === 13) {
let val = parseInt(
(this.refs.holder as HTMLInputElement).value
);

View File

@ -104,7 +104,7 @@ namespace OS {
set dir(v: string) {
let att: string;
$(this).attr("dir", v);
$(this).unbind("mousedown", null);
$(this).off("mousedown", null);
if (v === "hz") {
$(this).css("cursor", "col-resize");
$(this).addClass("horizontal");
@ -222,10 +222,10 @@ namespace OS {
});
return $(window).on("mouseup", function (evt) {
$(window).unbind("mousemove", null);
$(window).unbind("mouseup", null);
$(window).off("mousemove", null);
$(window).off("mouseup", null);
return $(window).unbind("mouseup", null);
return $(window).off("mouseup", null);
});
});
}

View File

@ -110,15 +110,15 @@ namespace OS {
this.attsw(v, "enable");
if (v) {
$(this)
.mouseover(() => {
.on("mouseover",() => {
return $(this.refs.point).show();
})
.mouseout(() => {
.on("mouseout",() => {
return $(this.refs.point).hide();
});
} else {
$(this.refs.point).hide();
$(this).unbind("mouseover").unbind("mouseout");
$(this).off("mouseover").off("mouseout");
}
}
get enable(): boolean {
@ -168,7 +168,7 @@ namespace OS {
this.observable.on("resize", (e) => {
return this.calibrate();
});
$(this.refs.container).click((e) => {
$(this.refs.container).on("click",(e) => {
const offset = $(this.refs.container).offset();
const left = e.clientX - offset.left;
const maxw = $(this.refs.container).width();
@ -241,8 +241,8 @@ namespace OS {
id: this.aid,
data: this.value,
});
$(window).unbind("mousemove", null);
return $(window).unbind("mouseup", null);
$(window).off("mousemove", null);
return $(window).off("mouseup", null);
});
});
}

View File

@ -66,7 +66,7 @@ namespace OS {
* @memberof SwitchTag
*/
protected mount(): void {
$(this.refs.switch).click((e) => {
$(this.refs.switch).on("click",(e) => {
return this.makechange(e);
});
}

View File

@ -30,6 +30,21 @@ namespace OS {
*/
private _view: boolean;
/**
* Store pending loading task
*
* @private
* @type {number[]}
* @memberof SystemPanelTag
*/
private _pending_task: number[];
/**
* Loading animation check timeout
*
* @memberof SystemPanelTag
*/
private _loading_toh: any;
/**
* Place holder for a private callback function
*
@ -38,6 +53,16 @@ namespace OS {
*/
private _cb: (e: JQuery.MouseEventBase) => void;
/**
* Place holder for system app list
*
* @private
* @type {GenericObject<any>[]}
* @memberof SystemPanelTag
*/
private app_list: GenericObject<any>[];
/**
*Creates an instance of SystemPanelTag.
* @memberof SystemPanelTag
@ -49,6 +74,9 @@ namespace OS {
iconclass: "fa fa-circle",
};
this._view = false;
this._pending_task = [];
this._loading_toh = undefined;
this.app_list= [];
}
/**
@ -57,7 +85,7 @@ namespace OS {
* @protected
* @memberof SystemPanelTag
*/
protected init(): void {}
protected init(): void { }
/**
* Do nothing
@ -66,7 +94,7 @@ namespace OS {
* @param {*} [d]
* @memberof SystemPanelTag
*/
protected reload(d?: any): void {}
protected reload(d?: any): void { }
/**
* Attach a service to the system tray on the pannel,
@ -114,6 +142,7 @@ namespace OS {
*/
private search(e: JQuery.KeyboardEventBase): void {
const applist = this.refs.applist as ListViewTag;
const catlist = this.refs.catlist as ListViewTag;
switch (e.which) {
case 27:
// escape key
@ -133,10 +162,13 @@ namespace OS {
e.preventDefault();
return this.open();
default:
catlist.selected = 0;
var text = (this.refs.search as HTMLInputElement)
.value;
if (!(text.length >= 3)) {
return this.refreshAppList();
(this.refs.applist as ListViewTag).data = this.app_list;
(this.refs.applist as ListViewTag).selected = -1;
return;
}
var result = Ant.OS.API.search(text);
if (result.length === 0) {
@ -178,6 +210,11 @@ namespace OS {
ref: "osmenu",
class: "afx-panel-os-menu",
},
{
el: "afx-menu",
ref: "pinned",
class: "afx-panel-os-pinned-app",
},
{
el: "afx-menu",
id: "appmenu",
@ -210,9 +247,24 @@ namespace OS {
],
},
{
el: "afx-list-view",
id: "applist",
ref: "applist",
el: "afx-hbox",
children: [
{
el: "afx-list-view",
id: "catlist",
ref: "catlist",
width:"40%"
},
{
el: "afx-resizer",
width: 3,
},
{
el: "afx-list-view",
id: "applist",
ref: "applist",
}
]
},
{
el: "afx-hbox",
@ -252,19 +304,22 @@ namespace OS {
* @memberof SystemPanelTag
*/
private refreshAppList(): void {
let catlist_el = (this.refs.catlist as tag.ListViewTag);
let k: string, v: API.PackageMetaType;
const list = [];
const catlist = new Set();
this.app_list = [];
for (k in Ant.OS.setting.system.packages) {
v = Ant.OS.setting.system.packages[k];
if (v && v.app) {
list.push(v);
this.app_list.push(v);
catlist.add(v.category.__());
}
}
for (k in Ant.OS.setting.system.menu) {
v = Ant.OS.setting.system.menu[k];
list.push(v);
this.app_list.push(v);
}
list.sort(function (a, b) {
this.app_list.sort(function (a, b) {
if (a.text < b.text) {
return -1;
} else if (a.text > b.text) {
@ -273,7 +328,29 @@ namespace OS {
return 0;
}
});
(this.refs.applist as ListViewTag).data = list;
// build up the category menu
const cat_list_data = [];
cat_list_data.push({
text: "__(All)",
iconclass: "bi bi-gear-wide"
});
(OS.setting.applications.categories as Array<GenericObject<any>>)
.forEach((v) =>{
if(catlist.has(v.text.__()))
{
cat_list_data.push(v);
catlist.delete(v.text.__());
}
})
// put the remainder to the data
catlist.forEach((c) => {
cat_list_data.push({
text: c,
iconclass: "bi bi-gear-wide"
});
});
catlist_el.data = cat_list_data;
catlist_el.selected = 0;
}
/**
@ -292,10 +369,10 @@ namespace OS {
this.calibrate();
$(document).on("click", this._cb);
(this.refs.search as HTMLInputElement).value = "";
$(this.refs.search).focus();
$(this.refs.search).trigger("focus");
} else {
$(this.refs.overlay).hide();
$(document).unbind("click", this._cb);
$(document).off("click", this._cb);
}
}
@ -305,11 +382,55 @@ namespace OS {
* @memberof SystemPanelTag
*/
calibrate(): void {
(this.refs.overlay as OverlayTag).height = `${
$(window).height() - $(this.refs.panel).height()
}px`;
(this.refs.overlay as OverlayTag).height = `${$(window).height() - $(this.refs.panel).height()
}px`;
}
/**
* Refresh the pinned applications menu
*
* @private
* @memberof SystemPanelTag
*/
private RefreshPinnedApp(): void
{
if(!setting.system.startup.pinned)
return;
(this.refs.pinned as GUI.tag.MenuTag).items =
setting.system.startup.pinned
.filter((el) =>{
const app = setting.system.packages[el];
return app && app.app
})
.map((name) => {
const app = setting.system.packages[name];
return {
icon: app.icon,
iconclass: app.iconclass,
app: app.app,
tooltip: `cb:${app.name}`
};
});
}
/**
* Check if the loading tasks ended,
* if it the case, stop the animation
*
* @private
* @memberof SystemPanelTag
*/
private animation_check(): void {
if(this._pending_task.length === 0)
{
$(this.refs.panel).removeClass("loading");
$(GUI.workspace).css("cursor", "auto");
}
if(this._loading_toh)
clearTimeout(this._loading_toh);
this._loading_toh = undefined;
}
/**
* Mount the tag bind some basic event
*
@ -325,7 +446,7 @@ namespace OS {
) {
return this.toggle(false);
} else {
return $(this.refs.search).focus();
return $(this.refs.search).trigger("focus");
}
};
$(this.refs.appmenu).css("z-index", 1000000);
@ -358,11 +479,11 @@ namespace OS {
return this.toggle(true);
};
$(this.refs.search).keyup((e) => {
$(this.refs.search).on("keyup", (e) => {
return this.search(e);
});
$(this.refs.applist).click((e) => {
$(this.refs.applist).on("click", (e) => {
return this.open();
});
Ant.OS.GUI.bindKey("CTRL- ", (e) => {
@ -372,12 +493,72 @@ namespace OS {
return this.toggle(false);
}
});
Ant.OS.announcer.trigger("syspanelloaded", undefined);
const catlist = (this.refs.catlist as tag.ListViewTag);
catlist.onlistselect = (e) => {
const applist = (this.refs.applist as ListViewTag);
if(catlist.selected === 0)
{
applist.data = this.app_list;
}
else
{
// filter app by data
applist.data = this.app_list.filter((el) =>{
return el.category.__() === e.data.item.data.text.__();
})
}
applist.selected = -1;
};
$(this.refs.overlay)
.css("left", 0)
.css("top", `${$(this.refs.panel).height()}px`)
.css("bottom", "0")
.hide();
(this.refs.pinned as GUI.tag.MenuTag).onmenuselect = (e) => {
const app = e.data.item.data.app;
if(!app)
return;
GUI.launch(app, []);
};
this.refs.appmenu.contextmenuHandle = (e, m) => { }
this.refs.osmenu.contextmenuHandle = (e, m) => { }
this.refs.systray.contextmenuHandle = (e, m) => { }
this.refs.pinned.contextmenuHandle = (e, m) => { }
this.refs.panel.contextmenuHandle = (e, m) => {
let menu = [
{ text: __("Applications and services setting"), dataid: "app&srv" }
];
m.items = menu;
m.onmenuselect = function (
evt: TagEventType<tag.MenuEventData>
) {
GUI.launch("Setting",[]);
}
m.show(e);
};
announcer.observable.on("app-pinned", (d) => {
this.RefreshPinnedApp();
});
announcer.observable.on("loading", (o) => {
this._pending_task.push(o.id);
if(!$(this.refs.panel).hasClass("loading"))
$(this.refs.panel).addClass("loading");
$(GUI.workspace).css("cursor", "wait");
});
announcer.observable.on("loaded", (o) => {
const i = this._pending_task.indexOf(o.id);
if (i >= 0) {
this._pending_task.splice(i, 1);
}
if (this._pending_task.length === 0) {
// set time out
if(!this._loading_toh)
this._loading_toh = setTimeout(() => this.animation_check(),1000);
}
});
this.RefreshPinnedApp();
Ant.OS.announcer.trigger("syspanelloaded", undefined);
}
}

View File

@ -377,10 +377,10 @@ namespace OS {
.css("margin", 0)
.css("white-space", "nowrap");
$(this.refs.itemholder).css("display", "inline-block");
$(this.refs.wrapper).click((e) => {
$(this.refs.wrapper).on("click",(e) => {
this.selected = true;
});
$(this.refs.wrapper).dblclick((e) => {
$(this.refs.wrapper).on("dblclick", (e) => {
this._evt.data.dblclick = true;
this.selected = true;
});
@ -389,7 +389,7 @@ namespace OS {
.css("display", "inline-block")
.css("width", "15px")
.addClass("afx-tree-view-item")
.click((e) => {
.on("click",(e) => {
this.open = !this.open;
e.preventDefault();
return e.stopPropagation();

View File

@ -189,9 +189,13 @@ namespace OS {
if (v) {
$(this.refs["maxbt"]).show();
$(this.refs["grip"]).show();
$(this.refs["grip_bottom"]).show();
$(this.refs["grip_right"]).show();
} else {
$(this.refs["maxbt"]).hide();
$(this.refs["grip"]).hide();
$(this.refs["grip_bottom"]).hide();
$(this.refs["grip_right"]).hide();
}
}
get resizable(): boolean {
@ -209,6 +213,7 @@ namespace OS {
$(this).attr("apptitle", v.__());
if (v) {
(this.refs["txtTitle"] as LabelTag).text = v;
this.observable.trigger("apptitlechange", this);
}
}
get apptitle(): string | FormattedString {
@ -241,17 +246,17 @@ namespace OS {
*/
protected mount(): void {
this.contextmenuHandle = function (e) {};
$(this.refs["minbt"]).click((e) => {
$(this.refs["minbt"]).on("click",(e) => {
return this.observable.trigger("hide", {
id: this.aid,
});
});
$(this.refs["maxbt"]).click((e) => {
$(this.refs["maxbt"]).on("click",(e) => {
return this.toggle_window();
});
$(this.refs["closebt"]).click((e) => {
$(this.refs["closebt"]).on("click",(e) => {
return this.observable.trigger("exit", {
id: this.aid,
});
@ -272,7 +277,7 @@ namespace OS {
});
});
$(this.refs["dragger"]).dblclick((e) => {
$(this.refs["dragger"]).on("dblclick",(e) => {
return this.toggle_window();
});
@ -356,6 +361,7 @@ namespace OS {
offset.top = e.clientY - offset.top;
offset.left = e.clientX - offset.left;
$(window).on("mousemove", (e) => {
$(this.refs.win_overlay).show();
let left: number, top: number;
if (this._isMaxi) {
this.toggle_window();
@ -380,9 +386,10 @@ namespace OS {
.css("top", `${top}px`)
.css("left", `${left}px`);
});
return $(window).on("mouseup", function (e) {
$(window).unbind("mousemove", null);
return $(window).unbind("mouseup", null);
return $(window).on("mouseup", (e) => {
$(this.refs.win_overlay).hide();
$(window).off("mousemove", null);
return $(window).off("mouseup", null);
});
});
}
@ -395,37 +402,57 @@ namespace OS {
* @memberof WindowTag
*/
private enable_resize(): void {
$(this.refs["grip"])
.css("user-select", "none")
.css("cursor", "default")
.css("position", "absolute")
.css("bottom", "0")
.css("right", "0")
.css("cursor", "nwse-resize");
$(this.refs["grip"]).on("mousedown", (e) => {
e.preventDefault();
const offset = { top: 0, left: 0 };
const offset = { top: 0, left: 0 };
let target = undefined;
const mouse_move_hdl = (e) => {
let w = $(this).width();
let h = $(this).height();
$(this.refs.win_overlay).show();
if(target != this.refs.grip_bottom)
{
w += e.clientX - offset.left;
}
if(target != this.refs.grip_right)
{
h += e.clientY - offset.top;
}
w = w < 100 ? 100 : w;
h = h < 100 ? 100 : h;
offset.top = e.clientY;
offset.left = e.clientX;
$(window).on("mousemove", (e) => {
let w = $(this).width() + e.clientX - offset.left;
let h = $(this).height() + e.clientY - offset.top;
w = w < 100 ? 100 : w;
h = h < 100 ? 100 : h;
offset.top = e.clientY;
offset.left = e.clientX;
this._isMaxi = false;
this.setsize({ w, h });
});
$(window).on("mouseup", function (e) {
$(window).unbind("mousemove", null);
return $(window).unbind("mouseup", null);
});
this._isMaxi = false;
this.setsize({ w, h });
}
const mouse_up_hdl = (e) => {
$(this.refs.win_overlay).hide();
$(window).off("mousemove", mouse_move_hdl);
return $(window).off("mouseup", mouse_up_hdl);
}
$(this.refs["grip"]).on("mousedown", (e) => {
e.preventDefault();
offset.top = e.clientY;
offset.left = e.clientX;
target = this.refs.grip;
$(window).on("mousemove", mouse_move_hdl);
$(window).on("mouseup", mouse_up_hdl);
});
$(this.refs.grip_bottom).on("mousedown", (e) => {
e.preventDefault();
offset.top = e.clientY;
offset.left = e.clientX;
target = this.refs.grip_bottom;
$(window).on("mousemove", mouse_move_hdl);
$(window).on("mouseup", mouse_up_hdl);
});
$(this.refs.grip_right).on("mousedown", (e) => {
e.preventDefault();
offset.top = e.clientY;
offset.left = e.clientX;
target = this.refs.grip_right;
$(window).on("mousemove", mouse_move_hdl);
$(window).on("mouseup", mouse_up_hdl);
});
}
/**
* Maximize the window or restore its previous width, height,
* and position
@ -520,6 +547,21 @@ namespace OS {
ref: "grip",
class: "afx-window-grip",
},
{
el: "div",
ref: "grip_bottom",
class: "afx-window-grip-bottom",
},
{
el: "div",
ref: "grip_right",
class: "afx-window-grip-right",
},
{
el: "div",
ref: "win_overlay",
class: "afx-window-overlay",
},
],
},
];

View File

@ -159,19 +159,19 @@ namespace OS {
* `data-width` of the element, not to be confused with
* the `width` attribute of the DOM element
*
* @type {number}
* @type {number|string}
* @memberof TagLayoutType
*/
width?: number;
width?: number|string;
/**
** `data-height` of the element, not to be confused with
* the `height` attribute of the DOM element
*
* @type {number}
* @type {number|string}
* @memberof TagLayoutType
*/
height?: number;
height?: number|string;
}
/**

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
//along with this program. If not, see https://www.gnu.org/licenses/.
type VFSFileHandleClass = { new (...args: any[]): OS.API.VFS.BaseFileHandle };
type VFSFileHandleClass = { new(...args: any[]): OS.API.VFS.BaseFileHandle };
interface String {
/**
* Convert a string to VFS file handle.
@ -164,6 +164,8 @@ namespace OS {
* AntOS Virtual File System (VFS)
*/
export namespace VFS {
declare var JSZip: any;
String.prototype.asFileHandle = function (): BaseFileHandle {
const list = this.split("://");
const handles = API.VFS.findHandles(list[0]);
@ -353,7 +355,8 @@ namespace OS {
if (re === "") {
return;
}
this.genealogy = re.split("/");
this.genealogy = re.split("/").filter(s=> s!="");
this.path = `${this.protocol}://${this.genealogy.join("/")}`;
if (!this.isRoot()) {
this.basename = this.genealogy[
this.genealogy.length - 1
@ -1083,26 +1086,22 @@ namespace OS {
} else {
try {
const r = await this.b64(t);
try {
const result = await API.handle.write(
this.path,
r as string
);
if (result.error) {
return reject(
API.throwe(
__(
"{0}: {1}",
result.error,
this.path
)
const result = await API.handle.write(
this.path,
r as string
);
if (result.error) {
return reject(
API.throwe(
__(
"{0}: {1}",
result.error,
this.path
)
);
}
return resolve(result);
} catch (e_1) {
return reject(__e(e_1));
)
);
}
return resolve(result);
} catch (e_2) {
return reject(__e(e_2));
}
@ -1316,8 +1315,7 @@ namespace OS {
* @class PackageFileHandle
* @extends {RemoteFileHandle}
*/
export class PackageFileHandle extends RemoteFileHandle
{
export class PackageFileHandle extends RemoteFileHandle {
/**
*Creates an instance of PackageFileHandle.
@ -1325,12 +1323,11 @@ namespace OS {
* @memberof PackageFileHandle
*/
constructor(pkg_path: string) {
var error:FormattedString|string;
var error: FormattedString | string;
var pkg_name: string;
super(pkg_path);
// now find the correct path
if(!this.genealogy || this.genealogy.length == 0)
{
if (!this.genealogy || this.genealogy.length == 0) {
error = __("Invalid package path");
announcer.oserror(error, API.throwe(error));
throw new Error(error.__());
@ -1338,14 +1335,12 @@ namespace OS {
else {
// get the correct path of the package
pkg_name = this.genealogy.shift();
if(OS.setting.system.packages[pkg_name])
{
if (OS.setting.system.packages[pkg_name]) {
this.setPath(OS.setting.system.packages[pkg_name].path + "/" + this.genealogy.join("/"));
}
else
{
else {
error = __("Package not found {0}", pkg_name);
announcer.oserror(error,API.throwe(error));
announcer.oserror(error, API.throwe(error));
throw new Error(error.__());
}
}
@ -1427,8 +1422,7 @@ namespace OS {
const result = [];
for (let k in OS.setting.system.packages) {
const v = OS.setting.system.packages[k];
if(v.app)
{
if (v.app) {
result.push(v);
}
}
@ -1599,7 +1593,7 @@ namespace OS {
//read the file
if (t === "binary") {
//return API.handle.fileblob(this.path);
return API.blob(this.path+ "?_=" + new Date().getTime());
return API.blob(this.path + "?_=" + new Date().getTime());
}
return API.get(this.path, t ? t : "text");
}
@ -1760,6 +1754,355 @@ namespace OS {
}
API.VFS.register("^shared$", SharedFileHandle);
/**Utilities global functions */
/**
* Read a file content from a zip archive
*
* The content type should be:
* - base64 : the result will be a string, the binary in a base64 form.
* - text (or string): the result will be an unicode string.
* - binarystring: the result will be a string in binary form, using 1 byte per char (2 bytes).
* - array: the result will be an Array of bytes (numbers between 0 and 255).
* - uint8array : the result will be a Uint8Array. This requires a compatible browser.
* - arraybuffer : the result will be a ArrayBuffer. This requires a compatible browser.
* - blob : the result will be a Blob. This requires a compatible browser. *
* If file_name is not specified, the first file_name in the zip archive will be read
* @export
* @param {string} file zip file
* @param {string} type content type to read
* @param {string} [file_name] the file should be read from the zip archive
* @return {*} {Promise<any>}
*/
export function readFileFromZip(file: string, type: string, file_name?: string): Promise<any> {
return new Promise(async (resolve, reject) => {
try {
await API.requires("os://scripts/jszip.min.js");
const data = await file.asFileHandle().read("binary");
const zip = await JSZip.loadAsync(data);
if (!file_name) {
for (let name in zip.files) {
file_name = name;
break;
}
}
const udata = await zip.file(file_name).async(type);
resolve(udata);
} catch (e) {
return reject(__e(e));
}
});
}
/**
* Cat all files to a single out-put
*
* @export
* @param {string[]} list list of VFS files
* @param {string} data input data string that will be cat to the files content
* @param {string} join_by join on files content by this string
* @return {*} {Promise<string>}
*/
export function cat(list: string[], data: string, join_by: string = "\n"): Promise<string> {
return new Promise(async (resolve, reject) => {
if (list.length === 0) {
return resolve(data);
}
const promises = [];
for (const file of list) {
promises.push(file.asFileHandle().read("text"));
}
try {
const results = await Promise.all(promises);
resolve(`${data}${join_by}${results.join(join_by)}`);
} catch (error) {
reject(__e(error));
}
});
}
/**
* Read all files content on the list
*
* @export
* @param {string[]} list list of VFS files
* @param {GenericObject<string>[]} contents content array
* @return {void}
*/
export function read_files(list: string[]): Promise<GenericObject<string>[]> {
const promises = [];
for (const file of list) {
promises.push(file.asFileHandle().read("text"));
}
return Promise.all(promises);
}
/**
* Copy files to a folder
*
* @export
* @param {string[]} files list of files
* @param {string} to destination folder
* @return {*} {Promise<any[]>}
*/
export function copy(files: string[], to: string): Promise<any[]> {
const promises = [];
for (const path of files) {
promises.push(new Promise(async (resolve, reject) => {
try {
const file = path.asFileHandle();
const tof = `${to}/${file.basename}`.asFileHandle();
const meta = await file.onready();
if (meta.type === "dir") {
const desdir = to.asFileHandle();
await desdir.mk(file.basename);
const ret = await file.read();
const files = ret.result.map((v: API.FileInfoType) => v.path);
if (files.length > 0) {
await copy(files, `${desdir.path}/${file.basename}`);
resolve(undefined);
}
else {
resolve(undefined);
}
}
else {
const content = await file.read("binary");
await tof
.setCache(
new Blob([content], {
type: file.info.mime,
}))
.write(file.info.mime);
resolve(undefined);
}
} catch (error) {
reject(__e(error));
}
}));
}
return Promise.all(promises);
}
/**
* Add a list of files to the zip archive
*
* @param {string[]} list list of VFS files
* @param {*} zip JSZip handle
* @param {string} base root path of all added files in the zip
* @return {*} {Promise<any>}
*/
function aradd(list: string[], zip: any, base: string): Promise<any> {
const promises = [];
for (const path of list) {
promises.push(new Promise(async (resolve, reject) => {
const file = path.asFileHandle();
try {
const meta = await file.asFileHandle().onready();
if (meta.type == "dir") {
const ret = await file.read();
const dirs: string[] = ret.result.map((v: API.FileInfoType) => v.path);
if (dirs.length > 0) {
await aradd(dirs, zip, `${base}${file.basename}/`);
resolve(undefined);
}
else {
resolve(undefined);
}
}
else {
const u_data = await file.read("binary");
const z_path = `${base}${file.basename}`.replace(
/^\/+|\/+$/g,
""
);
zip.file(z_path, u_data, { binary: true });
resolve(undefined);
}
} catch (error) {
reject(__e(error));
}
}));
}
return Promise.all(promises);
}
/**
* Create a zip archive from a folder
*
* @export
* @param {string} src source file/folder
* @param {string} dest destination archive
* @return {*} {Promise<void>}
*/
export function mkar(src: string, dest: string): Promise<void> {
return new Promise(async (resolve, reject) => {
try {
await API.requires("os://scripts/jszip.min.js");
const zip = new JSZip();
const fhd = src.asFileHandle();
const meta = await fhd.onready();
if(meta.type === "file")
{
await aradd([src], zip, "/");
}
else
{
const ret = await fhd.read();
await aradd(
ret.result.map((v: API.FileInfoType) => v.path), zip, "/");
}
const z_data = await zip.generateAsync({ type: "base64" });
await dest.asFileHandle()
.setCache("data:application/zip;base64," + z_data)
.write("base64");
resolve();
} catch (error) {
reject(__e(error));
}
});
}
/**
* Create a list of directories
*
* @export
* @param {string[]} list of directories to be created
* @param {boolen} sync sync/async of directory creation
* @return {*} {Promise<any>}
*/
export function mkdirAll(list: string[], sync?: boolean): Promise<any> {
if (!sync) {
const promises = [];
for (const dir of list) {
const path = dir.asFileHandle()
promises.push(path.parent().mk(path.basename));
}
return Promise.all(promises);
}
else {
return new Promise(async (resolve, reject) => {
try {
if (list.length === 0) {
return resolve(true);
}
const dir = list.splice(0, 1)[0].asFileHandle();
const path = dir.parent();
const dname = dir.basename;
const r = await path.asFileHandle().mk(dname);
if (r.error) {
return reject(
this._api.throwe(
__(
"Cannot create {0}",
`${path}/${dir}`
)
)
);
}
await mkdirAll(list, sync);
resolve(true);
}
catch (e) {
reject(__e(e));
}
});
}
}
/**
*
*
* @export Extract a zip fle
* @param {string} zfile zip file to extract
* @param {(zip:any) => Promise<string>} [dest_callback] a callback to get extraction destination
* @return {*} {Promise<void>}
*/
export function extractZip(zfile: string | API.VFS.BaseFileHandle, dest_callback: (zip: any) => Promise<string>): Promise<void> {
return new Promise(async (resolve, reject) => {
try {
await API.requires("os://scripts/jszip.min.js");
const data = await zfile.asFileHandle().read("binary");
const zip = await JSZip.loadAsync(data);
const to = await dest_callback(zip);
const dirs = [];
const files = [];
for (const name in zip.files) {
const file = zip.files[name];
if (file.dir) {
dirs.push(to + "/" + name);
} else {
files.push(name);
}
}
await mkdirAll(dirs, true);
const promises = [];
for (const file of files) {
promises.push(new Promise(async (res, rej) => {
try {
const data = await zip.file(file).async("uint8array");
const path = `${to}/${file}`;
const fp = path.asFileHandle();
fp.cache = new Blob([data], { type: "octet/stream" });
const r = await fp.write("text/plain");
if (r.error) {
return rej(
API.throwe(
__("Cannot extract file to {0}", path)
)
);
}
return res(path);
} catch (error) {
rej(__e(error));
}
}));
}
await Promise.all(promises);
resolve();
} catch (e) {
return reject(__e(e));
}
});
}
/**
* Make files from a set of template files
*
* @export
* @param {Array<string[]>} list mapping paths between templates files and created files
* @param {string} path files destination
* @param {(data: string) => string} callback: pre-processing files content before writing to destination files
* @return {*} {Promise<any[]>}
*/
export function mktpl(
list: Array<string[]>,
path: string,
callback: (data: string) => string
): Promise<any[]> {
const promises = [];
for (const tpl of list) {
promises.push(new Promise(async (resolve, reject) => {
try {
const data = await `${path}/${tpl[0]}`.asFileHandle().read();
const file = tpl[1].asFileHandle();
file.setCache(callback(data));
await file.write("text/plain");
resolve(undefined);
} catch (error) {
reject(__e(error));
}
}));
}
return Promise.all(promises);
}
}
}
}

View File

@ -25,10 +25,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="resources/themes/system/system.css" rel="stylesheet">
<link id="ostheme" rel="stylesheet" href="">
<script src="scripts/jquery-3.2.1.min.js"></script>
<script src="scripts/jquery-3.4.1.min.js"></script>
<script src="scripts/antos.js"></script>
</head>
<body>
<div id="wrapper" />
<div id="wrapper" ></div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=0,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P=[],H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.replace(/^\s*/,""))},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="</"&&(_&&!l&&N<1&&N++,M&&(N=1),w=1,_=!1)):i(s,"tag-close")?O=!1:i(s,"comment.start")?_=!0:i(s,"comment.end")&&(_=!1),!O&&!N&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&N++,T!==x&&(N=T,x&&(N-=x));if(N){j();for(;N>0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),d.match(/^(,)$/)&&S>0&&E===0?N++:(h=!0,l=!1)):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m<g&&(b=D[m]);g=m,y=b,w&&(b-=w),A&&!E&&(b++,A=!1);for(L=0;L<b;L++)p+=o}s.type==="keyword"&&d.match(/^(case|default)$/)&&(P[m]=d,m++),s.type==="keyword"&&d.match(/^(break)$/)&&P[m-1]&&P[m-1].match(/^(case|default)$/)&&m--,s.type==="paren.lparen"&&(E+=(d.match(/\(/g)||[]).length,S+=(d.match(/\{/g)||[]).length,m+=d.length),s.type==="keyword"&&d.match(/^(if|else|elseif|for|while)$/)?(A=!0,E=0):!E&&d.trim()&&s.type!=="comment"&&(A=!1);if(s.type==="paren.rparen"){E-=(d.match(/\)/g)||[]).length,S-=(d.match(/\}/g)||[]).length;for(L=0;L<d.length;L++)m--,d.substr(L,1)==="}"&&P[m]==="case"&&m--}s.type=="text"&&(d=d.replace(/\s+$/," ")),c&&!l&&(B(),p.substr(-1)!=="\n"&&(p+=" ")),p+=d,h&&(p+=" "),l=!1,c=!1,h=!1;if(i(s,"tag-close")&&(_||a.indexOf(v)!==-1)||i(s,"doctype")&&d===">")_&&f&&f.value==="</"?N=-1:N=1;i(s,"tag-open")&&d==="</"?m--:i(s,"tag-open")&&d==="<"&&u.indexOf(f.value)===-1?m++:i(s,"tag-name")?v=d:i(s,"tag-close")&&d==="/>"&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}); (function() {
window.require(["ace/ext/beautify"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e){var t=e.$textLayer,n=t.$lenses;n&&n.forEach(function(e){e.remove()}),t.$lenses=null}function a(e,t){var n=e&t.CHANGE_LINES||e&t.CHANGE_FULL||e&t.CHANGE_SCROLL||e&t.CHANGE_TEXT;if(!n)return;var r=t.session,i=t.session.lineWidgets,s=t.$textLayer,a=s.$lenses;if(!i){a&&u(t);return}var f=t.$textLayer.$lines.cells,l=t.layerConfig,c=t.$padding;a||(a=s.$lenses=[]);var h=0;for(var p=0;p<f.length;p++){var d=f[p].row,v=i[d],m=v&&v.lenses;if(!m||!m.length)continue;var g=a[h];g||(g=a[h]=o.buildDom(["div",{"class":"ace_codeLens"}],t.container)),g.style.height=l.lineHeight+"px",h++;for(var y=0;y<m.length;y++){var b=g.childNodes[2*y];b||(y!=0&&g.appendChild(o.createTextNode("\u00a0|\u00a0")),b=o.buildDom(["a"],g)),b.textContent=m[y].title,b.lensCommand=m[y]}while(g.childNodes.length>2*y-1)g.lastChild.remove();var w=t.$cursorLayer.getPixelPosition({row:d,column:0},!0).top-l.lineHeight*v.rowsAbove-l.offset;g.style.top=w+"px";var E=t.gutterWidth,S=r.getLine(d).search(/\S|$/);S==-1&&(S=0),E+=S*l.characterWidth,E-=t.scrollLeft,g.style.paddingLeft=c+E+"px"}while(h<a.length)a.pop().remove()}function f(e){if(!e.lineWidgets)return;var t=e.widgetManager;e.lineWidgets.forEach(function(e){e&&e.lenses&&t.removeLineWidget(e)})}function l(e){e.codeLensProviders=[],e.renderer.on("afterRender",a),e.$codeLensClickHandler||(e.$codeLensClickHandler=function(t){var n=t.target.lensCommand;n&&e.execCommand(n.id,n.arguments)},i.addListener(e.container,"click",e.$codeLensClickHandler,e)),e.$updateLenses=function(){function o(){var r=n.selection.cursor,i=n.documentToScreenRow(r);t.setLenses(n,s);var o=n.$undoManager&&n.$undoManager.$lastDelta;if(o&&o.action=="remove"&&o.lines.length>1)return;var u=n.documentToScreenRow(r),a=e.renderer.layerConfig.lineHeight,f=n.getScrollTop()+(u-i)*a;n.setScrollTop(f)}var n=e.session;if(!n)return;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var i=e.codeLensProviders.length,s=[];e.codeLensProviders.forEach(function(e){e.provideCodeLenses(n,function(e,t){if(e)return;t.forEach(function(e){s.push(e)}),i--,i==0&&o()})})};var n=s.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){n.delay(250)},e.on("input",e.$updateLensesOnInput)}function c(e){e.off("input",e.$updateLensesOnInput),e.renderer.off("afterRender",a),e.$codeLensClickHandler&&e.container.removeEventListener("click",e.$codeLensClickHandler)}var r=e("../line_widgets").LineWidgets,i=e("../lib/event"),s=e("../lib/lang"),o=e("../lib/dom");t.setLenses=function(e,t){var n=Number.MAX_VALUE;f(e),t&&t.forEach(function(t){var r=t.start.row,i=t.start.column,s=e.lineWidgets&&e.lineWidgets[r];if(!s||!s.lenses)s=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:r,column:i,lenses:[]});s.lenses.push(t.command),r<n&&(n=r)}),e._emit("changeFold",{data:{start:{row:n}}})},t.registerCodeLensProvider=function(e,t){e.setOption("enableCodeLens",!0),e.codeLensProviders.push(t),e.$updateLensesOnInput()},t.clear=function(e){t.setLenses(e,null)};var h=e("../editor").Editor;e("../config").defineOptions(h.prototype,"editor",{enableCodeLens:{set:function(e){e?l(this):c(this)}}}),o.importCssString(".ace_codeLens { position: absolute; color: #aaa; font-size: 88%; background: inherit; width: 100%; display: flex; align-items: flex-end; pointer-events: none;}.ace_codeLens > a { cursor: pointer; pointer-events: auto;}.ace_codeLens > a:hover { color: #0000ff; text-decoration: underline;}.ace_dark > .ace_codeLens > a:hover { color: #4e94ce;}","")}); (function() {
window.require(["ace/ext/code_lens"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}); (function() {
window.require(["ace/ext/elastic_tabstops_lite"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
; (function() {
window.require(["ace/ext/error_marker"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,r){function o(e){e.keyCode===27&&u()}function u(){if(!i)return;document.removeEventListener("keydown",o),i.parentNode.removeChild(i),t&&t.focus(),i=null,r&&r()}function a(e){s=e,e&&(i.style.pointerEvents="none",n.style.pointerEvents="auto")}var i=document.createElement("div"),s=!1;return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(t?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",function(e){s||u()}),document.addEventListener("keydown",o),n.addEventListener("click",function(e){e.stopPropagation()}),i.appendChild(n),document.body.appendChild(i),t&&t.blur(),{close:u,setIgnoreFocusOut:a}}}),define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s)}}var r=e("../editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}); (function() {
window.require(["ace/ext/keybinding_menu"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("../editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1}); (function() {
window.require(["ace/ext/linking"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}); (function() {
window.require(["ace/ext/modelist"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";function s(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function o(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function u(e,t){var n=t.session;n.$bidiHandler.currentRow=null;if(n.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var r=e.start.row;r<e.end.row;r++)n.getLine(r+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[r+1]=n.$bidiHandler.RLE+n.getLine(r+1))}function a(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function f(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",u),this.on("changeSelection",s),this.renderer.on("afterRender",a),this.commands.on("exec",o),this.commands.addCommands(r)):(this.off("change",u),this.off("changeSelection",s),this.renderer.off("afterRender",a),this.commands.off("exec",o),this.commands.removeCommands(r),f(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){this.session.$bidiHandler.$isRtl=e,e?(this.setOption("rtlText",!1),this.renderer.on("afterRender",a),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",a),f(this.renderer)),this.renderer.updateFull()}}})}); (function() {
window.require(["ace/ext/rtl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}); (function() {
window.require(["ace/ext/spellcheck"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),t.Split=f}),define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}); (function() {
window.require(["ace/ext/split"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";function f(e){this.type=e,this.style={},this.textContent=""}var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;contain: none;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=e("../lib/lang").escapeHTML;f.prototype.cloneNode=function(){return this},f.prototype.appendChild=function(e){this.textContent+=e.toString()},f.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")};var l={createTextNode:function(e,t){return a(e)},createElement:function(e){return new f(e)},createFragment:function(){return new f("fragment")}},c=function(){this.config={},this.dom=l};c.prototype=i.prototype;var h=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var c=e.childNodes[l];c.nodeType==3?(f+=c.data.length,o+=c.data):a.push(f,c)}}else o=e.textContent,t.trim&&(o=o.trim());h.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};h.render=function(e,t,n,i,s,u){function c(){var r=h.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||c()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||c()})),--a||c()},h.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new c;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=l.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var f=u.getLength(),h=l.createElement("div");h.className=n.cssClass;var p=l.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<f;d++){var v=l.createElement("div");v.className="ace_line";if(!o){var m=l.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),v.textContent+="\n",p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=h,n.exports.highlight=h}); (function() {
window.require(["ace/ext/static_highlight"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}); (function() {
window.require(["ace/ext/statusbar"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/ext/themelist",["require","exports","module"],function(e,t,n){"use strict";var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["Xcode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Nord Dark","nord_dark","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}); (function() {
window.require(["ace/ext/themelist"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]}); (function() {
window.require(["ace/ext/whitespace"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["zupfnoter.information.comment.line.percentage","information.keyword","in formation.keyword.embedded"],regex:"(%%%%)(hn\\.[a-z]*)(.*)",comment:"Instruction Comment"},{token:["information.comment.line.percentage","information.keyword.embedded"],regex:"(%%)(.*)",comment:"Instruction Comment"},{token:"comment.line.percentage",regex:"%.*",comment:"Comments"},{token:"barline.keyword.operator",regex:"[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+",comment:"Bar lines"},{token:["information.keyword.embedded","information.argument.string.unquoted"],regex:"(\\[[A-Za-z]:)([^\\]]*\\])",comment:"embedded Header lines"},{token:["information.keyword","information.argument.string.unquoted"],regex:"^([A-Za-z]:)([^%\\\\]*)",comment:"Header lines"},{token:["text","entity.name.function","string.unquoted","text"],regex:"(\\[)([A-Z]:)(.*?)(\\])",comment:"Inline fields"},{token:["accent.constant.language","pitch.constant.numeric","duration.constant.numeric"],regex:"([\\^=_]*)([A-Ga-gz][,']*)([0-9]*/*[><0-9]*)",comment:"Notes"},{token:"zupfnoter.jumptarget.string.quoted",regex:'[\\"!]\\^\\:.*?[\\"!]',comment:"Zupfnoter jumptarget"},{token:"zupfnoter.goto.string.quoted",regex:'[\\"!]\\^\\@.*?[\\"!]',comment:"Zupfnoter goto"},{token:"zupfnoter.annotation.string.quoted",regex:'[\\"!]\\^\\!.*?[\\"!]',comment:"Zupfnoter annoation"},{token:"zupfnoter.annotationref.string.quoted",regex:'[\\"!]\\^\\#.*?[\\"!]',comment:"Zupfnoter annotation reference"},{token:"chordname.string.quoted",regex:'[\\"!]\\^.*?[\\"!]',comment:"abc chord"},{token:"string.quoted",regex:'[\\"!].*?[\\"!]',comment:"abc annotation"}]},this.normalizeRules()};s.metaData={fileTypes:["abc"],name:"ABC",scopeName:"text.abcnotation"},r.inherits(s,i),t.ABCHighlightRules=s}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./abc_highlight_rules").ABCHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.$id="ace/mode/abc",this.snippetFileId="ace/snippets/abc"}.call(u.prototype),t.Mode=u}); (function() {
window.require(["ace/mode/abc"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|body|private|then|if|procedure|type|case|in|protected|constant|interface|until||is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.AdaHighlightRules=s}),define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ada_highlight_rules").AdaHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*(begin|loop|then|is|do)\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){var r=t+n;return r.match(/^\s*(begin|end)$/)?!0:!1},this.autoOutdent=function(e,t,n){var r=t.getLine(n),i=t.getLine(n-1),s=this.$getIndent(i).length,u=this.$getIndent(r).length;if(u<=s)return;t.outdentRows(new o(n,0,n+2,0))},this.$id="ace/mode/ada"}.call(u.prototype),t.Mode=u}); (function() {
window.require(["ace/mode/ada"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="for|search|outbound|inbound|any|graph|prune|options|shortest_path|to|in|return|filter|sort|limit|let|collect|remove|update|replace|insers|upsert|with",t="true|false",n="append|contains_array|count|count_distinct|count_unique|first|flatten|intersection|last|length|minus|nth|outersection|pop|position|push|remove_nth|remove_value|remove_values|reverse|shift|slice|sorted|sorted_unique|union|union_distinct|unique|unshift|date_now|date_iso8601|date_timestamp|is_datestring|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_format|date_add|date_subtract|date_diff|date_compare|attributes|count|has|is_same_collection|keep|length|matches|merge|merge_recursive|parse_identifier|translate|unset|unset_recursive|values|zip|fulltext|distance|geo_contains|geo_distance|geo_equals|geo_intersects|is_in_polygon|not_null|first_list|first_document|check_document|collection_count|collections|count|current_user|document|length|hash|apply|assert|/ warn|call|fail|noopt|passthru|sleep|v8|version|abs|acos|asin|atan|atan2|average|avg|ceil|cos|degrees|exp|exp2|floor|log|log2|log10|max|median|min|percentile|pi|pow|radians|rand|range|round|sin|sqrt|stddev_population|stddev_sample|stddev|sum|tan|variance_population|variance_sample|variance|char_length|concat|concat_separator|contains|count|encode_uri_component|find_first|find_last|json_parse|json_stringify|left|length|levenshtein_distance|like|lower|ltrim|md5|random_token|regex_matches|regex_split|regex_test|regex_replace|reverse|right|rtrim|sha1|sha512|split|soundex|substitute|substring|tokens|to_base64|to_hex|trim|upper|uuid|to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|is_key|typename|",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"//.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.AqlHighlightRules=s}),define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./aql_highlight_rules").AqlHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="//",this.$id="ace/mode/aql"}.call(o.prototype),t.Mode=o}); (function() {
window.require(["ace/mode/aql"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.command.dosbatch",regex:"\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",caseInsensitive:!0},{token:"keyword.control.statement.dosbatch",regex:"\\b(?:goto|call|exit)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.if.dosbatch",regex:"\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.dosbatch",regex:"\\b(?:if|else)\\b",caseInsensitive:!0},{token:"keyword.control.repeat.dosbatch",regex:"\\bfor\\b",caseInsensitive:!0},{token:"keyword.operator.dosbatch",regex:"\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b"},{token:["doc.comment","comment"],regex:"(?:^|\\b)(rem)($|\\s.*$)",caseInsensitive:!0},{token:"comment.line.colons.dosbatch",regex:"::.*$"},{include:"variable"},{token:"punctuation.definition.string.begin.shell",regex:'"',push:[{token:"punctuation.definition.string.end.shell",regex:'"',next:"pop"},{include:"variable"},{defaultToken:"string.quoted.double.dosbatch"}]},{token:"keyword.operator.pipe.dosbatch",regex:"[|]"},{token:"keyword.operator.redirect.shell",regex:"&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>"}],variable:[{token:"constant.numeric",regex:"%%\\w+|%[*\\d]|%\\w+%"},{token:"constant.numeric",regex:"%~\\d+"},{token:["markup.list","constant.other","markup.list"],regex:"(%)(\\w+)(%?)"}]},this.normalizeRules()};s.metaData={name:"Batch File",scopeName:"source.dosbatch",fileTypes:["bat"]},r.inherits(s,i),t.BatchFileHighlightRules=s}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./batchfile_highlight_rules").BatchFileHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="::",this.blockComment="",this.$id="ace/mode/batchfile"}.call(u.prototype),t.Mode=u}); (function() {
window.require(["ace/mode/batchfile"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function o(e,t){try{return new RegExp(e,t)}catch(n){}}var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,u=function(){this.$rules={start:[{tokenNames:["c9searchresults.constant.numeric","c9searchresults.text","c9searchresults.text","c9searchresults.keyword"],regex:/(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,onMatch:function(e,t,n){var r=this.splitRegex.exec(e),i=this.tokenNames,s=[{type:i[0],value:r[1]},{type:i[1],value:r[2]}];r[3]&&(r[3]==" "?s[1]={type:i[1],value:r[2]+" "}:s.push({type:i[1],value:r[3]}));var o=n[1],u=r[4],a,f=0;if(o&&o.exec){o.lastIndex=0;while(a=o.exec(u)){var l=u.substring(f,a.index);f=o.lastIndex,l&&s.push({type:i[2],value:l});if(a[0])s.push({type:i[3],value:a[0]});else if(!l)break}}return f<u.length&&s.push({type:i[2],value:u.substr(f)}),s}},{regex:"^Searching for [^\\r\\n]*$",onMatch:function(e,t,n){var r=e.split("\x01");if(r.length<3)return"text";var s,u,a=0,f=[{value:r[a++]+"'",type:"text"},{value:u=r[a++],type:"text"},{value:"'"+r[a++],type:"text"}];r[2]!==" in"&&f.push({value:"'"+r[a++]+"'",type:"text"},{value:r[a++],type:"text"}),f.push({value:" "+r[a++]+" ",type:"text"}),r[a+1]?(s=r[a+1],f.push({value:"("+r[a+1]+")",type:"text"}),a+=1):a-=1;while(a++<r.length)r[a]&&f.push({value:r[a],type:"text"});u&&(/regex/.test(s)||(u=i.escapeRegExp(u)),/whole/.test(s)&&(u="\\b"+u+"\\b"));var l=u&&o("("+u+")",/ sensitive/.test(s)?"g":"ig");return l&&(n[0]=t,n[1]=l),f}},{regex:"^(?=Found \\d+ matches)",token:"text",next:"numbers"},{token:"string",regex:"^\\S:?[^:]+",next:"numbers"}],numbers:[{regex:"\\d+",token:"constant.numeric"},{regex:"$",token:"text",next:"start"}]},this.normalizeRules()};r.inherits(u,s),t.C9SearchHighlightRules=u}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^(\S.*:|Searching for.*)$/,this.foldingStopMarker=/^(\s+|Found.*)$/,this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getAllLines(n),s=r[n],o=/^(Found.*|Searching for.*)$/,u=/^(\S.*:|\s*)$/,a=o.test(s)?o:u,f=n,l=n;if(this.foldingStartMarker.test(s)){for(var c=n+1,h=e.getLength();c<h;c++)if(a.test(r[c]))break;l=c}else if(this.foldingStopMarker.test(s)){for(var c=n-1;c>=0;c--){s=r[c];if(a.test(s))break}f=c}if(f!=l){var p=s.length;return a===o&&(p=s.search(/\(Found[^)]+\)$|$/)),new i(f,p,l,0)}}}.call(o.prototype)}),define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c9search_highlight_rules").C9SearchHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/c9search").FoldMode,a=function(){this.HighlightRules=s,this.$outdent=new o,this.foldingRules=new u};r.inherits(a,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c9search"}.call(a.prototype),t.Mode=a}); (function() {
window.require(["ace/mode/c9search"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"constant.numeric",regex:/[\d\.]+/},{token:"comment.line.double-dash",regex:/--/,next:"comment"},{token:"storage.modifier",regex:/\(/},{token:"storage.modifier",regex:/,/,next:"line"},{token:"support.function",regex:/[^\(\)"\s{}\[\]]+/,next:"line"},{token:"string.quoted.double",regex:/"/,next:"string"},{token:"storage.modifier",regex:/\)/}],comment:[{token:"comment.line.double-dash",regex:/ +[^\n]+/,next:"start"}],string:[{token:"string.quoted.double",regex:/"/,next:"line"},{token:"constant.character.escape",regex:/\\/,next:"escape"},{token:"string.quoted.double",regex:/[^\\"]+/}],escape:[{token:"constant.character.escape",regex:/./,next:"string"}],line:[{token:"constant.numeric",regex:/[\d\.]+/},{token:"markup.raw",regex:/^\s*/,next:"start"},{token:"storage.modifier",regex:/\$/,next:"start"},{token:"variable.parameter",regex:/[^\(\)"\s{}\[\]]+/},{token:"storage.modifier",regex:/\(/,next:"start"},{token:"storage.modifier",regex:/\)/},{token:"markup.raw",regex:/^ */,next:"start"},{token:"string.quoted.double",regex:/"/,next:"string"}]}};r.inherits(s,i),t.CirruHighlightRules=s}),define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++n<f){o=e.getLine(n);var h=o.search(i);if(h==-1)continue;if(o[h]!="#")break;c=n}if(c>l){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u<a?"start":"","";if(u==-1){if(i==a&&r[i]=="#"&&s[i]=="#")return e.foldWidgets[n-1]="",e.foldWidgets[n+1]="","start"}else if(u==i&&r[i]=="#"&&o[i]=="#"&&e.getLine(n-2).search(/\S/)==-1)return e.foldWidgets[n-1]="start",e.foldWidgets[n+1]="","";return u!=-1&&u<i?e.foldWidgets[n-1]="start":e.foldWidgets[n-1]="",i<a?"start":""}}.call(o.prototype)}),define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./cirru_highlight_rules").CirruHighlightRules,o=e("./folding/coffee").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/cirru"}.call(u.prototype),t.Mode=u}); (function() {
window.require(["ace/mode/cirru"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"\\*.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.CobolHighlightRules=s}),define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./cobol_highlight_rules").CobolHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="*",this.$id="ace/mode/cobol"}.call(o.prototype),t.Mode=o}); (function() {
window.require(["ace/mode/cobol"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/csp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=this.createKeywordMapper({"constant.language":"child-src|connect-src|default-src|font-src|frame-src|img-src|manifest-src|media-src|object-src|script-src|style-src|worker-src|base-uri|plugin-types|sandbox|disown-opener|form-action|frame-ancestors|report-uri|report-to|upgrade-insecure-requests|block-all-mixed-content|require-sri-for|reflected-xss|referrer|policy-uri",variable:"'none'|'self'|'unsafe-inline'|'unsafe-eval'|'strict-dynamic'|'unsafe-hashed-attributes'"},"identifier",!0);this.$rules={start:[{token:"string.link",regex:/https?:[^;\s]*/},{token:"operator.punctuation",regex:/;/},{token:e,regex:/[^\s;]+/}]}};r.inherits(s,i),t.CspHighlightRules=s}),define("ace/mode/csp",["require","exports","module","ace/mode/text","ace/mode/csp_highlight_rules","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./text").Mode,i=e("./csp_highlight_rules").CspHighlightRules,s=e("../lib/oop"),o=function(){this.HighlightRules=i};s.inherits(o,r),function(){this.$id="ace/mode/csp"}.call(o.prototype),t.Mode=o}); (function() {
window.require(["ace/mode/csp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{regex:"^(?:\\*{15}|={67}|-{3}|\\+{3})$",token:"punctuation.definition.separator.diff",name:"keyword"},{regex:"^(@@)(\\s*.+?\\s*)(@@)(.*)$",token:["constant","constant.numeric","constant","comment.doc.tag"]},{regex:"^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",token:["constant.numeric","punctuation.definition.range.diff","constant.function","constant.numeric","punctuation.definition.range.diff","invalid"],name:"meta."},{regex:"^(\\-{3}|\\+{3}|\\*{3})( .+)$",token:["constant.numeric","meta.tag"]},{regex:"^([!+>])(.*?)(\\s*)$",token:["support.constant","text","invalid"]},{regex:"^([<\\-])(.*?)(\\s*)$",token:["support.function","string","invalid"]},{regex:"^(diff)(\\s+--\\w+)?(.+?)( .+)?$",token:["variable","variable","keyword","variable"]},{regex:"^Index.+$",token:"variable"},{regex:"^\\s+$",token:"text"},{regex:"\\s*$",token:"invalid"},{defaultToken:"invisible",caseInsensitive:!0}]}};r.inherits(s,i),t.DiffHighlightRules=s}),define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(e,t){this.regExpList=e,this.flag=t,this.foldingStartMarker=RegExp("^("+e.join("|")+")",this.flag)};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i={row:n,column:r.length},o=this.regExpList;for(var u=1;u<=o.length;u++){var a=RegExp("^("+o.slice(0,u).join("|")+")",this.flag);if(a.test(r))break}for(var f=e.getLength();++n<f;){r=e.getLine(n);if(a.test(r))break}if(n==i.row+1)return;return new s(i.row,i.column,n-1,r.length)}}.call(o.prototype)}),define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./diff_highlight_rules").DiffHighlightRules,o=e("./folding/diff").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o(["diff","@@|\\*{5}"],"i")};r.inherits(u,i),function(){this.$id="ace/mode/diff",this.snippetFileId="ace/snippets/diff"}.call(u.prototype),t.Mode=u}); (function() {
window.require(["ace/mode/diff"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/edifact_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e="UNH",t="ADR|AGR|AJT|ALC|ALI|APP|APR|ARD|ARR|ASI|ATT|AUT|BAS|BGM|BII|BUS|CAV|CCD|CCI|CDI|CDS|CDV|CED|CIN|CLA|CLI|CMP|CNI|CNT|COD|COM|COT|CPI|CPS|CPT|CST|CTA|CUX|DAM|DFN|DGS|DII|DIM|DLI|DLM|DMS|DOC|DRD|DSG|DSI|DTM|EDT|EFI|ELM|ELU|ELV|EMP|EQA|EQD|EQN|ERC|ERP|EVE|FCA|FII|FNS|FNT|FOR|FSQ|FTX|GDS|GEI|GID|GIN|GIR|GOR|GPO|GRU|HAN|HYN|ICD|IDE|IFD|IHC|IMD|IND|INP|INV|IRQ|LAN|LIN|LOC|MEA|MEM|MKS|MOA|MSG|MTD|NAD|NAT|PAC|PAI|PAS|PCC|PCD|PCI|PDI|PER|PGI|PIA|PNA|POC|PRC|PRI|PRV|PSD|PTY|PYT|QRS|QTY|QUA|QVR|RCS|REL|RFF|RJL|RNG|ROD|RSL|RTE|SAL|SCC|SCD|SEG|SEL|SEQ|SFI|SGP|SGU|SPR|SPS|STA|STC|STG|STS|TAX|TCC|TDT|TEM|TMD|TMP|TOD|TPL|TRU|TSR|UNB|UNZ|UNT|UGH|UGT|UNS|VLI",e="UNH",n="null|Infinity|NaN|undefined",r="",s="BY|SE|ON|INV|JP|UNOA",o=this.createKeywordMapper({"variable.language":"this",keyword:s,"entity.name.segment":t,"entity.name.header":e,"constant.language":n,"support.function":r},"identifier");this.$rules={start:[{token:"punctuation.operator",regex:"\\+.\\+"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:o,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+"},{token:"punctuation.operator",regex:"\\:|'"},{token:"identifier",regex:"\\:D\\:"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};o.metaData={fileTypes:["edi"],keyEquivalent:"^~E",name:"Edifact",scopeName:"source.edifact"},r.inherits(o,s),t.EdifactHighlightRules=o}),define("ace/mode/edifact",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/edifact_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./edifact_highlight_rules").EdifactHighlightRules,o=function(){this.HighlightRules=s};r.inherits(o,i),function(){this.$id="ace/mode/edifact",this.snippetFileId="ace/snippets/edifact"}.call(o.prototype),t.Mode=o}); (function() {
window.require(["ace/mode/edifact"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +0,0 @@
define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="across|agent|alias|all|attached|as|assign|attribute|check|class|convert|create|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|Precursor|redefine|rename|require|rescue|retry|select|separate|some|then|undefine|until|variant|when",t="and|implies|or|xor",n="Void",r="True|False",i="Current|Result",s=this.createKeywordMapper({"constant.language":n,"constant.language.boolean":r,"variable.language":i,"keyword.operator":t,keyword:e},"identifier",!0),o=/(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/;this.$rules={start:[{token:"string.quoted.other",regex:/"\[/,next:"aligned_verbatim_string"},{token:"string.quoted.other",regex:/"\{/,next:"non-aligned_verbatim_string"},{token:"string.quoted.double",regex:/"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/},{token:"comment.line.double-dash",regex:/--.*/},{token:"constant.character",regex:/'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/},{token:"constant.numeric",regex:/\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/},{token:"constant.numeric",regex:/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/},{token:"paren.lparen",regex:/[\[({]|<<|\|\(/},{token:"paren.rparen",regex:/[\])}]|>>|\|\)/},{token:"keyword.operator",regex:/:=|->|\.(?=\w)|[;,:?]/},{token:"keyword.operator",regex:/\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/},{token:function(e){var t=s(e);return t==="identifier"&&e===e.toUpperCase()&&(t="entity.name.type"),t},regex:/[a-zA-Z][a-zA-Z\d_]*\b/},{token:"text",regex:/\s+/}],aligned_verbatim_string:[{token:"string",regex:/]"/,next:"start"},{token:"string",regex:o}],"non-aligned_verbatim_string":[{token:"string.quoted.other",regex:/}"/,next:"start"},{token:"string.quoted.other",regex:o}]}};r.inherits(s,i),t.EiffelHighlightRules=s}),define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./eiffel_highlight_rules").EiffelHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="--",this.$id="ace/mode/eiffel"}.call(o.prototype),t.Mode=o}); (function() {
window.require(["ace/mode/eiffel"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

Some files were not shown because too many files have changed in this diff Show More