Skip to content

Commit 9fd9214

Browse files
committed
- ambiance and chrome themes design like DARK and LIGHT lsfusion themes
- removed css folder
1 parent 0830163 commit 9fd9214

File tree

5 files changed

+28
-140
lines changed

5 files changed

+28
-140
lines changed

Makefile.dryice.js

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -436,113 +436,6 @@ function buildAce(options, callback) {
436436
sanityCheck(options, callback);
437437
if (options.noconflict && !options.compress)
438438
buildTypes();
439-
440-
extractCss(options, function() {
441-
if (callback)
442-
return callback();
443-
console.log("Finished building " + getTargetDir(options));
444-
445-
});
446-
}
447-
}
448-
449-
function extractCss(options, callback) {
450-
var dir = BUILD_DIR + "/src" + (options.noconflict ? "-noconflict" : "");
451-
var filenames = fs.readdirSync(dir);
452-
var css = "";
453-
var images = {};
454-
var usedCss = {};
455-
filenames.forEach(function(filename) {
456-
var stat = fs.statSync(dir + "/" + filename);
457-
if (stat.isDirectory()) return;
458-
var value = fs.readFileSync(dir + "/" + filename, "utf8");
459-
460-
var cssImports = detectCssImports(value);
461-
462-
if (/theme-/.test(filename)) {
463-
var name = filename.replace(/^theme-|\.js$/g, "");
464-
var themeCss = "";
465-
for (var i in cssImports) {
466-
themeCss += cssImports[i];
467-
}
468-
themeCss = extractImages(themeCss, name, "..");
469-
build.writeToFile({code: themeCss}, {
470-
outputFolder: BUILD_DIR + "/css/theme",
471-
outputFile: name + ".css"
472-
}, function() {});
473-
} else if (cssImports) {
474-
css += "\n/*" + filename + "*/";
475-
for (var i in cssImports) {
476-
if (usedCss[cssImports[i]]) continue;
477-
usedCss[cssImports[i]] = true;
478-
css += "\n" + cssImports[i];
479-
}
480-
}
481-
});
482-
483-
css = extractImages(css, "main", ".").replace(/^\s*/gm, "");
484-
build.writeToFile({code: css}, {
485-
outputFolder: BUILD_DIR + "/css",
486-
outputFile: "ace.css"
487-
}, function() {
488-
saveImages();
489-
callback();
490-
});
491-
492-
function detectCssImports(code) {
493-
code = code.replace(/^\s*\/\/.+|^\s*\/\*[\s\S]*?\*\//gm, "");
494-
495-
var stringRegex = /^("(?:[^"\\]|\\[\d\D])*"|'(?:[^'\\]|\\[\d\D])*'|)/;
496-
var importCssRegex = /\.importCssString\(\s*(?:([^,)"']+)|["'])/g;
497-
498-
var match;
499-
var cssImports;
500-
while (match = importCssRegex.exec(code)) {
501-
if (match[1]) {
502-
var locationRegex = new RegExp("[^.]" + match[1] + /\s*=\s*['"]/.source);
503-
match = locationRegex.exec(code);
504-
if (!match) continue;
505-
}
506-
var index = match.index + match[0].length - 1;
507-
if (cssImports && cssImports[index]) continue;
508-
var cssString = stringRegex.exec(code.slice(index))[0];
509-
if (!cssString) continue;
510-
if (!cssImports) cssImports = {};
511-
cssImports[index] = cssString.slice(1, -1).replace(/\\(.|\n)/g, function(_, ch) {
512-
if (ch == "n") return "";
513-
return ch;
514-
});
515-
}
516-
return cssImports;
517-
}
518-
519-
function extractImages(css, name, directory) {
520-
var imageCounter = 0;
521-
return css.replace(
522-
/url\(\s*"data:([^"\\]|\\.)+"\s*\)|url\(\s*'data:([^'\\]|\\.)+'\s*\)|url\(data:[^)]+\)/g,
523-
function(url) {
524-
var data = url.slice(4, -1).trim();
525-
if (/["']/.test(data[0])) {
526-
data = data.slice(1, -1).replace(/\\(.)/g, "$1");
527-
}
528-
data = data.slice(5);
529-
var i = data.indexOf(",");
530-
if (i == -1) {
531-
console.error(url);
532-
return url;
533-
}
534-
var buffer = Buffer.from(data.slice(i + 1), "base64");
535-
imageCounter++;
536-
var imageName = name + "-" + imageCounter + ".png";
537-
images[imageName] = buffer;
538-
return "url(\"" + directory + "/" + imageName + "\")";
539-
}
540-
);
541-
}
542-
function saveImages() {
543-
for (var imageName in images) {
544-
fs.writeFileSync(BUILD_DIR + "/css/" + imageName, images[imageName]);
545-
}
546439
}
547440
}
548441

lib/ace/css/editor.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ styles.join("\n")
8383
bottom: 0;
8484
left: 0;
8585
cursor: default;
86-
z-index: 4;
8786
-ms-user-select: none;
8887
-moz-user-select: none;
8988
-webkit-user-select: none;
@@ -395,12 +394,13 @@ styles.join("\n")
395394
}
396395

397396
.ace_tooltip {
397+
background: var(--background-color);
398+
color: var(--text-color);
398399
background-color: #FFF;
399400
background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
400401
border: 1px solid gray;
401402
border-radius: 1px;
402403
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
403-
color: black;
404404
max-width: 100%;
405405
padding: 3px 4px;
406406
position: fixed;

lib/ace/mode/lsf.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,14 @@ define(function (require, exports, module) {
163163
token: "comment",
164164
regex: "\\/\\/.*$"
165165
},
166+
{
167+
token : "string",
168+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
169+
},
166170
{
167171
token: keywordMapper,
168172
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
169173
}
170-
],
171-
"comment": [
172-
{
173-
defaultToken: "comment"
174-
}
175174
]
176175
};
177176
};
@@ -183,6 +182,7 @@ define(function (require, exports, module) {
183182
oop.inherits(Mode, TextMode);
184183

185184
(function () {
185+
this.lineCommentStart = "//"; // this is need to "ctrl + /" hotkey worked correctly
186186
this.$id = "ace/mode/lsf";
187187

188188
var WorkerClient = require("../worker/worker_client").WorkerClient;

lib/ace/theme/ambiance.css

Lines changed: 12 additions & 17 deletions
Large diffs are not rendered by default.

lib/ace/theme/chrome.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111

1212
.ace-chrome {
13-
background-color: #FFFFFF;
14-
color: black;
13+
background: var(--component-background-color);
14+
color: var(--text-color);
1515
}
1616

1717
.ace-chrome .ace_cursor {
@@ -61,19 +61,19 @@
6161
color:#FD971F;
6262
}
6363
.ace-chrome .ace_keyword.ace_operator {
64-
color: rgb(104, 118, 135);
64+
color: #000080;
6565
}
6666

6767
.ace-chrome .ace_comment {
68-
color: #236e24;
68+
color: #808080;
6969
}
7070

7171
.ace-chrome .ace_comment.ace_doc {
72-
color: #236e24;
72+
color: #808080;
7373
}
7474

7575
.ace-chrome .ace_comment.ace_doc.ace_tag {
76-
color: #236e24;
76+
color: #808080;
7777
}
7878

7979
.ace-chrome .ace_constant.ace_numeric {
@@ -134,15 +134,15 @@
134134
.ace-chrome .ace_storage,
135135
.ace-chrome .ace_keyword,
136136
.ace-chrome .ace_meta.ace_tag {
137-
color: rgb(147, 15, 128);
137+
color: #000080;
138138
}
139139

140140
.ace-chrome .ace_string.ace_regex {
141-
color: rgb(255, 0, 0)
141+
color: #008000;
142142
}
143143

144144
.ace-chrome .ace_string {
145-
color: #1A1AA6;
145+
color: #008000;
146146
}
147147

148148
.ace-chrome .ace_entity.ace_other.ace_attribute-name {

0 commit comments

Comments
 (0)