Sha256: 0286fea1ede62454f08917e4831c2535e73650ecde9411faa290539288389fce

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

window.Editor = CKEDITOR

Editor.active = ->
  @el().attr('contenteditable',true)
  @el().effect('highlight', duration: 5000)
  for div in @el()
    CKEDITOR.inline(div)

Editor.deactive = ->
  @el().attr('contenteditable', false)
  $.each(CKEDITOR.instances, (key, editor) ->
    editor.destroy()
  )

Editor.commitAll = ->
  $.each(CKEDITOR.instances, (key, editor) ->
    dataset = editor.container.$.dataset
    model = FrontendEditor.getCurrentModel(dataset.object)
    model.id = dataset.id
    model.set(dataset.attribute, editor.getData())
  )

Editor.el = ->
  $('.editable-long-text')

Editor.on('instanceCreated', ( event ) ->
  editor = event.editor
  element = editor.element
  editor.on('configLoaded', () ->
    editor.config.toolbarGroups = [
      { name: 'editing',    groups: [ 'basicstyles', 'links' ] }
      { name: 'styles' }
      '/'
      { name: 'undo' }
      { name: 'clipboard',  groups: [ 'selection', 'clipboard' ] }
      { name: 'insert' }
    ]
  )
)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frontendeditor_ckeditor-0.0.7 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee