Php 将codemirror与elfinder一起使用时,主题不起作用
我正在将elfinder与codemirror编辑器一起使用。当我在没有elfinder的情况下使用codemirror主题时,它工作得很好。但在elfinder主题中不起作用。以下是我使用的代码:Php 将codemirror与elfinder一起使用时,主题不起作用,php,codemirror,elfinder,Php,Codemirror,Elfinder,我正在将elfinder与codemirror编辑器一起使用。当我在没有elfinder的情况下使用codemirror主题时,它工作得很好。但在elfinder主题中不起作用。以下是我使用的代码: $(document).ready(function() { $('#elfinder').elfinder({ url: 'path of connector file' // add more options here commandsOptions: { edit: { mime
$(document).ready(function() {
$('#elfinder').elfinder({
url: 'path of connector file'
// add more options here
commandsOptions: {
edit: {
mimes: ['text/plain', 'text/html', 'text/javascript','text/css','application/x-httpd-php'],
editors: [{
mimes: ['text/plain', 'text/html', 'text/javascript','text/css','application/x-httpd-php'],
load: function(textarea) {
var mimeType = this.file.mime;
return CodeMirror.fromTextArea(textarea, {
mode: mimeType,
lineNumbers: true,
indentUnit: 4,
theme: "dracula",
styleActiveLine: true,
matchBrackets: true,
});
},
save: function(textarea, editor) {
$(textarea).val(editor.getValue());
}
}]
}
}
});
});
我已经包含了所有需要的css文件。请帮助解释为什么主题不起作用。我正在解决这个问题。事实上,问题出在MIME中。现在,woeking代码是:
$(document).ready(function() {
$('#elfinder').elfinder({
url: 'path of connector file'
// add more options here
commandsOptions: {
edit: {
editors: [{
mimes: [],
load: function(textarea) {
var mimeType = this.file.mime;
return CodeMirror.fromTextArea(textarea, {
mode: mimeType,
lineNumbers: true,
indentUnit: 4,
theme: "dracula",
styleActiveLine: true,
matchBrackets: true,
});
},
save: function(textarea, editor) {
$(textarea).val(editor.getValue());
}
}]
}
}
});
});