<commit_before>dc.ui.ViewerControlPanel = dc.View.extend({

  id : 'control_panel',

  callbacks : [
    ['.bookmark_page',      'click',    'bookmarkCurrentPage'],
    ['.set_sections',       'click',    'openSectionEditor'],
    ['.public_annotation',  'click',    'togglePublicAnnotation'],
    ['.private_annotation', 'click',    'togglePrivateAnnotation'],
    ['.save_text',          'click',    'savePageText']
  ],

  render : function() {
    this._page = $('#DV-textContents');
    $(this.el).html(JST.viewer_control_panel({isOwner : dc.app.editor.isOwner}));
    this.setCallbacks();
    return this;
  },

  openSectionEditor : function() {
    dc.app.editor.sectionEditor.open();
  },

  togglePublicAnnotation : function() {
    dc.app.editor.annotationEditor.toggle('public');
  },

  togglePrivateAnnotation : function() {
    dc.app.editor.annotationEditor.toggle('private');
  },

  savePageText : function() {
    var url = '/documents/' + dc.app.editor.docId + '/p' + DV.api.currentPage() + '.txt';
    var text = this._page.textWithNewlines();
    $.ajax({url : url, type : 'POST', data : {text : text}, dataType : 'json'});
    dc.app.editor.notify({mode : 'info', text : 'page saved'});
  },<commit_msg>fixing the JS url to save page text<commit_after>dc.ui.ViewerControlPanel = dc.View.extend({

  id : 'control_panel',

  callbacks : [
    ['.bookmark_page',      'click',    'bookmarkCurrentPage'],
    ['.set_sections',       'click',    'openSectionEditor'],
    ['.public_annotation',  'click',    'togglePublicAnnotation'],
    ['.private_annotation', 'click',    'togglePrivateAnnotation'],
    ['.save_text',          'click',    'savePageText']
  ],

  render : function() {
    this._page = $('#DV-textContents');
    $(this.el).html(JST.viewer_control_panel({isOwner : dc.app.editor.isOwner}));
    this.setCallbacks();
    return this;
  },

  openSectionEditor : function() {
    dc.app.editor.sectionEditor.open();
  },

  togglePublicAnnotation : function() {
    dc.app.editor.annotationEditor.toggle('public');
  },

  togglePrivateAnnotation : function() {
    dc.app.editor.annotationEditor.toggle('private');
  },

  savePageText : function() {
    var url = '/documents/' + dc.app.editor.docId + '/pages/' + DV.Schema.document.id + '-p' + DV.api.currentPage() + '.txt';
    var text = this._page.textWithNewlines();
    $.ajax({url : url, type : 'POST', data : {text : text}, dataType : 'json'});
    dc.app.editor.notify({mode : 'info', text : 'page saved'});
  },
{'fraction_non_alphanumeric': 0.18605577689243027, 'fraction_numerical': 0.0, 'mean_word_length': 3.413005272407733, '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': '4115373', 'n_tokens_mistral': 816, 'n_tokens_neox': 794, 'n_words': 137}