Du musst kontrollieren, ob das ACE Skript ace.js ordnungsgemäß geladen und instanziiert wird:
HTML-Code:
<script>window.ace || document.write('<script src="assets/ace/1.1.9/ace.js" charset="utf-8">\x3C/script>')</script>
<script>
window.ace && window.addEvent('domready', function() {
var ta = document.getElementById('ctrl_source'),
dom = ace.require("ace/lib/dom");
// Create a div to apply the editor to
var div = document.createElement('div');
div.id = 'ctrl_source_div';
div.className = ta.get('class');
ta.parentNode.insertBefore(div, ta.nextSibling);
// Hide the textarea
ta.style['display'] = 'none';
// Instantiate the editor
var editor = ace.edit('ctrl_source_div');
editor.setTheme("ace/theme/clouds");
editor.renderer.setScrollMargin(3, 3, 0, 0);
editor.renderer.scrollBy(0, -6);
editor.getSession().setValue(ta.value);
editor.getSession().setMode("ace/mode/php");
editor.getSession().setUseSoftTabs(false);
editor.getSession().setUseWrapMode(true);
editor.setAutoScrollEditorIntoView(true);
// Add the fullscreen command
editor.commands.addCommand({
name: 'Fullscreen',
bindKey: 'F11',
exec: function(editor) {
dom.toggleCssClass(document.body, 'ace-fullsize');
editor.resize();
}
});
// Disable command conflicts with AltGr (see #5792)
editor.commands.bindKey('Ctrl-alt-a|Ctrl-alt-e|Ctrl-alt-h|Ctrl-alt-l|Ctrl-alt-s', null);
// Adjust the height of the editor
var updateHeight = function() {
var newHeight
= editor.getSession().getScreenLength()
* (editor.renderer.lineHeight || 14);
editor.container.style['height'] = Math.max(newHeight, editor.renderer.lineHeight) + 'px';
editor.resize();
};
editor.on('focus', function() {
Backend.getScrollOffset();
updateHeight();
});
editor.getSession().on('change', function() {
ta.value = editor.getValue();
updateHeight();
});
updateHeight();
});
</script>
Kannst Du das betreffende Skript im Browser direkt über https://example.com/assets/ace/1.1.9/ace.js aufrufen?