Sha256: 34fa332454121a83e2f96da2706f603016182821520121041780d6369b666374

Contents?: true

Size: 1.44 KB

Versions: 31

Compression:

Stored size: 1.44 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));
  },

  createPageLinkConfigurationEditorView: function(options) {
    var constructor = this.options.pageLinkConfigurationEditorView ||
      pageflow.PageLinkConfigurationEditorView;

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
pageflow-0.11.4 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc5 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc4 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc3 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc2 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.11.3 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.11.2 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.11.1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.11.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-0.10.0 app/assets/javascripts/pageflow/editor/api/page_type.js