PageSourceSearch

https://cclfg.cclgroup.com/wp-content/themes/ccl/static/scripts/related-articles.js?ver=1791586857

js cclgroup.com collected 2026-10-09 23:18:28 UTC 4,374 bytes, 115 lines download raw bytes

1jQuery(document).ready(function($) {
2  var url = window.location.href;
3  
4  if(url.indexOf('cclinvest') >= 0 || url.indexOf('cclfundsinc') >= 0 || url.indexOf("globalalphacapital") >= 0){
5    if( $('body').find( '.related-articles' ).length != 0 ){
6        var main_site_path = ccl_object.main_site_path;
7        var get_lang_code  = ccl_object.get_lang_code;
8        var extractedNumber = '';
9        var className = $('body').attr('class');
10        var postIdNumber = className.match(/postid-(\d+)/);
11        var get_lang_code  = ccl_object.get_lang_code;
12
13        if (postIdNumber !== null) {
14            var extractedNumber = postIdNumber[1];
15            console.log(extractedNumber);
16        }
17    
18        var aurl = '';
19
20        var aff_id = '';
21
22        if(url.indexOf("cclinvest") >= 0){
23          if(get_lang_code == 'fr'){
24              aff_id = '188';
25          }else{
26              aff_id = '88';
27          }
28        }else if(url.indexOf("cclfundsinc") >= 0){
29            if(get_lang_code == 'fr'){
30                aff_id = '189,188,210,187,190,186,331,328,327';
31            }else{
32                aff_id = '106,330,84,85,78,107,232,228,88';
33            }
34        }else if(url.indexOf("globalalphacapital") >= 0){
35          if(get_lang_code == 'fr'){
36            aff_id = '187';
37          }else{
38            aff_id = '85';
39          }
40        }else if(url.indexOf("fortwoodcapital") >= 0){
41          if(get_lang_code == 'fr'){
42            aff_id = '355,186';
43          }else{
44            aff_id = '353,78';
45          }
46        }
47
48        var type_id = '';
49
50        if($('*[data-type="97"]').length || $('*[data-type="167"]').length){
51          if(get_lang_code == 'fr'){
52            type_id = '167';
53          }else{
54            type_id = '97';
55          }
56        }else{
57          if(get_lang_code == 'fr'){
58            type_id = '165,169,192,193';
59          }else{
60            type_id = '90,92,93,103';
61          }
62        }
63
64        if(get_lang_code == 'fr') {
65            aurl = main_site_path + 'wp-json/wp/v2/insights?&lang=fr&orderby=date&order=desc&per_page=3&_embed&InsightType=' + type_id + '&Affiliate=' + aff_id + '&exclude=' + extractedNumber;
66        } else {
67            aurl = main_site_path + 'wp-json/wp/v2/insights?&lang=en&orderby=date&order=desc&per_page=3&_embed&Affiliate=' + aff_id + '&InsightType=' + type_id + '&exclude=' + extractedNumber;
68        }
69
70        $.ajax({
71            type:'GET',
72            url: aurl,
73            dataType: 'json',
74            success: function (data,status,request) {
75                JSON.stringify(data);
76                if( data.length > 0 ){
77                    $.each(data, function(key, value) {
78                        var insights = ($(this)[0]);
79
80                        var img = insights._embedded['wp:featuredmedia']['0'].source_url; 
81                        var title = insights.title.rendered;
82                        var d = new Date(insights.date);
83                        var dat = { year: 'numeric', month: 'long', day: 'numeric' };
84                        var date = d.toLocaleDateString('en-US', dat);
85                        var excerpt = insights.excerpt.rendered;
86                        var link = insights.link;
87
88                        var readmore = '';
89                        if( get_lang_code == 'fr' ){
90                            readmore = 'En savoir plus';
91                        } else {
92                            readmore = 'Read More';
93                        }
94
95                        //$('.related-articles .articles').append('<article class="insight"><img src="' + img + '"/><p class="subheading"></p><h3>' + title + '</h3><p class="date">' + date + '</p><div class="description">' + excerpt + '</div><a href="' + link + '">' + readmore + '</a></article>');
96                    });
97                    $('.related-articles .articles .article').each(function() {
98                        var descriptionHeight = $(this).children('.description').outerHeight();
99
100                        if(descriptionHeight > 81) {
101                            $(this).children('.description').addClass('ellipses');
102                        }
103                    });
104                    $('article.insight h3').css("height", "auto");
105
106                }
107            },
108            error: function(jqXHR, textStatus, errorThrown){
109            }
110
111            
112        });
113    }
114  }
115});

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.