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-12.6.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.5.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.4.1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.4.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.3.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta6 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta5 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta4 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta3 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta2 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-13.0.0.beta1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.2.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.1.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.4 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.3 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.2 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.1 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc7 app/assets/javascripts/pageflow/editor/api/page_type.js
pageflow-12.0.0.rc6 app/assets/javascripts/pageflow/editor/api/page_type.js