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)
committerRemington Steed <rjs7@calvin.edu>
Fri, 23 Feb 2018 21:58:03 +0000 (16:58 -0500)
commit0f552551de6ad5eed51c539baff8f692c0bf9344
treec382bd5ecf2dd7aae98d2bb33deef1060f5a70f4
parent4827379bf17eaeba31c2573c19dd65680d63690c
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>
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