LP#1424815: jQuery implmentation of See More for notes
authorKathy Lussier <klussier@masslnc.org>
Thu, 31 Aug 2017 15:49:38 +0000 (11:49 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 12 Jun 2018 19:38:41 +0000 (15:38 -0400)
commit9c0142885faf0c64254708821893ed92323b0310
treea9d648ecec5dee7414dd428d3c8d402cbd893c27
parent50cf57d5eb34d47e18417ac7c6b8f5563a453431
LP#1424815: jQuery implmentation of See More for notes

Because the anchor approach was a little clunky, this approach uses jQuery to
provide a "Read More" button for long contents on the record details page. We
still use jlitrell's perl work to generate the strings and then use jQuery to
change the div class when the button is clicked.

A new setting will allow Evergreen sites to truncate the display of long note
fields in the public catalog. When truncated, a _Read More..._ link will
appear at the end of the field, allowing the user to click to view the entire
field contents.

Since jQuery is turned off by default, I also turned off this feature by default
since both settings need to be enabled for this feature to work. To enable it:

  * Enable the ctx.want_jquery setting in the config.tt2 file.
  * Enable the truncate_contents setting in the config.tt2 file.
  * In config.tt2, adjust the contents_truncate_length setting to set the
number of characters that should display before the field is truncated (default
is 100).

A fallback is provided for browsers that have disabled javascript.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1424815: Make the button pretty and add options

Make the button look like a link and add options for use of this feature in
config.tt2. Also adds a fallback for browsers that don't have javascript
enabled.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Conflicts:
Open-ILS/src/templates/opac/parts/record/contents.tt2
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/js.tt2
Open-ILS/src/templates/opac/parts/record/contents.tt2