Sha256: 6b63c2fb11e2a36bc3d782d1dd72a4ee65f944ed6c3beb6803e80dd2709c9099

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

pageflow.PageType = pageflow.Object.extend({
  initialize: function(name, options, seed) {
    this.name = name;
    this.options = options;
    this.seed = seed;
  },

  translationKey: function() {
    return this.seed.translation_key;
  },

  thumbnailCandidates: function() {
    return this.seed.thumbnail_candidates;
  },

  pageLinks: function(configuration) {
    if ('pageLinks' in this.options) {
      return this.options.pageLinks(configuration);
    }
  },

  configurationEditorView: function() {
    return this.options.configurationEditorView ||
      pageflow.ConfigurationEditorView.repository[this.name];
  },

  embeddedViews: function() {
    return this.options.embeddedViews;
  },

  createConfigurationEditorView: function(options) {
    var constructor = this.configurationEditorView();
    options.pageType = this.seed;

    return new constructor(_.extend({
      attributeTranslationKeyPrefixes: [
        this.seed.translation_key_prefix + '.page_attributes',
        'pageflow.common_page_attributes'
      ]
    }, options));
  }
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pageflow-0.9.2 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.9.1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.9.0 app/assets/javascripts/pageflow/editor/api/page_type.js