`;
const targetElement = this.domGetter();
targetElement.insertAdjacentHTML('afterbegin', dableIframe);
dableHandler.vendorScript();
}
}
};
dableHandler.install();
});
/*** END of [#168945333] [Liputan6] Pasang Dable - Mobile ****/
/*** START of [#168690920] Add Button Share Live Report ****/
window.addEventListener('DOMContentLoaded', function() {
const elementPreparation = {
elements: {},
getElement: function() {
this.elements.livereportHeadlineContainer = document.querySelector('.livereport--headline');
this.elements.livereportHeadline = document.querySelector('.livereport--headline__head');
this.elements.liveReportHeadlineTitle = document.querySelector('.livereport--headline__head__content__title');
this.elements.liveReportHeadlineLiveReport = document.querySelector('.livereport--headline__head__content__logo');
this.elements.liveReportDate = document.querySelector('.livereport--headline__head__content__date');
this.elements.livereportTitle = document.querySelector('.livereport--headline__head__content__title');
this.elements.livereportShare = document.querySelector('.livereport--share');
this.elements.livereportURL = window.location.href;
},
getLiveReportTitleEncoded: function() {
return encodeURIComponent(`${this.elements.liveReportHeadlineLiveReport.textContent}: ${this.elements.liveReportHeadlineTitle.textContent}, ${this.elements.liveReportDate.textContent}`);
},
getUrl: function(socmed) {
var utm = '%3Futm_source%3DMobile%26utm_medium%3D' + socmed + '%26utm_campaign%3DShare_Hanging';
var currentUrl = window.location.href;
currentUrl = currentUrl.substr(0, currentUrl.indexOf('?'));
if (currentUrl == '') {
currentUrl = window.location.href;
}
if (socmed == 'copy-link') {
utm = '?utm_source=Mobile&utm_medium=copy-link&utm_campaign=Share_Hanging';
return currentUrl + utm;
}
currentUrl = encodeURIComponent(currentUrl);
return currentUrl + utm;
},
pushShareTracking: function(provider) {
window.dataLayer.push({
event: 'click',
feature_name: 'social-share',
feature_location: 'hanging',
feature_position: provider
});
},
shareButtonClickHandler: function() {
$('.livereport--share__button--fb').click(function() {
elementPreparation.pushShareTracking('facebook');
});
$('.livereport--share__button--whatsapp').click(function() {
elementPreparation.pushShareTracking('whatsapp');
});
$('.livereport--share__button--line').click(function() {
elementPreparation.pushShareTracking('line');
});
$('.livereport--share__button--twitter').click(function() {
elementPreparation.pushShareTracking('twitter');
});
$('.livereport--share__copy-link').click(function() {
elementPreparation.pushShareTracking('copy-link');
});
},
shareElementTemplate: function() {
const title = this.getLiveReportTitleEncoded();
const template = `
`;
return template;
},
appendElement: function() {
this.getElement();
const shareElement = this.shareElementTemplate();
const headlineElement = this.elements.livereportHeadlineContainer;
headlineElement.insertAdjacentHTML('beforebegin', shareElement);
}
};
// const shareButtonClick = {
// buttonShare: {},
// buttonCopy: {},
// getButton: function() {
// this.buttonElements = [...document.querySelectorAll('.livereport--share__button a')];
// this.buttonCopy = document.querySelector('.livereport--share__copy-link');
// },
// addAction: function(){
// this.getButton();
// }
// };
const cssPreparation = {
cssTemplate: function() {
const rawCSS = `
/* @font-face {
font-family: myFirstFont;
src: url('https://cdn-production-assets-kly.akamaized.net/assets/fonts/liputan6/AcuminPro/AcuminPro.woff');
} */
.livereport--share {
position: relative;
display: block;
/* padding-left: 15px;
padding-right: 15px; */
}
.livereport--share__wrapper {
position: relative;
display: grid;
width: 100%;
grid-template-columns: 14% 86%;
height: 30px;
}
.livereport--share__button--fb {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='50px' height='30px' viewBox='0 0 50 30' version='1.1'%3E%3Cscript xmlns=''/%3E%3C!-- Generator: sketchtool 57.1 (101010) - https://sketch.com --%3E%3Ctitle%3E4C44A201-2549-440C-A1A3-8B31553ED1CA%3C/title%3E%3Cdesc%3ECreated with sketchtool.%3C/desc%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Hanging-Share' transform='translate(-65.000000, -8.000000)'%3E%3Cg id='Share'%3E%3Cg id='share' transform='translate(65.000000, 8.000000)'%3E%3Cg id='facebook-share'%3E%3Crect id='button' fill='%2343609C' x='0' y='0' width='50' height='30' rx='15'/%3E%3Cpath d='M23.0133751,15.9614638 L21,15.9614638 L21,13.4272078 L23.0133751,13.4272078 L23.0133751,11.2627246 C23.0133751,9.5618248 24.2027,8 26.9430738,8 C28.0526567,8 28.8733042,8.09832344 28.8733042,8.09832344 L28.8085045,10.4647868 C28.8085045,10.4647868 27.9717311,10.4572655 27.0586184,10.4572655 C26.0703499,10.4572655 25.9120494,10.8781829 25.9120494,11.5769767 C25.9120494,12.1293111 25.9120494,10.3996937 25.9120494,13.4273446 L28.887063,13.4273446 L28.7576117,15.9616005 L25.9120494,15.9616005 L25.9120494,23 L23.0133751,23 L23.0133751,15.9614638 Z' id='facebook-icon-copy-5' fill='%23FFFFFF'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
background-repeat: no-repeat;
width: 18.75%;
height: 30px;
display: block;
margin-right: 4px;
margin-left: 4px;
background-position: center;
background-color: #43609C;
border-radius: 15px;
}
.livereport--share__button--whatsapp {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='50px' height='30px' viewBox='0 0 50 30' version='1.1'%3E%3Cscript xmlns=''/%3E%3C!-- Generator: sketchtool 57.1 (101010) - https://sketch.com --%3E%3Ctitle%3EBB844963-6069-401B-BA60-DEB68A3D16DC%3C/title%3E%3Cdesc%3ECreated with sketchtool.%3C/desc%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Hanging-Share' transform='translate(-123.000000, -8.000000)'%3E%3Cg id='Share'%3E%3Cg id='share' transform='translate(65.000000, 8.000000)'%3E%3Cg id='wa' transform='translate(58.000000, 0.000000)'%3E%3Crect id='button' fill='%2325D366' x='0' y='0' width='50' height='30' rx='15'/%3E%3Cpath d='M29.8659375,18.5909375 C29.685,19.101875 28.966875,19.525625 28.3940625,19.649375 C28.0021875,19.7328125 27.4903125,19.799375 25.7671875,19.085 C23.563125,18.171875 22.14375,15.9321875 22.033125,15.786875 C21.9271875,15.6415625 21.1425,14.6009375 21.1425,13.5246875 C21.1425,12.4484375 21.6890625,11.924375 21.909375,11.699375 C22.0903125,11.5146875 22.389375,11.4303125 22.67625,11.4303125 C22.7690625,11.4303125 22.8525,11.435 22.9275,11.43875 C23.1478125,11.448125 23.2584375,11.46125 23.40375,11.8090625 C23.5846875,12.245 24.0253125,13.32125 24.0778125,13.431875 C24.13125,13.5425 24.1846875,13.6925 24.1096875,13.8378125 C24.039375,13.9878125 23.9775,14.054375 23.866875,14.181875 C23.75625,14.309375 23.65125,14.406875 23.540625,14.54375 C23.439375,14.6628125 23.325,14.7903125 23.4525,15.010625 C23.58,15.22625 24.020625,15.9453125 24.669375,16.5228125 C25.5065625,17.268125 26.1853125,17.50625 26.428125,17.6075 C26.6090625,17.6825 26.8246875,17.6646875 26.956875,17.5240625 C27.1246875,17.343125 27.331875,17.043125 27.5428125,16.7478125 C27.6928125,16.5359375 27.8821875,16.5096875 28.0809375,16.5846875 C28.2834375,16.655 29.355,17.1846875 29.5753125,17.294375 C29.795625,17.405 29.9409375,17.4575 29.994375,17.5503125 C30.046875,17.643125 30.046875,18.0790625 29.8659375,18.5909375 Z M25.501875,8 L25.498125,8 C21.3628125,8 18,11.36375 18,15.5 C18,17.140625 18.52875,18.66125 19.4278125,19.8959375 L18.493125,22.6821875 L21.3759375,21.760625 C22.561875,22.54625 23.9765625,23 25.501875,23 C29.6371875,23 33,19.6353125 33,15.5 C33,11.3646875 29.6371875,8 25.501875,8 L25.501875,8 Z' id='Fill-1' fill='%23FFFFFF'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
background-repeat: no-repeat;
width: 18.75%;
height: 30px;
display: block;
margin-right: 4px;
margin-left: 4px;
background-position: center;
background-color: #25D366;
border-radius: 15px;
}
.livereport--share__button--twitter {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='50px' height='30px' viewBox='0 0 50 30' version='1.1'%3E%3Cscript xmlns=''/%3E%3C!-- Generator: sketchtool 57.1 (101010) - https://sketch.com --%3E%3Ctitle%3E9F90A524-855F-480C-9EC2-17F4EF82121D%3C/title%3E%3Cdesc%3ECreated with sketchtool.%3C/desc%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Hanging-Share' transform='translate(-180.000000, -8.000000)'%3E%3Cg id='Share'%3E%3Cg id='share' transform='translate(65.000000, 8.000000)'%3E%3Cg id='twitter' transform='translate(115.000000, 0.000000)'%3E%3Crect id='button' fill='%2355ACEE' x='0' y='0' width='50' height='30' rx='15'/%3E%3Cpath d='M32.6470252,10.3718891 C33.4462825,9.90325161 34.060232,9.16116529 34.3492327,8.27686344 C33.6011144,8.71089304 32.772608,9.02596364 31.8906982,9.19577322 C31.1845666,8.45977789 30.178395,8 29.0648507,8 C26.9268305,8 25.1932981,9.69541945 25.1932981,11.7866613 C25.1932981,12.0834589 25.2275479,12.3725044 25.2935001,12.6496447 C22.0759024,12.4917402 19.2232589,10.9841265 17.313854,8.69308149 C16.9806021,9.25234565 16.7896333,9.90279017 16.7896333,10.5967945 C16.7896333,11.9106039 17.4731204,13.0696465 18.5119378,13.7487003 C17.8772308,13.729043 17.280359,13.5586797 16.7584027,13.2750792 C16.7580253,13.2908604 16.7580253,13.3067339 16.7580253,13.3226997 C16.7580253,15.1573815 18.0925424,16.6878826 19.863627,17.0358077 C19.5387725,17.1223736 19.1967459,17.1686098 18.8435857,17.1686098 C18.5940242,17.1686098 18.3515391,17.1447996 18.1150926,17.100686 C18.607894,18.6050697 20.0375181,19.6999723 21.7317057,19.7304273 C20.4067181,20.746147 18.7374395,21.3514628 16.923519,21.3514628 C16.6110247,21.3514628 16.3028705,21.3335589 16,21.2984896 C17.7133411,22.3729966 19.748423,23 21.9346572,23 C29.0556986,23 32.9498013,17.2297967 32.9498013,12.2256745 C32.9498013,12.0614944 32.9460273,11.8982373 32.9385734,11.7357185 C33.6951835,11.2019257 34.3514972,10.5349617 34.8705285,9.77561756 C34.1762852,10.076845 33.4300539,10.2803396 32.6470252,10.3718891 Z' id='twiiter-icon' fill='%23FFFFFF'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
background-repeat: no-repeat;
width: 18.75%;
height: 30px;
display: block;
margin-right: 4px;
margin-left: 4px;
background-position: center;
background-color: #55ACEE;
border-radius: 15px;
}
.livereport--share__button--line {
background-image: url('data:image/svg+xml;charset%3DUS-ASCII,%3Csvg%20width%3D%2219%22%20height%3D%2218%22%20viewBox%3D%220%200%2019%2018%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EGroup%2013%3C%2Ftitle%3E%3Cpath%20d%3D%22M18.5%207.786c0-3.842-4.037-6.968-9-6.968-4.962%200-9%203.126-9%206.968%200%203.445%203.202%206.33%207.527%206.876.293.06.692.185.793.424.09.216.06.556.029.775l-.128.736c-.04.217-.181.849.78.462.96-.386%205.182-2.912%207.07-4.985%201.304-1.364%201.929-2.75%201.929-4.288zM5.977%2010.072H4.189a.462.462%200%200%201-.472-.45V6.21c0-.248.212-.45.472-.45s.471.202.471.45v2.962h1.317c.26%200%20.472.202.472.45%200%20.249-.211.45-.472.45zm1.85-.45c0%20.249-.212.45-.472.45a.462.462%200%200%201-.472-.45V6.21c0-.248.212-.45.472-.45s.471.202.471.45v3.412zm4.304%200c0%20.194-.129.366-.322.427a.48.48%200%200%201-.527-.157l-1.833-2.38v2.11c0%20.249-.211.45-.472.45a.462.462%200%200%201-.472-.45V6.21c0-.194.13-.366.323-.428a.48.48%200%200%201%20.526.157l1.834%202.382V6.21c0-.248.211-.45.471-.45s.472.202.472.45v3.412zm2.894-2.156c.26%200%20.472.201.472.45%200%20.248-.212.45-.472.45h-1.316v.806h1.316c.26%200%20.472.202.472.45%200%20.249-.212.45-.472.45h-1.788a.462.462%200%200%201-.472-.45V6.21c0-.248.212-.45.472-.45h1.788c.26%200%20.472.202.472.45s-.212.45-.472.45h-1.316v.806h1.316z%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E');
background-repeat: no-repeat;
width: 18.75%;
height: 30px;
display: block;
margin-right: 4px;
margin-left: 4px;
background-position: center;
background-color: #25D366;
border-radius: 15px;
}
.livereport--share__button {
position: relative;
display: flex;
justify-content: center;
}
.livereport--share__copy-link {
font-family: AcuminPro;
font-size: 9px;
font-weight: 600;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
text-align: center;
position: relative;
color: #787878;
display: flex;
justify-content: center;
align-items: center;
border-radius: 15px;
border: solid 1px #dddddd;
margin-left: 0px;
width: 25%;
height: 30px;
}
.livereport--share__label {
position: relative;
display: flex;
align-items: center;
font-family: AcuminPro;
font-size: 12px;
font-weight: 600;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
color: #333333;
}
.livereport--share--hidden{
position: fixed;
display: block;
width: 100%;
top: 0px;
left: 0px;
background-color: #FFFFFF;
z-index: 4;
transform: translateY(-200px);
}
.livereport--share--show{
position: fixed;
display: block;
width: 100%;
top: 0px;
left: 0px;
background-color: #FFFFFF;
z-index: 4;
padding: 8px 15px 8px 15px;
border: solid 1px #f0f0f0;
transition: all 0.5s;
transform: translateY(0px);
}
.copy-link-button-success::before {
content: "Copied";
color: rgb(250, 100, 0);
font-weight: bold;
}
`;
return rawCSS;
},
appendCSS: function() {
const styleSheet = document.createElement('style');
styleSheet.type = 'text/css';
styleSheet.innerText = this.cssTemplate();
document.head.appendChild(styleSheet);
}
};
const scrollHandler = {
scrollDirection: null,
do: function() {
let last_known_scroll_position = 0;
let ticking = false;
window.addEventListener(
'scroll',
function(e) {
last_known_scroll_position = window.scrollY;
if (!ticking) {
window.requestAnimationFrame(
function() {
this.getScrollDirection();
this.executor();
ticking = false;
}.bind(this)
);
ticking = true;
}
}.bind(this)
);
this.copyLink();
},
getScrollDirection: function() {
let currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
if (currentScroll > 0 && scrollHandler.lastScroll <= currentScroll) {
scrollHandler.lastScroll = currentScroll;
scrollHandler.scrollDirection = 'down';
} else {
scrollHandler.lastScroll = currentScroll;
scrollHandler.scrollDirection = 'up';
}
},
copyLink: function() {
$(".livereport--share__copy-link").click(function() {
var clipboard = new ClipboardJS(".livereport--share__copy-link");
$(this).text("");
$(this).css("transition", "all 2s ease 0s");
$(this).css("background-color", "#FFFFFF");
$(this).addClass("copy-link-button-success");
});
},
isElementInViewPort: function(el) {
let rect = el.getBoundingClientRect();
if (rect.bottom < 0) {
return false;
}
return true;
},
executor: function() {
const scrollDirection = this.scrollDirection;
const headline = elementPreparation.elements.livereportHeadline;
const share = elementPreparation.elements.livereportShare;
const isHeadlineVisible = this.isElementInViewPort(headline);
if (!isHeadlineVisible && scrollDirection === 'down') {
share.classList.add('livereport--share--show');
share.classList.remove('livereport--share--hidden');
// $('.layout__content').css('layout__content--no-hanging');
// $('.layout__nav-content').css({transition: 'all 0.5s', display: 'block', transform: 'translateY(-200px)'});
} else {
share.classList.remove('livereport--share--show');
share.classList.add('livereport--share--hidden');
// $('.layout__content').removeClass('layout__content--no-hanging');
// $('.layout__nav-content').css({transition: 'all 0.5s', display: 'block', transform: 'translateY(0px)'});
}
}
};
if ($('.livereport__container').length > 0) {
elementPreparation.appendElement();
elementPreparation.getElement();
elementPreparation.shareButtonClickHandler();
cssPreparation.appendCSS();
scrollHandler.do();
}
});
/*** END of [#168690920] Add Button Share Live Report ****/
/*** START of [#169972993] Skinning Content Promotion Sea Games 2019 - Mobile ****/
$(document).ready(function() {
const cssHandler = {
rawCss: function() {
const style = `
.content-promotion__seagames.content-promotion {
background-color: #2e328b;
background-repeat: no-repeat;
background-position: left;
background-image: url("https://cdn.zeplin.io/5655710b3387debb49e05a86/assets/8E4A3AF7-56D3-437C-B606-2D6061A7B192.png");
width: 1px;
min-width: 100vw;
margin-left: -15px;
}
.content-promotion__seagames .content-promotion--mstm__item {
background-color: transparent;
}
.content-promotion__seagames .content-promotion--mstm__thumbnail {
border-radius: 8px;
background-color: #2e328b;
}
.content-promotion__seagames .content-promotion--header__link {
font-family: AcuminPro;
font-size: 14px;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.43;
letter-spacing: normal;
color: #fec000;
}
.content-promotion__seagames .content-promotion--mstm__link-title {
font-family: AcuminPro;
font-size: 14px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: 1.29;
letter-spacing: normal;
color: #ffffff;
}
.content-promotion__seagames .content-promotion--header {
margin: 0;
padding: 15px 0 12px 15px;
}
.content-promotion__seagames .content-promotion--mstm__list {
padding-bottom: 15px;
padding-right: 20px;
}
.content-promotion__seagames .content-promotion--mstm__wrapper {
padding-left: 15px;
}
`;
return style;
},
cssAppend: function() {
const styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.innerText = this.rawCss();
document.head.appendChild(styleSheet);
}
};
$(".content-promotion").each(function() {
cpSeaGames = $(this).find(
'.content-promotion--header__link[title="SEA GAMES 2019"]'
);
if (cpSeaGames.length > 0) {
$(this).addClass("content-promotion__seagames");
cssHandler.cssAppend();
}
});
});
/*** END of [#169972993] Skinning Content Promotion Sea Games 2019 - Mobile ****/
/*** START of [#167534272] Copy Link ****/
$(document).ready(() => {
jQuery.loadScript = function (url, callback) {
jQuery.ajax({
url: url,
dataType: 'script',
success: callback,
async: true
});
}
if (typeof someObject == 'undefined') $.loadScript('https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js', function () {
const cssCreator = {
cssStyle() {
const rawCSS = `
.copy-container {
display: flex;
margin-bottom: 22px;
}
.copy-text-container {
float: left;
/* margin-right: 15px; */
width: 60%;
}
.copy-button-container {
width: 40%;
}
button.copy-button {
border-radius: 16px;
background-color: transparent;
padding: 10px 22px;
border: none;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: 1;
letter-spacing: normal;
width: 90%;
float: right;
border: solid 1px #fa6400;
font-family: AcuminPro;
font-size: 12px;
color: #ff5722;
}
input.copy-text {
border: none;
border-bottom: 1px solid #d8d8d8;
padding: 7px 0px;
font-family: AcuminPro;
font-size: 12px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
color: #787878;
width: 100%;
}
input:focus,
textarea:focus,
select:focus {
outline: none;
}
.copy-button-success::before {
content: "Copied";
color: white;
font-weight: bold;
}
`;
return rawCSS;
},
cssAppend() {
const styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.innerText = cssCreator.cssStyle();
document.head.appendChild(styleSheet);
}
};
cssCreator.cssAppend();
var elem = `
`;
if (window.kmklabs.pageType === "ReadPage") {
$(elem).insertBefore('.tags--topics');
}
//var getUrl = getFullUrl(parent.window.location.href);
var getUrl = getFullUrl(window.location.href.split('?')[0]);
var statusTracking = false;
var channel = parent.kmklabs.channel.full_slug;
function getFullUrl(url) {
var utm = "utm_source=Mobile&utm_medium=copylink&utm_campaign=copylink";
if (url.indexOf(utm) > -1) {
return url;
}
return url + ((url.indexOf('?') > -1) ? "&" : "?") + utm;
}
function getUrlToTextBox() {
$('.copy-text').val(getUrl);
}
function changeCssOnEsports() {
$('.copy-button').css("background-color", "#b000ca");
$('.copy-button').css("color", "rgb(255, 255, 255)");
$('.copy-text').css("border-bottom", "1px solid #714af7");
$('.copy-text').css("background-color", "#0a101b");
$('.copy-text').css("color", "rgb(255, 255, 255)");
}
function copyLink() {
$('.copy-button').click(function () {
getUrlToTextBox();
if (statusTracking === false) {
pushTracking();
statusTracking = true;
}
var content = getUrl;
var clipboard = new ClipboardJS('.copy-button');
$(this).text("");
$(this).css("transition", "all 2s ease 0s");
if (channel === "e-sports") {
$(this).css("background-color", "#704CF7");
} else {
$(this).css("background-color", "#fa6400");
}
$(this).addClass('copy-button-success');
});
}
function pushTracking() {
parent.dataLayer.push({
event: "click",
feature_name: "copy-link",
feature_location: "center",
feature_position: "button"
});
}
$(function () {
if (channel === "e-sports") {
changeCssOnEsports();
}
getUrlToTextBox();
copyLink();
});
});
});
/*** END of [#167534272] Copy Link ****/
/*** START of mobile livestreaming ****/
$('.widgets--livestreaming').hide();
/*** END of mobile livestreaming ****/
/*** START of [#161695218] WIDGET VISUAL STORY ****/
var _paragames_url = function _paragames_url(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
function isUrlMatch(kanal) {
kanal = kanal == 'home' ? '/' : '/'+kanal;
const url = window.location.href;
const parser = document.createElement('a');
parser.href = url;
return parser.pathname === kanal ? true : false;
}
var url = window.location.href;
var res_read = url.match(/read/g);
var visualStoryWidget = '
';
if (window.kmklabs.pageType !== "ReadPage"){
if (isUrlMatch('home') && $('.newsletter_mobile-channel-page').length > 0) {
$('.newsletter_mobile-channel-page').after(visualStoryWidget);
}
if (res_read && window.kmklabs.channel.name !== 'Ramadan') {
var locationSearch = window.location.search;
if(locationSearch.indexOf("new_experience=new_style_related") == -1) {
// $('.popular').after(visualStoryWidget);
// }else{
$('.article-readpage--section:has(div[data-component="mobile:tabs"])').after(visualStoryWidget);
}
}
}
/*** END of [#161695218] WIDGET VISUAL STORY ****/
/*** START of [#165115966] Mobile read ****/
$(document).ready(function(){
if(window.kmklabs.pageType == "ReadPage") {
$('body').append(`
`);
}
});
/*** END of [#165115966] Mobile read ****/
/*** START of [#165951197] Pasang Widget Mobil Dijual Otosia - Mobile ****/
$(window).load(function () {
(function () {
const handler = {
'checkElementExist': function(selector, callback) {
const isLoaded = $(`${selector}.util-hide`);
if ($(selector).length && isLoaded.length === 0) {
callback();
} else {
setTimeout(function() {
handler.checkElementExist(selector, callback);
}, 100);
}
},
'iframeChannel': function () {
const iframe = `
`
return iframe;
},
'iframeReadpage': function () {
const iframe = `
`
return iframe;
},
'pasang': function () {
const pageType = window.kmklabs.pageType;
const channelName = window.kmklabs.channel.name;
if(channelName === 'Bola' || channelName === 'Bisnis' || channelName === 'Tekno'){
if(pageType === 'ChannelPage'){
if($("iframe.visual-stories").length === 1){
$("iframe.visual-stories").detach();
}
handler.checkElementExist('div[data-page="2"]', function() {
//$(".articles__page:eq(0)").append(handler.iframeChannel());
$(".nav-dropdown--widget-wrapper").append(handler.iframeChannel());
});
}else if(pageType === 'ReadPage'){
handler.checkElementExist('div[data-page="3"]', function() {
$('div[data-page="3"]').before(handler.iframeReadpage());
});
}
}
}
}
const windowsMessageHandler = {
'receiveMessage': function () {
window.addEventListener('message', function (event) {
const evenData = event.data;
if (evenData.otosiaChildHeight != undefined) {
const tinggi = event.data.otosiaChildHeight;
const iframe = document.querySelector('.widget-mobil-otosia') || null;
if (iframe !== null) {
iframe.style.height = `${tinggi + 7}px`;
}
}
}, false)
}
}
windowsMessageHandler.receiveMessage();
handler.pasang();
})();
});
/*** END of [#165951197] Pasang Widget Mobil Dijual Otosia - Mobile ****/
/*** START of [#166318785] [Update] Pasang Widget Liga 1 - Mobile ****/
(function () {
$(document).ready(function () {
let functionHandler = {
'iframe': function () {
return `
`
},
'executor': function () {
const pageType = window.kmklabs.pageType;
const channelName = window.kmklabs.channel.full_slug;
const category = window.kmklabs.category.full_slug;
if (channelName === 'bola'){
if (pageType === 'ChannelPage' && category === 'bola') {
$('.jadwal-tv').replaceWith(this.iframe());
$('.widget-liga1').css('margin-top','15px');
$('.widget-liga1').css('margin-bottom','15px');
} else if (pageType === 'ChannelPage' && category === 'bola/liga-nasional'){
$('.nav-dropdown--widget-wrapper').replaceWith(this.iframe());
$('.widget-liga1').css('margin-top','15px');
$('.widget-liga1').css('margin-bottom','15px');
} else if (pageType === 'ReadPage' && category === 'bola/liga-nasional' ) {
$('.tags--topics').after(this.iframe());
$('.widget-liga1').css('margin-top','25px');
}
}
}
}
functionHandler.executor();
});
})();
/*** END of [#166318785] [Update] Pasang Widget Liga 1 - Mobile ****/
/*** START of [#167160621] Tambah Sub Menu Klasemen di Kanal Bola - Mobile ****/
$(document).ready(function () {
(function () {
const urlActive = window.location.href;
const channelName = window.kmklabs.channel.name;
const subMenuKlasemen =
`
Klasemen
`;
if (channelName == 'Bola'){
$('ul.top-nav__list').append(subMenuKlasemen);
}
if (urlActive.match('\\pages/klasemen-liga')) {
$('ul.top-nav__list').append(subMenuKlasemen);
// $('li.top-nav--item[data-title="Bola::Klasemen"]').addClass('top-nav--item_active');
}
})();
});
/*** END of [#167160621] Tambah Sub Menu Klasemen di Kanal Bola - Mobile ****/
/*** START of [#167246606] Autoplay Video Embed dan Boost Mobile Liputan6 ****/
window.addEventListener('DOMContentLoaded', () => {
if (window.kmklabs.gtm.editorialType != 'advertorial' && window.kmklabs.pageType == 'ReadPage') {
jQuery.loadScript = function (url, callback) {
jQuery.ajax({
url: url,
dataType: 'script',
success: callback,
async: true
});
}
if (typeof someObject == 'undefined') $.loadScript('https://cdn.jsdelivr.net/npm/in-view@0.6.1/dist/in-view.min.js', function () {
$('.article-video-gallery--item.article-video-gallery--item_normal .vidio-embed.article-video-gallery--item__vidio-embed').load(function () {
scrollHandler.doEfficient();
});
$('.boost-video .boost-video__wrapper .vidio-embed').load(function () {
scrollHandler.doEfficientBoostVideo();
});
});
let iframeEmbedVideo = true;
let iframeBoostVideo = true;
const Autoplay = {
'inViewPort': function (element, percentage = 0) {
// const videos = document.querySelector(element);
inView.offset({
top: 0,
right: 0,
bottom: 0,
left: 0
});
inView.threshold(percentage);
inView(element).on('enter', () => {
if (iframeEmbedVideo && element == '.article-video-gallery--item.article-video-gallery--item_normal .vidio-embed.article-video-gallery--item__vidio-embed') {
const videoEmbed = document.querySelector(element);
videoEmbed.contentWindow.postMessage('play', '*');
iframeEmbedVideo = false;
}
if (iframeBoostVideo && element == '.boost-video .boost-video__wrapper .vidio-embed') {
const videoBoost = document.querySelector(element);
videoBoost.contentWindow.postMessage('play', '*');
iframeBoostVideo = false;
}
})
.on('exit', () => {
if (element == '.article-video-gallery--item.article-video-gallery--item_normal .vidio-embed.article-video-gallery--item__vidio-embed') {
const videoEmbed = document.querySelector(element);
videoEmbed.contentWindow.postMessage('pause', '*');
iframeEmbedVideo = true;
}
if (element == '.boost-video .boost-video__wrapper .vidio-embed') {
const videoBoost = document.querySelector(element);
videoBoost.contentWindow.postMessage('pause', '*');
iframeBoostVideo = true;
}
});
},
}
const scrollHandler = {
'doStuff': function () {
Autoplay.inViewPort('.article-video-gallery--item.article-video-gallery--item_normal .vidio-embed.article-video-gallery--item__vidio-embed', 0.5)
},
'doStuffForBoost': function () {
Autoplay.inViewPort('.boost-video .boost-video__wrapper .vidio-embed', 0.5)
},
'doEfficient': function () {
const pageType = window.kmklabs.pageType;
if (pageType === 'ReadPage') {
let debounce_timer;
window.addEventListener('scroll', function () {
if (debounce_timer) {
window.clearTimeout(debounce_timer);
}
debounce_timer = window.setTimeout(function () {
scrollHandler.doStuff();
// console.log('Fire');
}, 100);
})
}
},
'doEfficientBoostVideo': function () {
const pageType = window.kmklabs.pageType;
if (pageType === 'ReadPage') {
let debounce_timer;
window.addEventListener('scroll', function () {
if (debounce_timer) {
window.clearTimeout(debounce_timer);
}
debounce_timer = window.setTimeout(function () {
scrollHandler.doStuffForBoost();
// console.log('Fire');
}, 100);
})
}
}
}
}
});
/*** END of [#167246606] Autoplay Video Embed dan Boost Mobile Liputan6 ****/
/*** START of [#167611994] [#167215786] [#168098906] [#169082384] Hanging Header, Share, Tag, Live Report ****/
$(document).ready(() => {
jQuery.loadScript = function(url, callback) {
jQuery.ajax({
url: url,
dataType: 'script',
success: callback,
async: true
});
};
if (typeof someObject == 'undefined')
$.loadScript('https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js', function() {
const domGetter = {
normalizeShare: false,
element: {
mainNavbar: '',
ads: '',
miniNavbar: '',
layoutContent: '',
subHeaderTag: '',
pageType: '',
bolaTagTitle: '',
lip6TagTitle: '',
sites: '',
isThereACoverPageInTage: false
},
doWithoutMiniNavbar() {
const adsDomain = this.getDomain();
let adsIDElementName = '';
switch (adsDomain) {
case 'liputan6':
adsIDElementName = '#div-gpt-ad-liputan6-topfrm-oop';
break;
case 'bola.com':
adsIDElementName = '#div-gpt-ad-bolacom-topfrm-oop';
break;
default:
break;
}
this.element.mainNavbar = document.querySelector('.layout__nav-content') || null;
this.element.layoutContent = document.querySelector('.layout__content') || null;
this.element.ads = document.querySelector(`${adsIDElementName}`) || null;
this.element.subHeaderTag = document.querySelector('.topics--tab') || null;
this.element.pageType = window.kmklabs.pageType || null;
this.element.bolaTagTitle = document.querySelector('.main .top-title') || null;
this.element.sites = window.kmklabs.site;
this.element.isThereACoverPageInTage = document.querySelector('.mobile .tags--cover') || false;
// this.element.lip6TagTitle =
},
doWithMiniNavbar(miniNavBarElement) {
this.element.miniNavbar = document.querySelector(miniNavBarElement) || null;
this.element.subHeaderTag = document.querySelector('.topics--tab') || null;
this.element.pageType = window.kmklabs.pageType || null;
this.element.bolaTagTitle = document.querySelector('.main .top-title') || null;
this.element.sites = window.kmklabs.site;
},
getDomain() {
return window.kmklabs.site;
}
};
const hangingHandler = {
isItOverlapping: function(DOMelementOne, DOMelementTwo) {
let overlap = false;
let elementOnePosition = DOMelementOne.getBoundingClientRect();
let elementTwoPosition = DOMelementTwo.getBoundingClientRect();
overlap = !(
elementOnePosition.right < elementTwoPosition.left ||
elementOnePosition.left > elementTwoPosition.right ||
elementOnePosition.bottom < elementTwoPosition.top ||
elementOnePosition.top > elementTwoPosition.bottom
);
return overlap;
},
isItInViewPort: function(el) {
var rect = el.getBoundingClientRect();
return (
rect.bottom > 0 &&
rect.right > 0 &&
rect.left < (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */ &&
rect.top < (window.innerHeight || document.documentElement.clientHeight) /* or $(window).height() */
);
},
disableHanging() {
const navbar = domGetter.element.mainNavbar;
const { layoutContent } = domGetter.element;
const { ads } = domGetter.element;
// if there's no ads at all (iframe etc)
if (ads === null) {
if (navbar.getBoundingClientRect().top <= 0) {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.add('layout__nav-content--no-hanging');
layoutContent.classList.add('layout__content--no-hanging');
this.tagPageHangingSubMenu();
}
}
// if there's iframe, but with ads to display
} else if (ads.querySelector('iframe') != null) {
if (navbar.getBoundingClientRect().top <= 0) {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.add('layout__nav-content--no-hanging');
layoutContent.classList.add('layout__content--no-hanging');
}
}
// if there's iframe, but no ads to display
} else if (navbar.getBoundingClientRect().top <= 0) {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.add('layout__nav-content--no-hanging');
layoutContent.classList.add('layout__content--no-hanging');
this.tagPageHangingSubMenu();
}
}
},
enableHanging() {
const navbar = domGetter.element.mainNavbar;
const { layoutContent } = domGetter.element;
const { ads } = domGetter.element;
// if there's no ads at all (iframe etc)
if (ads === null) {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.remove('layout__nav-content--no-hanging');
layoutContent.classList.remove('layout__content--no-hanging');
this.tagPageNoHangingSubMenu();
}
// if there's iframe, but with ads to display
} else if (ads.querySelector('iframe') != null) {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.remove('layout__nav-content--no-hanging');
layoutContent.classList.remove('layout__content--no-hanging');
}
// if there's iframe, but no ads to display
} else {
if (!domGetter.element.isThereACoverPageInTage) {
navbar.classList.remove('layout__nav-content--no-hanging');
layoutContent.classList.remove('layout__content--no-hanging');
this.tagPageNoHangingSubMenu();
}
}
},
tagPageHangingSubMenu(adsElement = null) {
const pageType = domGetter.element.pageType;
const sites = domGetter.element.sites;
const subheaderMenuTag = domGetter.element.subHeaderTag;
const tagTitle = domGetter.element.bolaTagTitle;
const navbar = domGetter.element.mainNavbar;
if (sites === 'bola.com') {
switch (pageType) {
case 'SmartTopicPage':
if (navbar.classList.contains('layout__nav-content--no-hanging')) {
subheaderMenuTag.classList.add('topics--tab--hanging-bola');
}
break;
case 'TagPage':
if (!this.isItInViewPort(tagTitle)) {
tagTitle.style.marginBottom = `${tagTitle.clientHeight}px`;
subheaderMenuTag.classList.add('topics--tab--hanging-bola');
}
break;
default:
break;
}
}
if (sites === 'liputan6') {
switch (pageType) {
case 'SmartTopicPage':
if (navbar.classList.contains('layout__nav-content--no-hanging')) {
subheaderMenuTag.classList.add('topics--tab--hanging-liputan6');
}
break;
case 'TagPage':
subheaderMenuTag.classList.add('topics--tab--hanging-liputan6');
break;
default:
break;
}
}
},
tagPageNoHangingSubMenu(adsElement = null) {
const pageType = domGetter.element.pageType;
const sites = domGetter.element.sites;
const subheaderMenuTag = domGetter.element.subHeaderTag;
const navbar = domGetter.element.mainNavbar;
const tagTitle = domGetter.element.bolaTagTitle;
if (sites === 'bola.com') {
switch (pageType) {
case 'SmartTopicPage':
if (!navbar.classList.contains('layout__nav-content--no-hanging')) {
subheaderMenuTag.classList.remove('topics--tab--hanging-bola');
}
break;
case 'TagPage':
subheaderMenuTag.classList.remove('topics--tab--hanging-bola');
tagTitle.style.marginBottom = `0px`;
break;
default:
break;
}
}
if (sites === 'liputan6') {
switch (pageType) {
case 'SmartTopicPage':
if (!navbar.classList.contains('layout__nav-content--no-hanging')) {
subheaderMenuTag.classList.remove('topics--tab--hanging-liputan6');
}
break;
case 'TagPage':
subheaderMenuTag.classList.remove('topics--tab--hanging-liputan6');
break;
default:
break;
}
}
}
};
const scrollHandler = {
directionScrollValue: null,
getNavbar() {
const navbar = document.querySelector('.layout__nav-content');
return navbar;
},
topSharePosition: $('#top-share-buttons').length > 0 ? $('#top-share-buttons').offset().top : 0,
do(currentScroll) {
const navbar = this.getNavbar();
if (navbar) {
switch (scrollHandler.directionScrollValue) {
case 'down':
hangingHandler.disableHanging();
if (currentScroll > scrollHandler.topSharePosition && window.kmklabs.article && window.kmklabs.article.type == 'TextTypeArticle') {
$('.share-main').removeClass('share-main__no-hanging');
$('.share-main').addClass('share-main__hanging');
}
break;
case 'up':
hangingHandler.enableHanging();
if (window.kmklabs.article && window.kmklabs.article.type == 'TextTypeArticle') {
$('.share-main').addClass('share-main__no-hanging');
$('.share-main').removeClass('share-main__hanging');
}
break;
default:
break;
}
}
},
scrollAtribute: {
last_known_scroll_position: 0,
ticking: false
},
efficientScroll() {
window.addEventListener('scroll', function(e) {
if (!domGetter.normalizeShare) {
domGetter.normalizeShare = true;
}
let currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
scrollHandler.scrollAtribute.last_known_scroll_position = window.scrollY;
if (!scrollHandler.scrollAtribute.ticking) {
window.requestAnimationFrame(function() {
scrollHandler.scrollDirection();
scrollHandler.do(currentScroll);
scrollHandler.scrollAtribute.ticking = false;
});
scrollHandler.scrollAtribute.ticking = true;
}
});
},
lastScroll: 0,
tick: false,
scrollDirection() {
lastScrollPosition = window.scrollY;
if (!scrollHandler.tick) {
setTimeout(
function() {
let currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
if (currentScroll > 0 && scrollHandler.lastScroll <= currentScroll) {
scrollHandler.lastScroll = currentScroll;
scrollHandler.directionScrollValue = 'down';
} else {
scrollHandler.lastScroll = currentScroll;
scrollHandler.directionScrollValue = 'up';
}
this.oldScroll = this.scrollY;
scrollHandler.tick = false;
}.bind(this),
100
);
}
scrollHandler.tick = true;
}
};
const cssCreator = {
cssStyle() {
let miniBar = 0;
let adsHeight = 0;
if (domGetter.element.miniNavbar != null) {
miniBar = domGetter.element.miniNavbar.clientHeight;
}
if (domGetter.element.ads != null) {
adsHeight = domGetter.element.ads.clientHeight;
}
let marginTop = '';
let paddingTop = '';
let layoutContentTranslate = document.querySelector('.layout__content');
let listOfStyle = window.getComputedStyle(layoutContentTranslate);
let marginTopAttribute = listOfStyle['marginTop'];
let paddingTopAttribute = listOfStyle['paddingTop'];
marginTop = marginTopAttribute.substring(0, marginTopAttribute.length - 2);
paddingTop = paddingTopAttribute.substring(0, paddingTopAttribute.length - 2);
let result = parseInt(marginTop) + parseInt(paddingTop);
const AdsWithNavbar = adsHeight + 100 + miniBar;
const rawCSS = `
.topics--tab--hanging-bola {
position: fixed;
top: 0px;
width: 100%;
z-index: 2;
border-bottom: none;
}
.topics--tab--hanging-liputan6 {
position: fixed;
top: 0px;
width: 100%;
z-index: 2;
border-bottom: none;
}
.js-snapped-nav .js-has-tb .layout .layout__nav-content{
-webkit-transform: translateY(0px);
transform: translateY(0px);
transition: transform 300ms linear;
}
.js-has-tb .share-main__hanging {
-webkit-transform: translateY(0px);
transform: translateY(0px);
transition: transform 300ms linear;
}
.layout__content, .share-main{
-webkit-transition: padding-top 0.3s ease-in-out;
-moz-transition: padding-top 0.3s ease-in-out;
-o-transition: padding-top 0.3s ease-in-out;
transition: padding-top 0.3s ease-in-out;
webkit-backface-visibility: hidden;
}
.share-main__no-hanging{
-webkit-transform: translateY(-${result}px);
transform: translateY(-${result}px);
transition: transform 300ms linear;
}
.js-snapped-nav .js-has-tb .layout .layout__nav-content--no-hanging, .js-has-tb .share-main__no-hanging {
-webkit-transform: translateY(-${AdsWithNavbar}px);
transform: translateY(-${AdsWithNavbar}px);
transition: transform 300ms linear;
}
.js-snapped-nav .layout .layout__nav-content--no-hanging, .js-has-tb .share-main__no-hanging {
-webkit-transform: translateY(-${AdsWithNavbar}px);
transform: translateY(-${AdsWithNavbar}px);
transition: transform 300ms linear;
}
.layout .layout__nav-content.layout__nav-content--before {
position: absolute;
top: unset;
}
.js-has-tb .layout__nav-content {
top: unset;
}
.share-main {
top: 0px;
height: 46px;
background-color: #FFFFFF !important;
padding: 8px 15px;
border-top: 1px solid #eeeeee;
box-shadow: 0 3px 4px 0 rgba(52,52,52,.18);
width: 100%;
position: fixed;
display: block;
z-index: 5;
-webkit-transform: translateY(-50px);
transform: translateY(-50px);
transition: transform 300ms linear;
}
.share-main .share-main__text {
display: inline-block;
vertical-align: top;
padding: 10px 11px 8px 0;
font-family: AcuminPro;
font-size: 12px;
font-weight: 600;
color: #333333;
}
.share-main .share-buttons--item {
width: 15.8%;
margin-left: -4px;
}
.share-main .share-buttons--item__link {
height: 30px;
}
.share-main .share-buttons--item__link_copy {
border-radius: 2.1px;
border: solid 1px rgb(250, 100, 0);
padding: 10px 8px;
font-family: AcuminPro;
font-size: 2vw;
font-weight: 600;
text-align: center;
color: #FFFFFF;
background-color: rgb(250, 100, 0);
}
.share-main .share-buttons--item:nth-child(6) {
width: 20%;
vertical-align: top;
}
.copy-link-button-success::before {
content: "Copied";
color: rgb(250, 100, 0);
font-weight: bold;
}
`;
return rawCSS;
},
cssAppend() {
const styleSheet = document.createElement('style');
styleSheet.type = 'text/css';
styleSheet.innerText = this.cssStyle();
document.head.appendChild(styleSheet);
}
};
const minibarHandler = {
getSubchannel: function() {
return window.kmklabs.category.name;
},
minibarAdjustment: function() {
const subchannelName = this.getSubchannel();
switch (subchannelName) {
case 'NBA':
domGetter.doWithMiniNavbar('.navbar--custom-submenu');
break;
case 'Liga1':
domGetter.doWithMiniNavbar('.subheader-tabs');
break;
case 'Pilpres':
domGetter.doWithMiniNavbar('.subheader-tabs');
break;
default:
domGetter.doWithMiniNavbar('.subheader-tabs');
break;
}
}
};
const hangingShare = {
prepare: function() {
var title = $('.article-header__title').text();
title = encodeURIComponent(title);
var shareMain =
`
`;
$('.mobile').prepend(shareMain);
// $(shareMain).insertAfter($('.layout__nav-content'));
},
getUrl: function(socmed) {
var utm = '%3Futm_source%3DMobile%26utm_medium%3D' + socmed + '%26utm_campaign%3DShare_Hanging';
var currentUrl = window.location.href;
currentUrl = currentUrl.substr(0, currentUrl.indexOf('?'));
if (currentUrl == '') {
currentUrl = window.location.href;
}
if (socmed == 'copy-link') {
utm = '?utm_source=Mobile&utm_medium=copy-link&utm_campaign=Share_Hanging';
return currentUrl + utm;
}
currentUrl = encodeURIComponent(currentUrl);
return currentUrl + utm;
},
copyLink: function() {
$('.share-buttons--item__link_copy').click(function() {
var clipboard = new ClipboardJS('.share-buttons--item__link_copy');
$(this).text('');
$(this).css('transition', 'all 2s ease 0s');
$(this).css('background-color', '#FFFFFF');
$(this).addClass('copy-link-button-success');
});
},
pushShareTracking: function(provider) {
window.dataLayer.push({
event: 'click',
feature_name: 'social-share',
feature_location: 'hanging',
feature_position: provider
});
},
shareButtonClickHandler: function() {
$('#hanging-share-buttons .share-buttons--item__link_facebook').click(function() {
hangingShare.pushShareTracking('facebook');
});
$('#hanging-share-buttons .share-buttons--item__link_whatsapp').click(function() {
hangingShare.pushShareTracking('whatsapp');
});
$('#hanging-share-buttons .share-buttons--item__link_line').click(function() {
hangingShare.pushShareTracking('line');
});
$('#hanging-share-buttons .share-buttons--item__link_twitter').click(function() {
hangingShare.pushShareTracking('twitter');
});
$('#hanging-share-buttons .share-buttons--item__link_copy').click(function() {
hangingShare.pushShareTracking('copy-link');
});
}
};
if (!window.kmklabs.article || window.kmklabs.article.type == 'TextTypeArticle' || window.kmklabs.pageType === 'LiveReportPage') {
domGetter.doWithoutMiniNavbar();
minibarHandler.minibarAdjustment();
cssCreator.cssAppend();
scrollHandler.efficientScroll();
if (window.kmklabs.article && window.kmklabs.article.type == 'TextTypeArticle') {
hangingShare.prepare();
hangingShare.copyLink();
hangingShare.shareButtonClickHandler();
}
}
});
});
/*** END of [#167611994] [#167215786] [#168098906] [#169082384] Hanging Header, Share, Tag, Live Report ****/
/*** START of [GPT] INFEED SDK - MOBILE ****/
if ( ["ReadPage"].includes(window.kmklabs.pageType) )
{
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
if( getUrlParameter('related') != 'dable' )
{
var observer = new MutationObserver(function(mutations) {
if (document.getElementById('inf-1'))
{
var templateID = 149;//130
/*if( $('.article-snippet--related--new-experience').length>0 )
{
templateID = 146;
}*/
infInitCfg = {
publisherId : 4685495694,
wrapperPage : 'https://m.liputan6.com/infeed/wrapper.html',
slots : ['inf-1', 'inf-2', 'inf-3', 'inf-4', 'inf-5', 'inf-6'],
seoUrl : true,
templateID : templateID
};
var infJS = document.createElement("script");
infJS.type = "text/javascript";
infJS.async = 1;
infJS.src = "https://d.infeed.id/resources/js/v0.0.2/infeed-init.js";
document.body.appendChild(infJS);
}
});
observer.observe(document.querySelector('.relateds--async.js-related-articles-placeholder'), {
attributes: true, childList: true, characterData: true
});
}
}
else if ( ["ChannelPage"].includes(window.kmklabs.pageType) )
{
if (document.getElementById('inf-1'))
{
var templateID = 161;
if( $('.article-snippet--related--new-experience').length>0 )
{
templateID = 146;
}
if (window.kmklabs.channel.full_slug === 'photo' || window.kmklabs.channel.full_slug === 'video')
{
templateID = 162;
}
infInitCfg = {
publisherId : 4685495694,
wrapperPage : 'https://m.liputan6.com/infeed/wrapper.html',
slots : ['inf-1', 'inf-2', 'inf-3', 'inf-4', 'inf-5', 'inf-6'],
seoUrl : true,
templateID : templateID
};
var infJS = document.createElement("script");
infJS.type = "text/javascript";
infJS.async = 1;
infJS.src = "https://d.infeed.id/resources/js/v0.0.2/infeed-init.js";
document.body.appendChild(infJS);
}
}
/*** END of [GPT] INFEED SDK - MOBILE ****/
/*** START of [#165306544] Buzzer Ramadhan Mobile ****/
window.addEventListener('DOMContentLoaded', function () {
(function () {
const appendSpinder = {
'do': function () {
const rawHTML = `