Sha256: bf4ee9c731fb23020e63a17607e1f50f51d7cbae0e341fb403721687be438802

Contents?: true

Size: 616 Bytes

Versions: 12

Compression:

Stored size: 616 Bytes

Contents

# https://imperavi.com/article/

uploadActiveStorage = (editor, data) ->
  for file in data.files
    upload = new ActiveStorage.DirectUpload(file, '/rails/active_storage/direct_uploads')

    upload.create (error, blob) =>
      url = '/rails/active_storage/blobs/redirect/' + blob.signed_id + '/' + blob.filename
      editor.complete({ file: { url: url }}, data.e)

(this.EffectiveBootstrap || {}).effective_article_editor = ($element, options) ->

  if options['active_storage']
    options['image'] = {
      upload: (editor, data) -> uploadActiveStorage(editor, data)
    }

  ArticleEditor($element, options)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.40 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.39 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.38 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.37 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.36 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.35 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.34 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.33 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.32 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.31 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.30 app/assets/javascripts/effective_article_editor/initialize.js.coffee
effective_bootstrap-0.9.29 app/assets/javascripts/effective_article_editor/initialize.js.coffee