forked from Wavyzz/dolibarr
Upgrade ACE Editor from 1.4.7 to 1.4.14
This commit is contained in:
@@ -61,7 +61,7 @@ margin: 0px;\
|
||||
.ace_optionsMenuEntry button:hover{\
|
||||
background: #f0f0f0;\
|
||||
}";
|
||||
dom.importCssString(cssText);
|
||||
dom.importCssString(cssText, "settings_menu.css", false);
|
||||
|
||||
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
|
||||
var closer = document.createElement('div');
|
||||
@@ -160,22 +160,23 @@ var supportedModes = {
|
||||
ABC: ["abc"],
|
||||
ActionScript:["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Alda: ["alda"],
|
||||
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl"],
|
||||
Assembly_x86:["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
Apex: ["apex|cls|trigger|tgr"],
|
||||
AQL: ["aql"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl|asl.json"],
|
||||
Assembly_x86:["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Crystal: ["cr"],
|
||||
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"],
|
||||
@@ -222,8 +223,8 @@ var supportedModes = {
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx"],
|
||||
JSON5: ["json5"],
|
||||
JSON: ["json"],
|
||||
JSON5: ["json5"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
@@ -231,6 +232,7 @@ var supportedModes = {
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
Latte: ["latte"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
@@ -245,32 +247,36 @@ var supportedModes = {
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MediaWiki: ["wiki|mediawiki"],
|
||||
MEL: ["mel"],
|
||||
MIPS: ["s|asm"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nginx: ["nginx|conf"],
|
||||
Nix: ["nix"],
|
||||
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_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Puppet: ["epp|pp"],
|
||||
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"],
|
||||
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
@@ -282,11 +288,13 @@ var supportedModes = {
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala|sbt"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
Scrypt: ["scrypt"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
Smithy: ["smithy"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template:["soy"],
|
||||
Space: ["space"],
|
||||
@@ -302,7 +310,7 @@ var supportedModes = {
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Twig: ["latte|twig|swig"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
@@ -334,6 +342,7 @@ var nameOverrides = {
|
||||
Perl6: "Perl 6",
|
||||
AutoHotKey: "AutoHotkey / AutoIt"
|
||||
};
|
||||
|
||||
var modesByName = {};
|
||||
for (var name in supportedModes) {
|
||||
var data = supportedModes[name];
|
||||
@@ -367,7 +376,7 @@ var themeData = [
|
||||
["Solarized Light"],
|
||||
["TextMate" ],
|
||||
["Tomorrow" ],
|
||||
["XCode" ],
|
||||
["Xcode" ],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server" ,"sqlserver" , "light"],
|
||||
@@ -384,6 +393,8 @@ var themeData = [
|
||||
["Merbivore Soft" ,"merbivore_soft" , "dark"],
|
||||
["Mono Industrial" ,"mono_industrial" , "dark"],
|
||||
["Monokai" ,"monokai" , "dark"],
|
||||
["Nord Dark" ,"nord_dark" , "dark"],
|
||||
["One Dark" ,"one_dark" , "dark"],
|
||||
["Pastel on dark" ,"pastel_on_dark" , "dark"],
|
||||
["Solarized Dark" ,"solarized_dark" , "dark"],
|
||||
["Terminal" ,"terminal" , "dark"],
|
||||
@@ -498,6 +509,7 @@ var optionGroups = {
|
||||
"Soft Tabs": [{
|
||||
path: "useSoftTabs"
|
||||
}, {
|
||||
ariaLabel: "Tab Size",
|
||||
path: "tabSize",
|
||||
type: "number",
|
||||
values: [2, 3, 4, 8, 16]
|
||||
@@ -519,6 +531,12 @@ var optionGroups = {
|
||||
"Enable Behaviours": {
|
||||
path: "behavioursEnabled"
|
||||
},
|
||||
"Wrap with quotes": {
|
||||
path: "wrapBehavioursEnabled"
|
||||
},
|
||||
"Enable Auto Indent": {
|
||||
path: "enableAutoIndent"
|
||||
},
|
||||
"Full Line Selection": {
|
||||
type: "checkbox",
|
||||
values: "text|line",
|
||||
@@ -533,11 +551,12 @@ var optionGroups = {
|
||||
"Show Indent Guides": {
|
||||
path: "displayIndentGuides"
|
||||
},
|
||||
"Persistent Scrollbar": [{
|
||||
"Persistent HScrollbar": {
|
||||
path: "hScrollBarAlwaysVisible"
|
||||
}, {
|
||||
},
|
||||
"Persistent VScrollbar": {
|
||||
path: "vScrollBarAlwaysVisible"
|
||||
}],
|
||||
},
|
||||
"Animate scrolling": {
|
||||
path: "animatedScroll"
|
||||
},
|
||||
@@ -556,6 +575,7 @@ var optionGroups = {
|
||||
"Show Print Margin": [{
|
||||
path: "showPrintMargin"
|
||||
}, {
|
||||
ariaLabel: "Print Margin",
|
||||
type: "number",
|
||||
path: "printMarginColumn"
|
||||
}],
|
||||
@@ -618,10 +638,10 @@ var OptionPanel = function(editor, element) {
|
||||
|
||||
this.render = function() {
|
||||
this.container.innerHTML = "";
|
||||
buildDom(["table", {id: "controls"},
|
||||
buildDom(["table", {role: "presentation", id: "controls"},
|
||||
this.renderOptionGroup(optionGroups.Main),
|
||||
["tr", null, ["td", {colspan: 2},
|
||||
["table", {id: "more-controls"},
|
||||
["table", {role: "presentation", id: "more-controls"},
|
||||
this.renderOptionGroup(optionGroups.More)
|
||||
]
|
||||
]],
|
||||
@@ -664,17 +684,20 @@ var OptionPanel = function(editor, element) {
|
||||
}
|
||||
|
||||
if (option.type == "buttonBar") {
|
||||
control = ["div", option.items.map(function(item) {
|
||||
control = ["div", {role: "group", "aria-labelledby": option.path + "-label"}, option.items.map(function(item) {
|
||||
return ["button", {
|
||||
value: item.value,
|
||||
ace_selected_button: value == item.value,
|
||||
'aria-pressed': value == item.value,
|
||||
onclick: function() {
|
||||
self.setOption(option, item.value);
|
||||
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
nodes[i].removeAttribute("ace_selected_button");
|
||||
nodes[i].setAttribute("aria-pressed", false);
|
||||
}
|
||||
this.setAttribute("ace_selected_button", true);
|
||||
this.setAttribute("aria-pressed", true);
|
||||
}
|
||||
}, item.desc || item.caption || item.name];
|
||||
})];
|
||||
@@ -682,6 +705,11 @@ var OptionPanel = function(editor, element) {
|
||||
control = ["input", {type: "number", value: value || option.defaultValue, style:"width:3em", oninput: function() {
|
||||
self.setOption(option, parseInt(this.value));
|
||||
}}];
|
||||
if (option.ariaLabel) {
|
||||
control[1]["aria-label"] = option.ariaLabel;
|
||||
} else {
|
||||
control[1].id = key;
|
||||
}
|
||||
if (option.defaults) {
|
||||
control = [control, option.defaults.map(function(item) {
|
||||
return ["button", {onclick: function() {
|
||||
@@ -725,11 +753,13 @@ var OptionPanel = function(editor, element) {
|
||||
this.renderOption = function(key, option) {
|
||||
if (option.path && !option.onchange && !this.editor.$options[option.path])
|
||||
return;
|
||||
this.options[option.path] = option;
|
||||
var safeKey = "-" + option.path;
|
||||
var path = Array.isArray(option) ? option[0].path : option.path;
|
||||
this.options[path] = option;
|
||||
var safeKey = "-" + path;
|
||||
var safeId = path + "-label";
|
||||
var control = this.renderOptionControl(safeKey, option);
|
||||
return ["tr", {class: "ace_optionsMenuEntry"}, ["td",
|
||||
["label", {for: safeKey}, key]
|
||||
["label", {for: safeKey, id: safeId}, key]
|
||||
], ["td", control]];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user