Sha256: 6aef5211c6141fbc20c5f42cbd7df1ca468eb3129ee0374fdd646f8a25200e9c

Contents?: true

Size: 1.12 KB

Versions: 9

Compression:

Stored size: 1.12 KB

Contents

(function() {
  if (this.RedactorPlugins == null) {
    this.RedactorPlugins = {};
  }

  RedactorPlugins.scrivito_editors_image_manager = function() {
    var self;
    return self = {
      init: function() {
        return this.modal.addCallback('image', self.browse);
      },
      browse: function() {
        var filterContext;
        filterContext = $.extend({
          _image: true
        }, this.$element.data('scrivitoEditorsFilterContext'));
        return scrivito.content_browser.open({
          filter: this.$element.data('scrivitoEditorsFilter'),
          filter_context: filterContext,
          selection_mode: 'single'
        }).done((function(_this) {
          return function(selection) {
            var id;
            id = selection[0];
            if (id != null) {
              return self.insert(id);
            }
          };
        })(this)).always((function(_this) {
          return function() {
            return _this.modal.close();
          };
        })(this));
      },
      insert: function(id) {
        return this.image.insert("<img src='/" + id + "'>");
      }
    };
  };

}).call(this);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
scrivito_editors-1.0.0 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.0.0.rc4 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.0.0.rc3 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.0.0.rc2 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.0.0.rc1 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-0.90.0 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-0.90.0.rc3 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-0.90.0.rc2 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-0.90.0.rc1 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js