Dashboard sipadu mbip
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ace-editor-custom.js 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. "use strict";
  2. AUI().ready('aui-ace-editor', function(A) {
  3. var editor = new A.AceEditor({
  4. boundingBox: '#editor',
  5. // highlightActiveLine: false,
  6. // readOnly: true,
  7. // tabSize: 8,
  8. // useSoftTabs: true,
  9. // useWrapMode: true,
  10. // showPrintMargin: false,
  11. mode: 'php',
  12. value: '<#assign portlet_display = portletDisplay />\n' +
  13. '<#assign portlet_id = htmlUtil.escapeAttribute(portlet_display.getId()) />\n' +
  14. '<#assign portlet_title = portlet_display.getTitle() />\n' +
  15. '<#assign portlet_back_url = htmlUtil.escapeAttribute(portlet_display.getURLBack()) />\n' +
  16. '<section class="portlet" id="portlet_${portlet_id}">\n' +
  17. ' <header class="portlet-topper">\n' +
  18. ' <h1 class="portlet-title">\n' +
  19. ' ${theme.iconPortlet()} <span class="portlet-title-text">${portlet_title}</span>\n' +
  20. ' </h1>\n' +
  21. ' <menu class="portlet-topper-toolbar" id="portlet-topper-toolbar_${portlet_id}" type="toolbar">\n' +
  22. ' <#if portlet_display.isShowBackIcon()>\n' +
  23. ' <a href="${portlet_back_url}" class="portlet-icon-back"><@liferay.language key="return-to-full-page" /></a>\n' +
  24. ' <#else>\n' +
  25. ' ${theme.iconOptions()}' +
  26. ' ${theme.iconMinimize()}' +
  27. ' ${theme.iconMaximize()}' +
  28. ' ${theme.iconClose()}' +
  29. ' </#if>\n' +
  30. ' </menu>\n' +
  31. ' </header>\n' +
  32. ' <div class="portlet-content">\n' +
  33. ' ${portlet_display.writeContent(writer)}' +
  34. ' </div>\n' +
  35. '</section>'
  36. }).render();
  37. // editor.getEditor().setTheme('ace/theme/cobalt');
  38. //editor.set('mode', 'javascript');
  39. // editor.set('mode', 'json');
  40. // editor.set('mode', 'xml');
  41. var mode = A.one('#mode');
  42. if (mode) {
  43. var currentMode = 'javascript';
  44. mode.on('change', function(event) {
  45. currentMode = this.val();
  46. editor.set('mode', currentMode);
  47. });
  48. }
  49. // editor.set('value', 'Change the original content');
  50. });