PageSourceSearch

https://psl.co.za/assets/js/custom.js

js psl.co.za collected 2026-10-02 11:45:40 UTC 2,531 bytes, 104 lines download raw bytes

1/* ------- Scroll to top -------- */
2$(document).ready(function(){
3
4$(function(){
5 
6    $(document).on( 'scroll', function(){
7 
8    	if ($(window).scrollTop() > 100) {
9			$('.scroll-top-wrapper').addClass('show');
10		} else {
11			$('.scroll-top-wrapper').removeClass('show');
12		}
13	});
14 
15	$('.scroll-top-wrapper').on('click', scrollToTop);
16});
17 
18function scrollToTop() {
19	verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
20	element = $('body');
21	offset = element.offset();
22	offsetTop = offset.top;
23	$('html, body').animate({scrollTop: offsetTop}, 500, 'linear');
24}
25
26});
27
28/* ---------- Limit Characters for News -------------*/
29$(function(){
30  $(".posts__item--card .posts__excerpt.main").each(function(i){
31    len1=$(this).text().length;
32    if(len1>300)
33    {
34      $(this).text($(this).text().substr(0,300)+'...');
35    }
36  });
37});
38
39$(function(){
40  $(".posts__item--card .posts__excerpt.grid").each(function(i){
41    len2=$(this).text().length;
42    if(len2>130)
43    {
44      $(this).text($(this).text().substr(0,130)+'...');
45    }
46  });
47});
48
49$(function () {
50    $(".posts__item--card .posts__title a").each(function (i) {
51       
52        len2 = $(this).text().length;
53        if (len2 > 50) {
54            $(this).text($(this).text().substr(0, 50) + '...');
55        }
56    });
57});
58
59/* Full width news */
60$(function(){
61  $(".posts__item--card .posts__excerpt.main-full").each(function(i){
62    len1=$(this).text().length;
63    if(len1>450)
64    {
65      $(this).text($(this).text().substr(0,450)+'...');
66    }
67  });
68});
69
70/* ---------- Limit Characters for Related & Popular News  - Side Bar -------------*/
71$(function(){
72  $(".posts__title.related-news-side a").each(function(i){
73    len1=$(this).text().length;
74    if(len1>100)
75    {
76      $(this).text($(this).text().substr(0,100)+'...');
77    }
78  });
79});
80
81
82/* ---------- Limit Characters for Videos -------------*/
83$(function () {
84    $(".posts--video-grid .posts__title").each(function (i) {
85       
86        len2 = $(this).text().length;
87        if (len2 > 70) {
88            $(this).text($(this).text().substr(0, 70) + '...');
89        }
90    });
91});
92
93/* ---------- Limit Characters for Video Modal Popup Related Videos  - Side Bar -------------*/
94$(function(){
95  $(".video-modal .posts__title.related-news-side a").each(function(i){
96    len1=$(this).text().length;
97    if(len1>50)
98    {
99      $(this).text($(this).text().substr(0,50)+'...');
100    }
101  });
102});
103
104

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.