Sha256: 9b958f43b08f125d6ecfb7e4942251003d9d2507e410b6f6f45d6d7da45782b1

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

setupRedactor = (obj) ->
  # Default Options
  options =
    minHeight: 200
    plugins: ['table', 'video', 'fullscreen']
    toolbarFixed: false
    replaceDivs: false

  if fileUploader.uploaders && fileUploader.uploaders.embedded_image
    options.imageUpload = fileUploader.uploaders.embedded_image

  # Initialize redactor
  obj.redactor(options)

window.setupRedactorEditorsUnder = (obj) ->
  # Initialize redactor on items with the class 'redactor'
  $(obj).find("textarea.redactor:enabled").each (i) ->
    # Don't setup redactor if the textarea inherits from a "framework" item.
    #   framework items are hidden and are used to add new items to a form array.
    # If it inherits from .redactor-box that means it has already been initialized.
    unless $(this).parents('.framework, .redactor-box').length > 0
      setupRedactor($(this))

$(document).ready ->
  # Run on startup
  setupRedactorEditorsUnder('body')

  # Run when modals open
  $(".modal").on "shown.bs.modal", (e) ->
    setupRedactorEditorsUnder('.modal')

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
biola_wcms_components-0.25.4 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.25.3 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.25.2 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.25.1 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.25.0 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.24.3 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.24.2 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.24.1 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.24.0 app/assets/javascripts/configuration/setup_redactor.js.coffee
biola_wcms_components-0.23.0 app/assets/javascripts/configuration/setup_redactor.js.coffee