summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ci_lint_editor.js
blob: 56ffaa765a8cb1d5c3bc42c54d93231e3e504fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(() => {
  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;
})();