<commit_before>pageflow.PagePreviewView = Backbone.Marionette.View.extend({
  tagName: 'section',
  className: 'page',

  modelEvents: {
    'change:template': 'updateTemplate',

    'change:configuration': 'update',

    'change:position': 'updateChapterBeginningClass',

    'sync': function() {
      this.$el.attr('data-id', this.model.id);
      this.$el.attr('data-perma-id', this.model.get('perma_id'));
    }
  },

  events: {
    pageactivate: function() {
      this.model.set('active', true);
    },

    pagedeactivate: function() {
      this.model.set('active', false);
    }
  },

  render: function() {
    this.$el.html(this.pageTemplate());
    this.$el.attr('data-id', this.model.id);
    this.$el.attr('data-perma-id', this.model.get('perma_id'));
    this.$el.data('template', this.model.get('template'));
    this.$el.data('configuration', this.model.get('configuration'));

    this.$el.page();
    this.updateChapterBeginningClass();
    this.update();
    this.$el.page('reactivate');

    this.initEmbeddedViews();

    return this;
  },

  updateTemplate: function() {
    this.$el.page('cleanup');

    this.$el.html(this.pageTemplate());
    this.$el.attr('data-id', this.model.id);
    this.$el.attr('data-perma-id', this.model.get('perma_id'));
    this.$el.data('template', this.model.get('template'));
    this.$el.data('configuration', this.model.get('configuration'));

    this.$el.page('reinit');
    this.updateChapterBeginningClass();
    this.update();
    this.$el.page('reactivate');

    this.initEmbeddedViews();
  },

  update: function() {<commit_msg>Ensure current Configuration is passed to Page Types in Editor<commit_after>pageflow.PagePreviewView = Backbone.Marionette.View.extend({
  tagName: 'section',
  className: 'page',

  modelEvents: {
    'change:template': 'updateTemplate',

    'change:configuration': 'update',

    'change:position': 'updateChapterBeginningClass',

    'sync': function() {
      this.$el.attr('data-id', this.model.id);
      this.$el.attr('data-perma-id', this.model.get('perma_id'));
    }
  },

  events: {
    pageactivate: function() {
      this.model.set('active', true);
    },

    pagedeactivate: function() {
      this.model.set('active', false);
    }
  },

  render: function() {
    this.$el.html(this.pageTemplate());
    this.$el.attr('data-id', this.model.id);
    this.$el.attr('data-perma-id', this.model.get('perma_id'));
    this.$el.data('template', this.model.get('template'));
    this.$el.data('configuration', this.model.get('configuration'));

    this.$el.page();
    this.updateChapterBeginningClass();
    this.update();
    this.$el.page('reactivate');

    this.initEmbeddedViews();

    return this;
  },

  updateTemplate: function() {
    this.$el.page('cleanup');

    this.$el.html(this.pageTemplate());
    this.$el.data('template', this.model.get('template'));

    this.$el.page('reinit');
    this.updateChapterBeginningClass();
    this.update();
    this.$el.page('reactivate');

    this.initEmbeddedViews();
  },

  update: function() {
{'fraction_non_alphanumeric': 0.19771615008156607, 'fraction_numerical': 0.0, 'mean_word_length': 3.610526315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5043914', 'n_tokens_mistral': 1025, 'n_tokens_neox': 981, 'n_words': 133}