+
+ $('.plain-list-paged').each(function() {
+ // should change on resize?
+ var $plc = $(this);
+ var $pl = $('.plain-list', this);
+
+ var $items = $('p', $pl);
+
+ if ($items.length > 40) {
+ $items.hide();
+ var prev = [0, 0];
+
+ $('.pager', $plc).paging($items.length, {
+ format: '[< ncnnn >]', // define how the navigation should look like and in which order onFormat() get's called
+ perpage: 40,
+ lapping: 0, // don't overlap pages for the moment
+ page: 1, // start at page, can also be "null" or negative
+ onSelect: function (page) {
+ var data = this.slice;
+ $items.slice(prev[0], prev[1]).hide();
+ $items.slice(data[0], data[1]).show();
+ prev = data;
+ },
+ onFormat: function (type) {
+ switch (type) {
+ case 'block': // n and c
+ return ' <li><a href="#"' + (this.value == this.page ? ' class="current"' : '') + '>' +
+ this.value + '</a></li>';
+ case 'next': // >
+ return '<li><a href="#">›</a></li>';
+ case 'prev': // <
+ return '<li><a href="#">‹</a></li>';
+ case 'first': // [
+ return '<li><a href="#">«</a></li>';
+ case 'last': // ]
+ return '<li><a href="#">»</a></li>';
+ }
+ }
+ });
+ }
+ });
+
+ /* global tlite */
+ tlite(function (el) {
+ return $(el).hasClass('tlite-tooltip');
+ });
+
+ /* more/less switch from https://codepen.io/JoshBlackwood/pen/pEwHe */
+ // Hide the extra content initially, using JS so that if JS is disabled, no problemo:
+ $('.read-more-content').addClass('hide');
+ $('.read-more-show, .read-more-hide').removeClass('hide');
+
+ // Set up the toggle effect:
+ $('.read-more-show').on('click', function(e) {
+ $(this).next('.read-more-content').removeClass('hide');
+ $(this).addClass('hide');
+ e.preventDefault();
+ });
+
+ // Changes contributed by @diego-rzg
+ $('.read-more-hide').on('click', function(e) {
+ var p = $(this).parent('.read-more-content');
+ p.addClass('hide');
+ p.prev('.read-more-show').removeClass('hide'); // Hide only the preceding "Read More"
+ e.preventDefault();
+ });