Rename .js.erb files .js
Since we switched to more I18n-JS and JsRoute functions with f5739a33 and 2f03061f, we don't have the need to use a template engine for those files any longer.
This commit is contained in:

committed by
Sebastian Serth

parent
5b35ccdfe8
commit
60dad19ea5
17
app/assets/javascripts/markdown_ace_editor.js
Normal file
17
app/assets/javascripts/markdown_ace_editor.js
Normal file
@@ -0,0 +1,17 @@
|
||||
(function() {
|
||||
window.MarkdownEditor = function(selector) {
|
||||
_.each(['modePath', 'themePath', 'workerPath'], function (attribute) {
|
||||
ace.config.set(attribute, CodeOceanEditor.ACE_FILES_PATH);
|
||||
}.bind(this));
|
||||
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());
|
||||
};
|
||||
})();
|
Reference in New Issue
Block a user