Skip to content

Commit 7aeab37

Browse files
committed
add missing file
1 parent 629a393 commit 7aeab37

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

webui/src/ace-editor/mode-ldif.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import ace from "ace-builds/src-noconflict/ace";
2+
3+
ace.define("ace/mode/ldif", function(require, exports) {
4+
const TextMode = require("ace/mode/text").Mode;
5+
const Tokenizer = require("ace/tokenizer").Tokenizer;
6+
const TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
7+
8+
// Proper highlight rules class
9+
class LdifHighlightRules extends TextHighlightRules {
10+
constructor() {
11+
super();
12+
this.$rules = {
13+
start: [
14+
{ token: "dn", regex: "^dn:.*$" },
15+
{ token: "keyword", regex: "^[a-zA-Z]+:" },
16+
{ token: "comment", regex: "^#.*$" },
17+
{ token: "text", regex: ".+" }
18+
]
19+
};
20+
}
21+
}
22+
23+
exports.Mode = class LdifMode extends TextMode {
24+
constructor() {
25+
super();
26+
this.HighlightRules = LdifHighlightRules;
27+
this.$id = "ace/mode/ldif";
28+
}
29+
};
30+
});

0 commit comments

Comments
 (0)