Sha256: d2e33423b9c78eb5f80798fb8a1deb7123632d72a29ef13290139a656ab76463

Contents?: true

Size: 1.14 KB

Versions: 87

Compression:

Stored size: 1.14 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='" + (scrivito.path_for_id(id)) + "'>");
      }
    };
  };

}).call(this);

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
scrivito_editors-1.2.0.rc2 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.2.0.rc1 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.1.1 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.1.0 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.1.0.rc3 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.1.0.rc2 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js
scrivito_editors-1.1.0.rc1 app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js