<commit_before># read-more.rb
#
# Copyright (c) 2011 <NAME> <<EMAIL>>
#
# ! Requirements
# * quote_page plugin(quote_page.rb)
# * jQuery plugin(jquery.rb)
#
# ! Usage
# # Create a page which has a content to be hidden, let name of the page 'MoreText'.
# # In another page, call read more plugin like this:
# <<<
# {{read_more(MoreText)}}
# >>>
@read_more_count = 0

def read_more(page)
  @read_more_count += 1
  <<EOQ
  <div class="read-more" style="display: none;">
#{quote_page(page)}
  </div>
  <a href="#" class="read-more">#{read_more_show_label}</a>
EOQ
end

add_footer_proc do
  <<EOS
<script type="text/javascript">
  jQuery.fn.readMoreToggleText = function (first, second) {
    return this.text(this.text() == first ? second : first);
  };
  (function ($) {
    $('a.read-more').click(function (event) {
      event.preventDefault();
      var anchor = $(event.target);
      anchor.prev('.read-more').slideToggle('normal', function () {
        anchor.readMoreToggleText('#{read_more_show_label}', '#{read_more_hide_label}')
      });
    });
  })(jQuery);
</script>
EOS
end<commit_msg>read-more.rb: add div as container<commit_after># read-more.rb
#
# Copyright (c) 2011 <NAME> <<EMAIL>>
#
# ! Requirements
# * quote_page plugin(quote_page.rb)
# * jQuery plugin(jquery.rb)
#
# ! Usage
# # Create a page which has a content to be hidden, let name of the page 'MoreText'.
# # In another page, call read more plugin like this:
# <<<
# {{read_more(MoreText)}}
# >>>
@read_more_count = 0

def read_more(page)
  @read_more_count += 1
  <<EOQ
  <div>
    <div class="read-more" style="display: none;">
#{quote_page(page)}
    </div>
    <a href="?#{page}" class="read-more">#{read_more_show_label}</a>
  </div>
EOQ
end

add_footer_proc do
  <<EOS
<script type="text/javascript">
  jQuery.fn.readMoreToggleText = function (first, second) {
    return this.text(this.text() == first ? second : first);
  };
  (function ($) {
    $('a.read-more').click(function (event) {
      event.preventDefault();
      var anchor = $(event.target);
      anchor.prev('.read-more').slideToggle('normal', function () {
        anchor.readMoreToggleText('#{read_more_show_label}', '#{read_more_hide_label}')
      });
    });
  })(jQuery);
</script>
EOS
end
{'fraction_non_alphanumeric': 0.1821826280623608, 'fraction_numerical': 0.005345211581291759, 'mean_word_length': 4.0358744394618835, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 29, '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': '1969855', 'n_tokens_mistral': 803, 'n_tokens_neox': 795, 'n_words': 177}