"use strict"; AUI().ready('aui-ace-editor', function(A) { var editor = new A.AceEditor({ boundingBox: '#editor', // highlightActiveLine: false, // readOnly: true, // tabSize: 8, // useSoftTabs: true, // useWrapMode: true, // showPrintMargin: false, mode: 'php', value: '<#assign portlet_display = portletDisplay />\n' + '<#assign portlet_id = htmlUtil.escapeAttribute(portlet_display.getId()) />\n' + '<#assign portlet_title = portlet_display.getTitle() />\n' + '<#assign portlet_back_url = htmlUtil.escapeAttribute(portlet_display.getURLBack()) />\n' + '
\n' + '
\n' + '

\n' + ' ${theme.iconPortlet()} ${portlet_title}\n' + '

\n' + ' \n' + ' <#if portlet_display.isShowBackIcon()>\n' + ' <@liferay.language key="return-to-full-page" />\n' + ' <#else>\n' + ' ${theme.iconOptions()}' + ' ${theme.iconMinimize()}' + ' ${theme.iconMaximize()}' + ' ${theme.iconClose()}' + ' \n' + ' \n' + '
\n' + '
\n' + ' ${portlet_display.writeContent(writer)}' + '
\n' + '
' }).render(); // editor.getEditor().setTheme('ace/theme/cobalt'); //editor.set('mode', 'javascript'); // editor.set('mode', 'json'); // editor.set('mode', 'xml'); var mode = A.one('#mode'); if (mode) { var currentMode = 'javascript'; mode.on('change', function(event) { currentMode = this.val(); editor.set('mode', currentMode); }); } // editor.set('value', 'Change the original content'); });