mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-02-22 01:42:47 +01:00
Improvements on GUI + API:
- Add generic key-value dialog - Allow multiple file upload - Add ESC and enter key handle to dialog - Improve File application
This commit is contained in:
parent
f7a3373d23
commit
20840d09b0
Binary file not shown.
@ -238,6 +238,7 @@ namespace OS {
|
|||||||
* @memberof BasicDialog
|
* @memberof BasicDialog
|
||||||
*/
|
*/
|
||||||
init(): void {
|
init(): void {
|
||||||
|
//this._onenter = undefined;
|
||||||
if (this.markup) {
|
if (this.markup) {
|
||||||
if (typeof this.markup === "string") {
|
if (typeof this.markup === "string") {
|
||||||
return GUI.htmlToScheme(this.markup, this, this.host);
|
return GUI.htmlToScheme(this.markup, this, this.host);
|
||||||
@ -263,11 +264,27 @@ namespace OS {
|
|||||||
*/
|
*/
|
||||||
main(): void {
|
main(): void {
|
||||||
const win = this.scheme as tag.WindowTag;
|
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) {
|
if (this.data && this.data.title) {
|
||||||
win.apptitle = this.data.title;
|
win.apptitle = this.data.title;
|
||||||
}
|
}
|
||||||
win.resizable = false;
|
win.resizable = false;
|
||||||
win.minimizable = false;
|
win.minimizable = false;
|
||||||
|
$(win).trigger("focus");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,7 +356,7 @@ namespace OS {
|
|||||||
return this.quit();
|
return this.quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
$input.on("keyup",(e) => {
|
$input.on("keyup", (e) => {
|
||||||
if (e.which !== 13) {
|
if (e.which !== 13) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -411,7 +428,7 @@ namespace OS {
|
|||||||
if (this.data && this.data.disable) {
|
if (this.data && this.data.disable) {
|
||||||
$input.prop('disabled', true);
|
$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();
|
const value = $input.val();
|
||||||
if (!value || value === "") {
|
if (!value || value === "") {
|
||||||
return;
|
return;
|
||||||
@ -445,7 +462,7 @@ namespace OS {
|
|||||||
<div data-height="10" ></div>
|
<div data-height="10" ></div>
|
||||||
<afx-hbox data-height="30">
|
<afx-hbox data-height="30">
|
||||||
<div ></div>
|
<div ></div>
|
||||||
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" ></afx-button>
|
<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-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" ></afx-button>
|
||||||
</afx-hbox>
|
</afx-hbox>
|
||||||
</afx-vbox>
|
</afx-vbox>
|
||||||
@ -1070,7 +1087,7 @@ namespace OS {
|
|||||||
return $(filename).val(e.data.filename);
|
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;
|
const f = fileview.selectedFile;
|
||||||
if (!f) {
|
if (!f) {
|
||||||
return this.notify(
|
return this.notify(
|
||||||
@ -1149,7 +1166,7 @@ namespace OS {
|
|||||||
<input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" ></input>
|
<input data-height = '26' type = "text" data-id = "filename" style="margin-left:5px; margin-right:5px;display:none;" ></input>
|
||||||
<afx-hbox data-height = '30'>
|
<afx-hbox data-height = '30'>
|
||||||
<div style=' text-align:right;'>
|
<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>
|
<afx-button data-id = "bt-cancel" text = "__(Cancel)"></afx-button>
|
||||||
</div>
|
</div>
|
||||||
<div data-width="5"></div>
|
<div data-width="5"></div>
|
||||||
@ -1305,6 +1322,151 @@ namespace OS {
|
|||||||
<div data-width="10" ></div>
|
<div data-width="10" ></div>
|
||||||
</afx-hbox>
|
</afx-hbox>
|
||||||
</afx-app-window>`;
|
</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>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
136
src/core/core.ts
136
src/core/core.ts
@ -239,7 +239,7 @@ namespace OS {
|
|||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ant.__ = function(...args: any[]): FormattedString | string {
|
Ant.__ = function (...args: any[]): FormattedString | string {
|
||||||
if (!(args.length > 0)) {
|
if (!(args.length > 0)) {
|
||||||
return "Undefined";
|
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());
|
const reason = new Error(e.toString());
|
||||||
reason.stack += "\nCaused By:\n" + e.stack;
|
reason.stack += "\nCaused By:\n" + e.stack;
|
||||||
return reason;
|
return reason;
|
||||||
@ -611,7 +611,7 @@ namespace OS {
|
|||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
String.prototype.hash = function(): number {
|
String.prototype.hash = function (): number {
|
||||||
let hash = 5381;
|
let hash = 5381;
|
||||||
let i = this.length;
|
let i = this.length;
|
||||||
while (i) {
|
while (i) {
|
||||||
@ -619,10 +619,10 @@ namespace OS {
|
|||||||
}
|
}
|
||||||
return hash >>> 0;
|
return hash >>> 0;
|
||||||
};
|
};
|
||||||
String.prototype.__v = function(): Version {
|
String.prototype.__v = function (): Version {
|
||||||
return new Version(this);
|
return new Version(this);
|
||||||
};
|
};
|
||||||
String.prototype.asBase64 = function(): string {
|
String.prototype.asBase64 = function (): string {
|
||||||
const tmp = encodeURIComponent(this);
|
const tmp = encodeURIComponent(this);
|
||||||
return btoa(
|
return btoa(
|
||||||
tmp.replace(/%([0-9A-F]{2})/g, (match, p1) =>
|
tmp.replace(/%([0-9A-F]{2})/g, (match, p1) =>
|
||||||
@ -630,8 +630,8 @@ namespace OS {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
String.prototype.escape = function(): string {
|
String.prototype.escape = function (): string {
|
||||||
return this.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function(
|
return this.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function (
|
||||||
c: string
|
c: string
|
||||||
) {
|
) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -658,11 +658,11 @@ namespace OS {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
String.prototype.unescape = function(): string {
|
String.prototype.unescape = function (): string {
|
||||||
let json = JSON.parse(`{ "text": "${this}"}`)
|
let json = JSON.parse(`{ "text": "${this}"}`)
|
||||||
return json.text;
|
return json.text;
|
||||||
};
|
};
|
||||||
String.prototype.asUint8Array = function(): Uint8Array {
|
String.prototype.asUint8Array = function (): Uint8Array {
|
||||||
let bytes = [];
|
let bytes = [];
|
||||||
for (
|
for (
|
||||||
let i = 0, end = this.length - 1, asc = 0 <= end;
|
let i = 0, end = this.length - 1, asc = 0 <= end;
|
||||||
@ -675,8 +675,8 @@ namespace OS {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!String.prototype.format) {
|
if (!String.prototype.format) {
|
||||||
String.prototype.format = function(...args: any[]): string {
|
String.prototype.format = function (...args: any[]): string {
|
||||||
return this.replace(/{(\d+)}/g, function(
|
return this.replace(/{(\d+)}/g, function (
|
||||||
match: string,
|
match: string,
|
||||||
number: number
|
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);
|
return new FormattedString(this, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
String.prototype.__ = function(): string {
|
String.prototype.__ = function (): string {
|
||||||
const match = this.match(/^__\((.*)\)$/);
|
const match = this.match(/^__\((.*)\)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
return match[1].l();
|
return match[1].l();
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
String.prototype.l = function(): string {
|
String.prototype.l = function (): string {
|
||||||
if (!API.lang[this]) {
|
if (!API.lang[this]) {
|
||||||
API.lang[this] = this;
|
API.lang[this] = this;
|
||||||
}
|
}
|
||||||
return API.lang[this];
|
return API.lang[this];
|
||||||
};
|
};
|
||||||
String.prototype.trimFromLeft = function(charlist: string): string {
|
String.prototype.trimFromLeft = function (charlist: string): string {
|
||||||
if (charlist === undefined) charlist = "s";
|
if (charlist === undefined) charlist = "s";
|
||||||
|
|
||||||
return this.replace(new RegExp("^[" + charlist + "]+"), "") as string;
|
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";
|
if (charlist === undefined) charlist = "s";
|
||||||
|
|
||||||
return this.replace(new RegExp("[" + charlist + "]+$"), "") as string;
|
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;
|
return this.trimFromLeft(charlist).trimFromRight(charlist) as string;
|
||||||
};
|
};
|
||||||
Date.prototype.toString = function(): string {
|
Date.prototype.toString = function (): string {
|
||||||
let dd = this.getDate();
|
let dd = this.getDate();
|
||||||
let mm = this.getMonth() + 1;
|
let mm = this.getMonth() + 1;
|
||||||
const yyyy = this.getFullYear();
|
const yyyy = this.getFullYear();
|
||||||
@ -746,7 +746,7 @@ namespace OS {
|
|||||||
return `${dd}/${mm}/${yyyy} ${hh}:${mi}:${se}`;
|
return `${dd}/${mm}/${yyyy} ${hh}:${mi}:${se}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
Date.prototype.timestamp = function(): number {
|
Date.prototype.timestamp = function (): number {
|
||||||
return (this.getTime() / 1000) | 0;
|
return (this.getTime() / 1000) | 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -825,7 +825,7 @@ namespace OS {
|
|||||||
console.log("Booting system");
|
console.log("Booting system");
|
||||||
API.handle
|
API.handle
|
||||||
.auth()
|
.auth()
|
||||||
.then(function(d: API.RequestResult) {
|
.then(function (d: API.RequestResult) {
|
||||||
// in case someone call it more than once :)
|
// in case someone call it more than once :)
|
||||||
if (d.error) {
|
if (d.error) {
|
||||||
// show login screen
|
// show login screen
|
||||||
@ -860,7 +860,7 @@ namespace OS {
|
|||||||
}
|
}
|
||||||
API.handle
|
API.handle
|
||||||
.setting()
|
.setting()
|
||||||
.then(function(r: any) {
|
.then(function (r: any) {
|
||||||
cleanup();
|
cleanup();
|
||||||
return API.handle.logout().then((d: any) => boot());
|
return API.handle.logout().then((d: any) => boot());
|
||||||
})
|
})
|
||||||
@ -1132,7 +1132,7 @@ namespace OS {
|
|||||||
* @returns {Promise<any>} a promise on the result data
|
* @returns {Promise<any>} a promise on the result data
|
||||||
*/
|
*/
|
||||||
export function post(p: string, d: any): Promise<any> {
|
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();
|
const q = announcer.getMID();
|
||||||
API.loading(q, p);
|
API.loading(q, p);
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
@ -1141,7 +1141,7 @@ namespace OS {
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify(
|
data: JSON.stringify(
|
||||||
d,
|
d,
|
||||||
function(k, v) {
|
function (k, v) {
|
||||||
if (k === "domel") {
|
if (k === "domel") {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -1152,11 +1152,11 @@ namespace OS {
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: null,
|
success: null,
|
||||||
})
|
})
|
||||||
.done(function(data) {
|
.done(function (data) {
|
||||||
API.loaded(q, p, "OK");
|
API.loaded(q, p, "OK");
|
||||||
return resolve(data);
|
return resolve(data);
|
||||||
})
|
})
|
||||||
.fail(function(j, s, e) {
|
.fail(function (j, s, e) {
|
||||||
API.loaded(q, p, "FAIL");
|
API.loaded(q, p, "FAIL");
|
||||||
return reject(API.throwe(s));
|
return reject(API.throwe(s));
|
||||||
});
|
});
|
||||||
@ -1175,12 +1175,12 @@ namespace OS {
|
|||||||
* @returns {Promise<ArrayBuffer>} a promise on the returned binary data
|
* @returns {Promise<ArrayBuffer>} a promise on the returned binary data
|
||||||
*/
|
*/
|
||||||
export function blob(p: string): Promise<ArrayBuffer> {
|
export function blob(p: string): Promise<ArrayBuffer> {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
const q = announcer.getMID();
|
const q = announcer.getMID();
|
||||||
const r = new XMLHttpRequest();
|
const r = new XMLHttpRequest();
|
||||||
r.open("GET", p, true);
|
r.open("GET", p, true);
|
||||||
r.responseType = "arraybuffer";
|
r.responseType = "arraybuffer";
|
||||||
r.onload = function(e) {
|
r.onload = function (e) {
|
||||||
if (this.status === 200 && this.readyState === 4) {
|
if (this.status === 200 && this.readyState === 4) {
|
||||||
API.loaded(q, p, "OK");
|
API.loaded(q, p, "OK");
|
||||||
resolve(this.response);
|
resolve(this.response);
|
||||||
@ -1205,36 +1205,42 @@ namespace OS {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
export function upload(p: string, d: string): 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();
|
const q = announcer.getMID();
|
||||||
//insert a temporal file selector
|
//insert a temporal file selector
|
||||||
const o = $("<input>")
|
const o = $("#antos_upload_files");
|
||||||
.attr("type", "file")
|
o.on("change", function () {
|
||||||
.css("display", "none");
|
const files = (o[0] as HTMLInputElement).files;
|
||||||
o.on("change",function() {
|
const n_files = files.length;
|
||||||
API.loading(q, p);
|
const tasks = [];
|
||||||
const formd = new FormData();
|
if (n_files > 0)
|
||||||
formd.append("path", d);
|
API.loading(q, p);
|
||||||
// TODO: only one file is selected at this time
|
Array.from(files).forEach(file => {
|
||||||
formd.append("upload", (o[0] as HTMLInputElement).files[0]);
|
const formd = new FormData();
|
||||||
|
formd.append("path", d);
|
||||||
return $.ajax({
|
formd.append("upload", file);
|
||||||
url: p,
|
return $.ajax({
|
||||||
data: formd,
|
url: p,
|
||||||
type: "POST",
|
data: formd,
|
||||||
contentType: false,
|
type: "POST",
|
||||||
processData: false,
|
contentType: false,
|
||||||
})
|
processData: false,
|
||||||
.done(function(data) {
|
|
||||||
API.loaded(q, p, "OK");
|
|
||||||
resolve(data);
|
|
||||||
return o.remove();
|
|
||||||
})
|
})
|
||||||
.fail(function(j, s, e) {
|
.done(function (data) {
|
||||||
API.loaded(q, p, "FAIL");
|
tasks.push("OK");
|
||||||
reject(API.throwe(s));
|
if (tasks.length == n_files)
|
||||||
return o.remove();
|
{
|
||||||
});
|
API.loaded(q, p, "OK");
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.fail(function (j, s, e) {
|
||||||
|
tasks.push("FAIL");
|
||||||
|
if (tasks.length == n_files)
|
||||||
|
API.loaded(q, p, "FAIL");
|
||||||
|
reject(API.throwe(s));
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return o.trigger("click");
|
return o.trigger("click");
|
||||||
});
|
});
|
||||||
@ -1310,7 +1316,7 @@ namespace OS {
|
|||||||
* @returns {Promise<any>} a Promise on the requested data
|
* @returns {Promise<any>} a Promise on the requested data
|
||||||
*/
|
*/
|
||||||
export function get(p: string, t: string = undefined): Promise<any> {
|
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 = {
|
const conf: any = {
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: p,
|
url: p,
|
||||||
@ -1321,11 +1327,11 @@ namespace OS {
|
|||||||
const q = announcer.getMID();
|
const q = announcer.getMID();
|
||||||
API.loading(q, p);
|
API.loading(q, p);
|
||||||
return $.ajax(conf)
|
return $.ajax(conf)
|
||||||
.done(function(data) {
|
.done(function (data) {
|
||||||
API.loaded(q, p, "OK");
|
API.loaded(q, p, "OK");
|
||||||
return resolve(data);
|
return resolve(data);
|
||||||
})
|
})
|
||||||
.fail(function(j, s, e) {
|
.fail(function (j, s, e) {
|
||||||
API.loaded(q, p, "FAIL");
|
API.loaded(q, p, "FAIL");
|
||||||
return reject(API.throwe(s));
|
return reject(API.throwe(s));
|
||||||
});
|
});
|
||||||
@ -1382,14 +1388,14 @@ namespace OS {
|
|||||||
* @returns {Promise<void>} a promise on the result data
|
* @returns {Promise<void>} a promise on the result data
|
||||||
*/
|
*/
|
||||||
export function requires(l: string, force: boolean = false): Promise<void> {
|
export function requires(l: string, force: boolean = false): Promise<void> {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
if (!API.shared[l] || force) {
|
if (!API.shared[l] || force) {
|
||||||
const libfp = l.asFileHandle();
|
const libfp = l.asFileHandle();
|
||||||
switch (libfp.ext) {
|
switch (libfp.ext) {
|
||||||
case "css":
|
case "css":
|
||||||
return libfp
|
return libfp
|
||||||
.onready()
|
.onready()
|
||||||
.then(function() {
|
.then(function () {
|
||||||
$("<link>", {
|
$("<link>", {
|
||||||
rel: "stylesheet",
|
rel: "stylesheet",
|
||||||
type: "text/css",
|
type: "text/css",
|
||||||
@ -1403,7 +1409,7 @@ namespace OS {
|
|||||||
.catch((e: Error) => reject(__e(e)));
|
.catch((e: Error) => reject(__e(e)));
|
||||||
case "js":
|
case "js":
|
||||||
return API.script(libfp.getlink())
|
return API.script(libfp.getlink())
|
||||||
.then(function(data: any) {
|
.then(function (data: any) {
|
||||||
API.shared[l] = true;
|
API.shared[l] = true;
|
||||||
console.log("Loaded :", l);
|
console.log("Loaded :", l);
|
||||||
announcer.trigger("sharedlibraryloaded", l);
|
announcer.trigger("sharedlibraryloaded", l);
|
||||||
@ -1431,11 +1437,11 @@ namespace OS {
|
|||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
export function require(libs: string[]): 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)) {
|
if (!(libs.length > 0)) {
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
announcer.observable.one("sharedlibraryloaded", async function(
|
announcer.observable.one("sharedlibraryloaded", async function (
|
||||||
l
|
l
|
||||||
) {
|
) {
|
||||||
libs.splice(0, 1);
|
libs.splice(0, 1);
|
||||||
@ -1606,7 +1612,7 @@ namespace OS {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
export function setLocale(name: string): 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`;
|
const path = `resources/languages/${name}.json`;
|
||||||
try {
|
try {
|
||||||
const d = await API.get(path, "json");
|
const d = await API.get(path, "json");
|
||||||
@ -1661,7 +1667,7 @@ namespace OS {
|
|||||||
* @returns {Promise<any>} Promise on the clipboard data
|
* @returns {Promise<any>} Promise on the clipboard data
|
||||||
*/
|
*/
|
||||||
export function getClipboard(): Promise<any> {
|
export function getClipboard(): Promise<any> {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
const $el = $("#clipboard");
|
const $el = $("#clipboard");
|
||||||
if (!navigator.clipboard) {
|
if (!navigator.clipboard) {
|
||||||
return resolve($el.val());
|
return resolve($el.val());
|
||||||
@ -1705,7 +1711,7 @@ namespace OS {
|
|||||||
enumerable: false,
|
enumerable: false,
|
||||||
value: p,
|
value: p,
|
||||||
});
|
});
|
||||||
const fn = function(o: any, v: any) {
|
const fn = function (o: any, v: any) {
|
||||||
return Object.defineProperty(o, v, {
|
return Object.defineProperty(o, v, {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
set(value) {
|
set(value) {
|
||||||
|
@ -335,7 +335,7 @@ namespace OS {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const list = apps.map((e) => ({
|
const list = apps.map((e) => ({
|
||||||
text: e.app,
|
text: e.name,
|
||||||
icon: e.icon,
|
icon: e.icon,
|
||||||
iconclass: e.iconclass,
|
iconclass: e.iconclass,
|
||||||
}));
|
}));
|
||||||
@ -1221,6 +1221,7 @@ namespace OS {
|
|||||||
<afx-menu id="contextmenu" data-id="contextmenu" context="true" style="display:none;"></afx-menu>
|
<afx-menu id="contextmenu" data-id="contextmenu" context="true" style="display:none;"></afx-menu>
|
||||||
<afx-label id="systooltip" data-id="systooltip" style="display:none;position:absolute;"></afx-label>
|
<afx-label id="systooltip" data-id="systooltip" style="display:none;position:absolute;"></afx-label>
|
||||||
<textarea id="clipboard"></textarea>\
|
<textarea id="clipboard"></textarea>\
|
||||||
|
<input type="file" id="antos_upload_files" name="files" multiple style="display: none;">\
|
||||||
`;
|
`;
|
||||||
|
|
||||||
schemes.login = `\
|
schemes.login = `\
|
||||||
|
@ -214,4 +214,153 @@
|
|||||||
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url",
|
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url",
|
||||||
"Yes":"Yes",
|
"Yes":"Yes",
|
||||||
"{0} is not a directory":"{0} is not a directory"
|
"{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"
|
||||||
}
|
}
|
||||||
|
@ -304,4 +304,116 @@
|
|||||||
"Welcome to AntOSDK":"Welcome to AntOSDK",
|
"Welcome to AntOSDK":"Welcome to AntOSDK",
|
||||||
"Your application version is older ({0} < {1})":"Your application version is older ({0} < {1})",
|
"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"
|
"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}"
|
||||||
}
|
}
|
||||||
|
@ -245,4 +245,63 @@
|
|||||||
"Theme":"Thème",
|
"Theme":"Thème",
|
||||||
"VFS":"VFS",
|
"VFS":"VFS",
|
||||||
"Wallpaper":"Fond d'écran"
|
"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"
|
||||||
}
|
}
|
||||||
|
@ -393,4 +393,66 @@
|
|||||||
"Value":"Value",
|
"Value":"Value",
|
||||||
"Verifying: {0}":"Verifying: {0}",
|
"Verifying: {0}":"Verifying: {0}",
|
||||||
"VFS unknown handle: {0}":"VFS unknown handle: {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"
|
||||||
}
|
}
|
||||||
|
@ -327,4 +327,70 @@
|
|||||||
"Report":"Report",
|
"Report":"Report",
|
||||||
"Select extension archive":"Select extension archive",
|
"Select extension archive":"Select extension archive",
|
||||||
"System error log":"System error log"
|
"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}"
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,9 @@ namespace OS {
|
|||||||
this.bindKey("CTRL-P", () =>
|
this.bindKey("CTRL-P", () =>
|
||||||
this.actionEdit(`${this.name}-paste`)
|
this.actionEdit(`${this.name}-paste`)
|
||||||
);
|
);
|
||||||
|
this.bindKey("CTRL-ALT-R", ()=>{
|
||||||
|
this.view.path = this.currdir.path;
|
||||||
|
});
|
||||||
(this.find("btgrid") as GUI.tag.ButtonTag).onbtclick = (e) => {
|
(this.find("btgrid") as GUI.tag.ButtonTag).onbtclick = (e) => {
|
||||||
this.view.view = "icon";
|
this.view.view = "icon";
|
||||||
this.viewType.icon = true;
|
this.viewType.icon = true;
|
||||||
@ -384,6 +386,7 @@ namespace OS {
|
|||||||
{
|
{
|
||||||
text: "__(Refresh)",
|
text: "__(Refresh)",
|
||||||
dataid: `${this.name}-refresh`,
|
dataid: `${this.name}-refresh`,
|
||||||
|
shortcut: "C-A-R"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "__(Sidebar)",
|
text: "__(Sidebar)",
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
afx-app-window {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
afx-app-window div.afx-window-wrapper{
|
afx-app-window div.afx-window-wrapper{
|
||||||
padding:0;
|
padding:0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user