Sha256: dd00057e1c37e035b1db057f3b5e8138771ca10a423d7466759916c4c90309b0

Contents?: true

Size: 1.45 KB

Versions: 24

Compression:

Stored size: 1.45 KB

Contents

pageflow.PreviewEntryData = pageflow.EntryData.extend({
  initialize: function(options) {
    this.entry = options.entry;
    this.storylines = options.storylines;
    this.chapters = options.chapters;
    this.pages = options.pages;
  },

  getThemingOption: function(name) {
    return this.entry.getTheme().get(name);
  },

  getFile: function(collectionName, id) {
    var file = this.entry.getFileCollection(collectionName).get(id);
    return file && file.attributes;
  },

  getStorylineConfiguration: function(id) {
    var storyline = this.storylines.get(id);
    return storyline ? storyline.configuration.attributes : {};
  },

  getChapterConfiguration: function(id) {
    var chapter = this.chapters.get(id);
    return chapter ? chapter.configuration.attributes : {};
  },

  getChapterPagePermaIds: function(id) {
    var chapter = this.chapters.get(id);
    return chapter ? chapter.pages.pluck('perma_id') : [];
  },

  getStorylineIdByChapterId: function(id) {
    var chapter = this.chapters.get(id);
    return chapter && chapter.get('storyline_id');
  },

  getChapterIdByPagePermaId: function(permaId) {
    var page = this.pages.getByPermaId(permaId);
    return page && page.get('chapter_id');
  },

  getPageConfiguration: function(permaId) {
    var page = this.pages.getByPermaId(permaId);
    return page ? page.configuration.attributes : {};
  },

  getPagePosition: function(permaId) {
    return this.pages.indexOf(this.pages.getByPermaId(permaId));
  }
});

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.5.1 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.5.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.4.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.3.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.2.1 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.2.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.1.1 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.1.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0.rc2 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0.rc1 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0.beta3 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0.beta2 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-14.0.0.beta1 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-13.6.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-13.5.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-13.4.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-13.3.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js
pageflow-13.2.0 app/assets/javascripts/pageflow/editor/models/preview_entry_data.js