Sha256: e3e627dbac1c8b32a56258fb6d6180e52bb35a36ef1cb57a7829bbc20cfbc32e

Contents?: true

Size: 1.8 KB

Versions: 16

Compression:

Stored size: 1.8 KB

Contents

'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

scrivito.editors.ControllerContentProxy = (function () {
  function ControllerContentProxy(domNode, controller) {
    _classCallCheck(this, ControllerContentProxy);

    this.domNode = domNode;
    this.controller = controller;
  }

  _createClass(ControllerContentProxy, [{
    key: 'content',
    value: function content() {
      return this.controller.content;
    }
  }, {
    key: 'idFromPath',
    value: function idFromPath(path) {
      if (path.match(/^objid:/)) {
        return path.replace(/^objid:/, '');
      }
    }
  }, {
    key: 'jQueryElement',
    value: function jQueryElement() {
      return $(this.domNode);
    }
  }, {
    key: 'pathForId',
    value: function pathForId(id) {
      return 'objid:' + id;
    }
  }, {
    key: 'save',
    value: function save(content) {
      this.controller.content = content;
      var promise = { done: function done(callback) {
          callback();return promise;
        } };
      return promise;
    }
  }, {
    key: 'trigger',
    value: function trigger(event) {
      // ignore
    }
  }]);

  return ControllerContentProxy;
})();

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
scrivito_editors-1.10.0 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.10.0.rc5 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.10.0.rc4 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.10.0.rc3 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.10.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.10.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.9.1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.9.1.rc1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.9.0 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.9.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.9.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.8.1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.8.1.rc1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.8.0 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.8.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js
scrivito_editors-1.8.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/controller_content_proxy.js