<commit_before><% provide :page_title, @title || "Title" %>
<% provide :body do %>
<div id="epub">
  <div id="reader"></div>
  <script type="text/javascript">
    var reader = cozy.reader('reader', { href: "<%= "#{main_app.epub_url}/#{params[:id]}" %>" });
    cozy.control.widget({
      region: 'top.header.left',
      template: `<div class="btn btn-default"><span class="u-screenreader">Close</span><form><input data-slot="title" type="button" id="close" value="" readonly="readonly" onclick='window.location = "<%= "#{@back_link}" %>";'></form></div>`,
      states: [{
        stateName: 'close',
        title: "X"
      }]
    }).addTo(reader);
    cozy.control.title({ region: 'top.header.left' }).addTo(reader);
    cozy.control.contents({ region: 'top.toolbar.left' }).addTo(reader);
    cozy.control.widget({
        region: 'top.toolbar.left',
        template: `<div class="permalink-label"><span class="u-screenreader">Permalink</span><form><input data-slot="title" type="text" id="permalink" value="" readonly="readonly" onclick="this.select(); document.execCommand('copy');"></form></div>`,
        states: [{
            stateName: 'doi',
            title: "<%= @citable_link %>"
        }]
    }).addTo(reader);
    cozy.control.preferences({ region: 'top.header.right' }).addTo(reader);
    // cozy.control.pageFirst({ region: 'left.sidebar' }).addTo(reader);
    cozy.control.pagePrevious({ region: 'left.sidebar' }).addTo(reader);
    cozy.control.pageNext({ region: 'right.sidebar' }).addTo(reader);
    // cozy.control.pageLast({ region: 'right.sidebar' }).addTo(reader);
    cozy.control.publicationMetadata({ region: 'bottom.footer' }).addTo(reader);
    reader.start();
  </script>
</div>
<% end %>
<%= render template: 'layouts/boilerplate' %><commit_msg>update cozy widgets to use new syntax; adjust position of cozy preferences icon<commit_after><% provide :page_title, @title || "Title" %>
<% provide :body do %>
<div id="epub">
  <div id="reader"></div>
  <script type="text/javascript">
    var reader = cozy.reader('reader', { href: "<%= "#{main_app.epub_url}/#{params[:id]}" %>" });
    cozy.control.widget.button({
	    region: 'top.header.left',
	    data: { label: 'Close' },
	    onClick: function() { window.location = "<%= "#{@back_link}" %>"; }
    }).addTo(reader);
    cozy.control.title({ region: 'top.header.left' }).addTo(reader);
    cozy.control.contents({ region: 'top.toolbar.left' }).addTo(reader);
    cozy.control.widget.panel({
        region: 'top.toolbar.left',
        template: `<div class="permalink-label"><span class="u-screenreader">Permalink</span><form><input data-slot="title" type="text" id="permalink" value="" readonly="readonly" onclick="this.select(); document.execCommand('copy');"></form></div>`,
        states: [{
            stateName: 'doi',
            title: "<%= @citable_link %>"
        }]
    }).addTo(reader);
    cozy.control.preferences({ region: 'top.toolbar.right' }).addTo(reader);
    // cozy.control.pageFirst({ region: 'left.sidebar' }).addTo(reader);
    cozy.control.pagePrevious({ region: 'left.sidebar' }).addTo(reader);
    cozy.control.pageNext({ region: 'right.sidebar' }).addTo(reader);
    // cozy.control.pageLast({ region: 'right.sidebar' }).addTo(reader);
    cozy.control.publicationMetadata({ region: 'bottom.footer' }).addTo(reader);
    reader.start();
  </script>
</div>
<% end %>
<%= render template: 'layouts/boilerplate' %>
{'fraction_non_alphanumeric': 0.21682188591385332, 'fraction_numerical': 0.0, 'mean_word_length': 4.03958944281525, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 50, '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': '3718255', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1099, 'n_words': 201}