
With this commit, we change the delivery method for the ACE editor from manually copied files to using yarn and webpack. As a side-change, we also modify how the mode is selected through JavaScript instead of Ruby. Through webpack, the `modePath`, `themePath`, and `workerPath` are automatically determined and working as expected. Closes #250
15 lines
493 B
JavaScript
15 lines
493 B
JavaScript
(function() {
|
|
window.MarkdownEditor = function(selector) {
|
|
var editor = ace.edit($(selector).next()[0]);
|
|
editor.on('change', function() {
|
|
$(selector).val(editor.getValue());
|
|
});
|
|
editor.setShowPrintMargin(false);
|
|
editor.setTheme(CodeOceanEditor.THEME);
|
|
var session = editor.getSession();
|
|
session.setMode('ace/mode/markdown');
|
|
session.setUseWrapMode(true);
|
|
session.setValue($(selector).val());
|
|
};
|
|
})();
|