Sha256: 50ee5fe70f3433e01ab373c85b0476c91ba0879b4273ec435d555c26b6dda0fd

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

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.extraPlugins = 'sourcedialog'
    editor.config.toolbarGroups = [
      { name: 'source',    groups: [ 'sourcedialog' ] }
      { 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.8 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee