update compatibility to AntOS next

This commit is contained in:
mrsang
2021-04-21 11:37:58 +02:00
parent bc33f7ff10
commit 190c2fd346
1014 changed files with 96281 additions and 2092 deletions

View File

@ -1,4 +1,5 @@
namespace OS {
declare var $:any;
export namespace application {
/**
@ -117,7 +118,6 @@ namespace OS {
if (this.onstatuschange)
this.onstatuschange(this.getEditorStatus());
});
this.tabbar.ontabselect = (e) => {
return this.selecteTab($(e.data.item).index());
};

View File

@ -2,7 +2,7 @@
namespace OS {
declare var JSZip: any;
declare var $:any;
export namespace application {
export type AnteditBaseExtension = typeof EditorBaseExtension;
}

View File

@ -1,5 +1,5 @@
namespace OS {
declare var monaco;
//declare var monaco: any;
export namespace application {
/**
* Wrapper model for the ACE text editor
@ -42,7 +42,7 @@ namespace OS {
* @return {*}
* @memberof MonacoEditorModel
*/
protected getTexModel() {
protected getTexModel(): any {
return {
model: this.editor.getModel(),
position: this.editor.getPosition()
@ -85,6 +85,7 @@ namespace OS {
const model = monaco.editor.getModel(uri);
if(model)
{
model.setValue(file.cache);
return { model: model };
}
return {

View File

@ -1,6 +1,5 @@
declare var __monaco_public_path__;
__monaco_public_path__ = "VFS/get/"+ "pkg://MonacoCore/bundle/".asFileHandle().path + "/";
namespace OS {
declare var $: any;
export namespace application {
declare var require: any;
@ -959,12 +958,7 @@ namespace OS {
const ed_action = {
id: `${extension.name}:${action.name}`,
label: `${extension.text.__()}: ${action.text.__()}`,
/*
keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10,
// chord
monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_K, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_M)
]*/
keybindings: [],
precondition: null,
keybindingContext: null,
@ -972,6 +966,41 @@ namespace OS {
//contextMenuOrder: 1.5,
run: () => callback(extension.name, action.name)
};
if(action.shortcut)
{
const keys = action.shortcut.split("-");
let binding: number = 0;
for(const key of keys)
{
switch(key)
{
case "CTRL":
binding = binding | monaco.KeyMod.CtrlCmd;
break;
case "ALT":
binding = binding | monaco.KeyMod.Alt;
break;
case "SHIFT":
binding = binding | monaco.KeyMod.Shift;
break;
case "SUPPER":
binding = binding | monaco.KeyMod.WinCtrl;
break;
default:
const k = `KEY_${key}`;
if(monaco.KeyCode[k])
{
binding = binding | monaco.KeyCode[k];
}
else
{
binding = 0;
}
}
}
if(binding != 0)
ed_action.keybindings.push(binding);
}
for(let ed of this.models)
{
const editor = ed.getEditor();
@ -1115,6 +1144,7 @@ namespace OS {
Antedit.Logger = Logger;
Antedit.dependencies = [
"pkg://MonacoCore/path.js",
"pkg://MonacoCore/bundle/app.bundle.js"
];
}