Sha256: 41d487444018a7edb220443b8007ce0a9870b3f9bce1f218a5e480c4f878eefc

Contents?: true

Size: 1001 Bytes

Versions: 6

Compression:

Stored size: 1001 Bytes

Contents

window.Editor = CKEDITOR

Editor.active = ->
  target = $('.editable-long-text')
  target.attr('contenteditable',true)
  target.effect('highlight', duration: 5000)
  for div in target
    CKEDITOR.inline(div)

Editor.deactive = ->
  $('.editable-long-text').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.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

6 entries across 6 versions & 2 rubygems

Version Path
nulogyrefineryfrontendeditor_ckeditor-0.0.5 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
nulogyrefineryfrontendeditor_ckeditor-0.0.4 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
frontendeditor_ckeditor-0.0.5 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
frontendeditor_ckeditor-0.0.4 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
frontendeditor_ckeditor-0.0.3 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
frontendeditor_ckeditor-0.0.1 vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee