Sha256: 5284afbd49b58250010fbfdc11e1a85bb124215d86087a6fe9581ce2a1468d15

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

view = Luca.register      "Docs.views.CodeEditor"
view.extends              "Luca.View"

view.privateConfiguration
  tagName: "textarea"

view.publicConfiguration
  # CodeMirror option.  This will control which theme is applied
  # to the editor.  Make sure the CSS for this theme has been loaded.
  theme: "twilight"

  # How many spaces a block should be indented.
  indentUnit: 2

  # Whether to use the context-sensitive indentation that the mode provides 
  smartIndent: true

  # Which language will we be editing? Support for coffeescript, 
  # html, javascript, css, sass, less come out of the box
  mode: "coffeescript" 

  # which keymap to use? default, or vim 
  keyMap: "default"

  # whether or not to wrap lines when they reach past the set limit
  lineWrapping: false

view.privateConfiguration
  codeMirrorOptions: {}
  codeMirrorConfigKeys:[
    "theme"
    "indentUnit"
    "smartIndent"
    "mode"
    "keyMap"
    "lineWrapping"
  ]

view.privateMethods  
  afterRender: ()->
    defaults = _(@).pick( @codeMirrorConfigKeys... )
    options = _(@codeMirrorOptions).defaults(defaults)
    @codeMirror = window.CodeMirror.fromTextArea( @$el[0], options)

view.register()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
luca-0.9.91 site/source/app/assets/javascripts/docs/views/components/code_editor.coffee
luca-0.9.9 site/source/app/assets/javascripts/docs/views/components/code_editor.coffee