Hi-lite Terbaru
{ ceknewhilite(); }, 180000); pauseJwPlayer(0); }); function hideNotifikasi() { setTimeout(function() { document.getElementById("notifikasi").style.visibility = "hidden"; document.getElementById("notifikasi").style.top = "-100px"; }, 5000); } $(document).mouseup(function(e) { var menu = $('#social-share'); if (!menu.is(e.target) && menu.has(e.target).length === 0) { } }); var lastId = 0; var last_page = 20; var scrolingPosition = 0; var id_index_vertikal = 0; var lastScroling = 0; var lastIndex = 0; var swiper_artikel = new Swiper(".SwiperArtikel", { direction: "vertical", mousewheel: true, navigation: { nextEl: ".swipe-control-vertical", }, preloadImages: true, lazy: true, on: { slideChange: function(e) { if (scrolingPosition < e.activeIndex) { pauseJwPlayer(e.activeIndex - 1); if (lastId < e.activeIndex) { var index_add = parseInt(e.activeIndex) + 1; var modulus = index_add % 10; last_page = index_add; } lastId = e.activeIndex; } else { pauseJwPlayer(e.activeIndex + 1); } id_index_vertikal = e.activeIndex; scrolingPositionInfografis = 0 ; scrolingPositionFoto = 0; scrolingPosition = e.activeIndex; }, slideNextTransitionEnd: function(e) { lastScroling = e.activeIndex; if (lastScroling > lastIndex) { console.log("push DL ", lastId) var idhilite = $('.list-data-' + e.activeIndex).attr('idhilite'); let kanal_event = $('.layer-data-' + e.activeIndex).attr('data-kanal'); let subkanal_event = $('.layer-data-' + e.activeIndex).attr('data-subkanal'); let idnews_event = $('.layer-data-' + e.activeIndex).attr('data-idnews'); let author_event = $('.layer-data-' + e.activeIndex).attr('data-author'); let editor_event = $('.layer-data-' + e.activeIndex).attr('data-editor'); let publish_event = $('.layer-data-' + e.activeIndex).attr('data-publish'); let tags_event = $('.layer-data-' + e.activeIndex).attr('data-tags'); let title_event = $('.layer-data-' + e.activeIndex).attr('data-title'); let dataurl_event = $('.layer-data-' + e.activeIndex).attr('data-url'); let title_artikel = $('.layer-data-' + e.activeIndex).attr('data-title-artikel'); let editor_artikel = $('.layer-data-' + e.activeIndex).attr('data-editor-artikel'); let article_url = $('.layer-data-' + e.activeIndex).attr('data-oringin-link'); let running_number = e.activeIndex + 1; let location_origin = window.location.hostname; var content_type = 'artikel'; if (kanal_event == 'sindovideo') content_type = 'video'; if (typeof(title_artikel) != "undefined" ) { window.dataLayer.push({ event: 'promotion_view', event_category: 'article', event_action: 'article_list_view', event_label: 'hilite_' + kanal_event + '_' + article_url, content_type: content_type, judul: title_artikel, publish_date: publish_event, kanal: kanal_event, subkanal: subkanal_event, article_id: idnews_event, author: author_event, editor: editor_artikel, tags: tags_event, data_source: 'Non AMP', ecommerce: { promoView: { promotions: [{ id: idnews_event, name: title_artikel, creative: article_url, position: running_number + '_main_hilite' }] } } }); } lastIndex = e.activeIndex; } } } }); var scrolingPositionFoto = 0; var swiper = new Swiper(".SwiperFoto", { pagination: { el: ".swiper-pagination", }, preloadImages: true, lazy: true, navigation: { nextEl: ".swiper-button-next-foto", prevEl: ".swiper-button-prev-foto", }, on: { slideChange: function(e) { var index = id_index_vertikal; var scroll = ""; if (scrolingPositionFoto < e.activeIndex) { scroll = "next_image"; } else { scroll = "previous_image"; } let kanal_event = $('.layer-data-' + index).attr('data-kanal'); let subkanal_event = $('.layer-data-' + index).attr('data-subkanal'); let idnews_event = $('.layer-data-' + index).attr('data-idnews'); let author_event = $('.layer-data-' + index).attr('data-author'); let editor_event = $('.layer-data-' + index).attr('data-editor'); let publish_event = $('.layer-data-' + index).attr('data-publish'); let tags_event = $('.layer-data-' + index).attr('data-tags'); let title_event = $('.layer-data-' + index).attr('data-title'); let dataurl_event = $('.layer-data-' + index).attr('data-url'); let title_artikel = $('.layer-data-' + index).attr('data-title-artikel'); let editor_artikel = $('.layer-data-' + index).attr('data-editor-artikel'); let article_url = $('.layer-data-' + index).attr('data-oringin-link'); let location_origin = window.location.hostname; var content_type = 'artikel'; if (kanal_event == 'sindovideo') content_type = 'video'; if (typeof(title_artikel) != "undefined" ) { window.dataLayer.push({ event: 'general_event', event_category: 'article', event_action: scroll, event_label: 'hilite_' + kanal_event + '_' + article_url, content_type: content_type, judul: title_artikel, publish_date: publish_event, kanal: kanal_event, subkanal: subkanal_event, article_id: idnews_event, author: author_event, editor: editor_artikel, tags: tags_event, data_source: 'Non AMP', }); } scrolingPositionFoto = e.activeIndex; } } }); var scrolingPositionInfografis var swiper = new Swiper(".SwiperInfografis", { pagination: { el: ".swiper-pagination", }, preloadImages: true, lazy: true, navigation: { nextEl: ".swiper-button-next-infografis", prevEl: ".swiper-button-prev-infografis", }, on: { slideChange: function(e) { var index = id_index_vertikal; var scroll = ""; if (scrolingPositionInfografis < e.activeIndex) { scroll = "next_image"; } else { scroll = "previous_image"; } let kanal_event = $('.layer-data-' + index).attr('data-kanal'); let subkanal_event = $('.layer-data-' + index).attr('data-subkanal'); let idnews_event = $('.layer-data-' + index).attr('data-idnews'); let author_event = $('.layer-data-' + index).attr('data-author'); let editor_event = $('.layer-data-' + index).attr('data-editor'); let publish_event = $('.layer-data-' + index).attr('data-publish'); let tags_event = $('.layer-data-' + index).attr('data-tags'); let title_event = $('.layer-data-' + index).attr('data-title'); let dataurl_event = $('.layer-data-' + index).attr('data-url'); let title_artikel = $('.layer-data-' + index).attr('data-title-artikel'); let editor_artikel = $('.layer-data-' + index).attr('data-editor-artikel'); let article_url = $('.layer-data-' + index).attr('data-oringin-link'); let location_origin = window.location.hostname; var content_type = 'artikel'; if (kanal_event == 'sindovideo') content_type = 'video'; if (typeof(title_artikel) != "undefined" ) { window.dataLayer.push({ event: 'general_event', event_category: 'article', event_action: scroll, event_label: 'hilite_' + kanal_event + '_' + article_url, content_type: content_type, judul: title_artikel, publish_date: publish_event, kanal: kanal_event, subkanal: subkanal_event, article_id: idnews_event, author: author_event, editor: editor_artikel, tags: tags_event, data_source: 'Non AMP', }); } scrolingPositionInfografis = e.activeIndex; } } }); function load_pagination(page) { var url = 'https://hi-lite.sindonews.com/more/desktop/'; $.ajax({ url: url + page, dataType: "html", success: function(e) { swiper_artikel.appendSlide([e]); swiper_artikel.update(true); video_player(); } }) } function pauseJwPlayer(i) { var last_idhilite = $('.list-data-' + i).attr('idhilite'); if (document.getElementById('video-play-' + last_idhilite)) { ; document.getElementById('video-play-' + last_idhilite).contentWindow.controlPause(); } } function addScroling(index) { var slot; var slotName = generateNextSlotName(); var parent = document.getElementById('div-gpt-ad-bottom_sticky-' + index); var child = document.createElement('div'); child.setAttribute('id', slotName); parent.appendChild(child); googletag.cmd.push(function() { slot = googletag.defineSlot('/7108725/sindonews_desktop/homepage', [ [970, 250], [970, 90], [1, 1] ], slotName).setTargeting('pos', ['bottom_1']).addService(googletag.pubads()); googletag.display(slotName); googletag.pubads().refresh([slot]); }); } function video_player() { $('.list-artikel').each(function(i) { var data_type = $('.vod-' + i).attr('data-type'); var id_news_and_date = $('.vod-' + i).attr('value'); if (data_type == "video") { var split_date = id_news_and_date.split("-"); var year = split_date[0]; var id_hilite = split_date[1]; $.ajax({ url: 'https://hi-lite.sindonews.com/player/iframe', data: { year: year, id: id_hilite, type: "desktop" }, method: "GET", success: function(results) { $('.vod-' + i).html(results); } }) } }); } function goBack() { if (!document.referrer) { window.location.href = 'https://www.sindonews.com'; } else { history.go(-1); }; } function topFunction() { swiper_artikel.slideTo($('.pag2').index(), 1000, false); var page = 'https://hi-lite.sindonews.com/'; window.location.href = page; } function videoPlay(index) { document.getElementById('video-frame-' + index).style.display = "none"; } function playVideo(index) { document.getElementById('video-frame-' + index).style.display = "none"; document.getElementById('video-play-' + index).contentWindow.controlPlayer(); } function pause(index) { document.getElementById('video-frame-' + index).style.display = "block"; } function ceknewhilite() { var url = 'https://hi-lite.sindonews.com/newartikel/'; var id_news = 46049; if (id_news != "") { $.ajax({ url: url + id_news, method: "GET", dataType: "json", success: function(results) { if (results.valid == true) { if (results.data >= "10") { document.getElementById("notifikasi").style.visibility = "visible"; document.getElementById("notifikasi").style.top = "100px"; hideNotifikasi(); } } } }) } } function copyLink(index) { var copyText = document.getElementById("urlLink-" + index); document.execCommand("copy"); navigator.clipboard.writeText(copyText.value); alert("Link Copied"); } var nextSlotId = 1; function generateNextSlotName() { var id = nextSlotId++; return 'adslot' + id; } function bindEvent(element, eventName, eventHandler) { if (element.addEventListener) { element.addEventListener(eventName, eventHandler, false); } else if (element.attachEvent) { element.attachEvent('on' + eventName, eventHandler); } } bindEvent(window, 'message', function(e) { var mediaLabel = e.data.mediaLabel var date_publish = e.data.date_publish var kode_user = e.data.kode_user var title = e.data.title var tag = e.data.tag var url_original = e.data.url_original var author = e.data.author var id_news = e.data.id_news if (typeof e.data.mediaLabel !== 'undefined') { let location_origin = window.location.hostname; window.dataLayer.push({ event: 'general_event', event_category: 'video', event_action: 'play_video', event_label: e.data.mediaLabel, judul: title, publish_date: date_publish, kanal: 'sindovideo', subkanal: 'news', tags: tag, author: author, editor: kode_user, article_id: id_news, data_source: 'Non AMP' }); } });