Skip to content

Commit 629a393

Browse files
committed
add color highlight for ldif
fix color highlight in light mode
1 parent 87cf683 commit 629a393

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

webui/src/ace-editor/ace-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'ace-builds/src-noconflict/mode-yaml'
55
import 'ace-builds/src-noconflict/mode-javascript'
66
import '@/ace-editor/ace-theme-mokapi-dark.js'
77
import '@/ace-editor/ace-theme-mokapi-light.js'
8-
8+
import '@/ace-editor/mode-ldif.js'
99

1010
// ace.config.setModuleUrl('ace/mode/json', modeJsonUrl)
1111
// ace.config.setModuleUrl('ace/mode/xml', xmlUrl)

webui/src/assets/ace-mokapi.css

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.yaml .ace_tag {
18-
color:rgb(126, 231, 135);
18+
color:rgb(0, 102, 51);
1919
}
2020
.yaml .ace-mokapi-dark {
2121
color: rgb(165, 214, 255);
@@ -111,4 +111,28 @@
111111

112112
.hex .ace_hex, .hex .ace_hex-alt {
113113
padding-right: 8px;
114+
}
115+
116+
/* ldif */
117+
.ldif .ace-mokapi-dark .ace_keyword {
118+
color: rgb(126, 231, 135)
119+
}
120+
.ldif .ace-mokapi-light .ace_keyword {
121+
color:rgb(0, 102, 51);
122+
}
123+
.ldif .ace-mokapi-dark .ace_dn {
124+
color: rgb(135, 206, 235);
125+
font-weight: bold;
126+
}
127+
.ldif .ace-mokapi-light .ace_dn {
128+
color:rgb(0, 102, 204);
129+
font-weight: bold;
130+
}
131+
.ldif .ace-mokapi-dark .ace_comment {
132+
color: rgb(150, 150, 150);
133+
font-style: italic;
134+
}
135+
.ldif .ace-mokapi-light .ace_comment {
136+
color: rgb(128, 128, 128);
137+
font-style: italic;
114138
}

webui/src/composables/usePrettyLanguage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export function usePrettyLanguage() {
4141
case 'json':
4242
case 'problem+json':
4343
return 'json'
44+
case 'ldif':
45+
return 'ldif'
4446
}
4547

4648
switch (contentType) {
@@ -70,6 +72,8 @@ export function usePrettyLanguage() {
7072
return 'text/javascript'
7173
case '.ts':
7274
return 'text/typescript'
75+
case '.ldif':
76+
return 'application/ldif'
7377
default:
7478
return null
7579
}

0 commit comments

Comments
 (0)