debian-mirror-gitlab/app/assets/javascripts/ci_lint_editor.js
2017-08-17 22:00:37 +05:30

17 lines
409 B
JavaScript

window.gl = window.gl || {};
class CILintEditor {
constructor() {
this.editor = window.ace.edit('ci-editor');
this.textarea = document.querySelector('#content');
this.editor.getSession().setMode('ace/mode/yaml');
this.editor.on('input', () => {
const content = this.editor.getSession().getValue();
this.textarea.value = content;
});
}
}
gl.CILintEditor = CILintEditor;