Welcome to mirror list, hosted at ThFree Co, Russian Federation.

new_blob.js.coffee « blob « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f36a53f1917ce74ce32cb6aa69ec9e6ebc4f1fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class @NewBlob
  constructor: (assets_path, mode)->
    ace.config.set "modePath", assets_path + '/ace'
    ace.config.loadModule "ace/ext/searchbox"
    if mode
      ace_mode = mode
    editor = ace.edit("editor")
    editor.focus()
    @editor = editor

    if ace_mode
      editor.getSession().setMode "ace/mode/" + ace_mode

    $(".js-commit-button").click ->
      $("#file-content").val editor.getValue()
      $(".file-editor form").submit()
      return false

  editor: ->
    return @editor