Malaysia Business & Finance News, Stock Updates


1) { var sIndex = 6; var eIndex = 16; }else{ var sIndex = 7; var eIndex = 17; } } function titleCase(str) { var splitStr = str.toLowerCase().split(‘ ‘); for (var i = 0; i 0) { var eightArticles = articles.slice(0, 7); eightArticles.splice(Math.floor(Math.random() * eightArticles.length), 0, randData[0]); }else{ var eightArticles = articles.slice(0, 8); minusCounter = 9; } var subscriptionStatus = ”; var html_to_append = ”; var html_to_append2 = ”; var paywallSpan = ‘‘; var premiumSpan = ‘Premium’; var paywalllockSpan = ‘‘; var sbpLockSpan = ‘Premium’; var sbpUnlockSpan = ‘‘; var paywall = ‘1’; // First 8 Articles $.each(eightArticles, function(index, value) { if (value.publishdate.match(/12:00:00 AM/)) { publishdate = publishTimeDateV2(value.publishdate); } else { if (typeof (value.timeupload) != ‘undefined’) publishdate = value.timeupload; else publishdate = publishTimeDateV2(value.publishdate); } var timespan = ”; if(publishdate!= ” ) timespan = ” + publishdate + ”; if(value.hasOwnProperty(‘kicker_url’)) { value.kicker_url = value.kicker_url.replace(‘business/tag/?q=’,’tag/’); } if (!value.kicker_url) { var kickerTag = ” + value.kicker + ”; } else if (value.kicker== “ASEAN+” && urlTSOL==”Aseanplus”) { var kickerTag = ‘AseanPlus News’; } else{ var kickerTag = ” + value.kicker + ”; } var kickerSpan = “”; if (value.access_type == “complimentary” || value.kicker.toLowerCase() == “branded” || value.kicker.toLowerCase() == “starpicks”) {kickerSpan = “”;} else if (value.access_type == “premium” || value.access_type == “metered”) {kickerSpan = paywalllockSpan;} else { kickerSpan = “”; } // For GA360 Tracking ga360CustomAttributes = ”; ga360CustomAttributes += ‘ data-list-type=”More Stories” ‘; if (value.contentcategory != undefined && value.contentcategory != null) { if (value.contentcategory != ”) ga360CustomAttributes += ‘ data-list-variant=”‘+value.contentcategory+'” ‘; else ga360CustomAttributes += ‘ data-list-variant=”NA” ‘; } else { ga360CustomAttributes += ‘ data-list-variant=”‘+urlTSOL.replace(‘Sports’, ‘Sport’)+'” ‘; } ga360CustomAttributes += ‘ data-list-position=”‘+ (index+1).toString() +'” ‘; if (value.contenttype != undefined && value.contenttype != null) { if (value.contenttype != ”) ga360CustomAttributes += ‘ data-content-type=”‘+value.contenttype+'” ‘; else ga360CustomAttributes += ‘ data-content-type=”NA” ‘; } else { if (value.contain_video == “true”) ga360CustomAttributes += ‘ data-content-type=”Article with Video Embed” ‘; else ga360CustomAttributes += ‘ data-content-type=”Article” ‘; } ga360CustomAttributes += ‘ data-content-title=”‘+ value.headline.replace(‘”‘, ‘”‘) +'” ‘; ga360CustomAttributes += ‘ data-content-id=”‘+ value.guid +'” ‘; if (value.contentcategorysubcategory != undefined && value.contentcategorysubcategory != null) { if (value.contentcategorysubcategory != ”) ga360CustomAttributes += ‘ data-content-category=”‘+ value.contentcategorysubcategory +'” ‘; else ga360CustomAttributes += ‘ data-content-category=”NA” ‘; } else { if (value.oriLink) { category = value.oriLink.split(“/”)[3]; category = titleCase(category.replace(‘-‘,’ ‘)); subCategory = value.oriLink.split(“/”)[4]; subCategory = titleCase(subCategory.replace(‘-‘,’ ‘)); ga360CustomAttributes += ‘ data-content-category=”‘+ category + ‘/’ + subCategory +'” ‘; } else { ga360CustomAttributes += ‘ data-content-category=”NA” ‘; } } ga360CustomAttributes += ‘ data-content-author=”‘+ value.byline.replace(‘”‘, ‘”‘) +'” ‘; if (value.contentsponsor != undefined && value.contentsponsor != null) { if (value.contentsponsor != ”) ga360CustomAttributes += ‘ data-content-sp=”‘+value.contentsponsor+'” ‘; else ga360CustomAttributes += ‘ data-content-sp=”NA” ‘; } else { ga360CustomAttributes += ‘ data-content-sp=”NA” ‘; } // var path = value.image_url.split(‘/’); //default img media = ‘‘; var exclusive = “”; if (typeof (value.isexclusive) != ‘undefined’){ if (value.isexclusive.toLowerCase() == ‘true’) { exclusive = ‘Exclusive]]>‘; } } // if (!path.includes(“tsol-default-image2017.png”, 0) && !path.includes(“tsol-default-image2017.jpg”, 0) && path.length > 4) { // var indexP = path.length – 1; // path.splice(indexP, 0, “thumbs/350×350”); // var imgPath = path.join(‘/’).replace(“png”, “jpg”).replace(“jpeg”, “jpg”).toLowerCase(); // //new thumb image // media = ‘‘; // } html_to_append += ”+kickerTag+”+ publishdate + ” + kickerSpan + exclusive +’ ‘; }); // Subsequent Articles Listing $.each(articles, function(index, value) { //can remove urlTSOL==”Aseanplus” when it is live if (value.kicker=== “ASEAN+” && urlTSOL==”Aseanplus”) { value.kicker = “AseanPlus News”; value.kicker_url = “/aseanplus/aseanplus-news/”; } if (value.publishdate.match(/12:00:00 AM/)) { publishdate = publishTimeDateV2(value.publishdate); } else { if (typeof (value.timeupload) != ‘undefined’) publishdate = value.timeupload; else publishdate = publishTimeDateV2(value.publishdate); } var timespan = ”; if(publishdate!= ” ) timespan = ” + publishdate + ”; // Span Icon var kickerSpan = “”; if (value.access_type == “complimentary” || value.kicker.toLowerCase() == “branded” || value.kicker.toLowerCase() == “starpicks”) {kickerSpan = “”;} else if (value.access_type == “premium” || value.access_type == “metered”) {kickerSpan = paywalllockSpan;} else { kickerSpan = “”; } // For GA360 Tracking ga360CustomAttributes = ”; ga360CustomAttributes += ‘ data-list-type=”More Stories” ‘; if (value.contentcategory != undefined && value.contentcategory != null) { if (value.contentcategory != ”) ga360CustomAttributes += ‘ data-list-variant=”‘+value.contentcategory+'” ‘; else ga360CustomAttributes += ‘ data-list-variant=”NA” ‘; } else { ga360CustomAttributes += ‘ data-list-variant=”‘+urlTSOL.replace(‘Sports’, ‘Sport’)+'” ‘; } ga360CustomAttributes += ‘ data-list-position=”‘+ (index-minusCounter).toString() +'” ‘; if (value.contenttype != undefined && value.contenttype != null) { if (value.contenttype != ”) ga360CustomAttributes += ‘ data-content-type=”‘+value.contenttype+'” ‘; else ga360CustomAttributes += ‘ data-content-type=”NA” ‘; } else { if (value.contain_video == “true”) ga360CustomAttributes += ‘ data-content-type=”Article with Video Embed” ‘; else ga360CustomAttributes += ‘ data-content-type=”Article” ‘; } ga360CustomAttributes += ‘ data-content-title=”‘+ value.headline.replace(‘”‘, ‘”‘) +'” ‘; ga360CustomAttributes += ‘ data-content-id=”‘+ value.guid +'” ‘; if (value.contentcategorysubcategory != undefined && value.contentcategorysubcategory != null) { if (value.contentcategorysubcategory != ”) ga360CustomAttributes += ‘ data-content-category=”‘+ value.contentcategorysubcategory +'” ‘; else ga360CustomAttributes += ‘ data-content-category=”NA” ‘; } else { if (value.oriLink) { category = value.oriLink.split(“/”)[3]; category = titleCase(category.replace(‘-‘,’ ‘)); subCategory = value.oriLink.split(“/”)[4]; subCategory = titleCase(subCategory.replace(‘-‘,’ ‘)); ga360CustomAttributes += ‘ data-content-category=”‘+ category + ‘/’ + subCategory +'” ‘; } else { ga360CustomAttributes += ‘ data-content-category=”NA” ‘; } } ga360CustomAttributes += ‘ data-content-author=”‘+ value.byline.replace(‘”‘, ‘”‘) +'” ‘; if (value.contentsponsor != undefined && value.contentsponsor != null) { if (value.contentsponsor != ”) ga360CustomAttributes += ‘ data-content-sp=”‘+value.contentsponsor+'” ‘; else ga360CustomAttributes += ‘ data-content-sp=”NA” ‘; } else { ga360CustomAttributes += ‘ data-content-sp=”NA” ‘; } if (index > sIndex && index Exclusive’; } } var kickerTag = ”; if (value.kicker_url) kickerTag = ”+ value.kicker +”; else kickerTag = ”+ value.kicker +”; // var path = value.image_url.split(‘/’); //default img media = ‘‘; // if (!path.includes(“tsol-default-image2017.png”, 0) && !path.includes(“tsol-default-image2017.jpg”, 0) && path.length > 4) { // path.splice(path.length-1, 0, “thumbs/350×350”); // var imgPath = path.join(‘/’).replace(“png”, “jpg”).replace(“jpeg”, “jpg”).toLowerCase(); // //new thumb image // media = ‘‘; // } if (img_url.match(‘newTsol_logo_socmedia’)) { html_to_append2 += ”+ kickerTag + timespan + kickerSpan + exclusive + ‘

‘ + value.description + ‘

‘; } else { html_to_append2 += ”+ kickerTag + timespan + kickerSpan + exclusive + ‘

‘ + value.description + ‘

‘; } } }); $(“#section1”).html(html_to_append); $(“#section2”).html(html_to_append2); “); document.write(“]]>

Source