Rockstar announces the new GTA Online Grotti Turismo Omaggio and the upcoming winter update
‘; }); pollOptions.innerHTML = pollOptionsDom; pollCount.innerHTML = totalVotes + ‘votes’; } function updatePollCountOnAnswer(selectedOption) { var pollData = pollDataDefault; renderPollWidget(PollData, selectedoption, true); } function renderPollWidget(pollData, selected option, isAnswered) { if (!pollData) return; pollData.option1_count = pollData.option1_count || 0; pollData.option2_count = pollData.option2_count || 0; pollData.option3_count = pollData.option3_count || 0; pollData.option4_count = pollData.option4_count || 0; if (isAnswered) { if (selectedOption == “option1”) pollData.option1_count += 1; if (selectedOption == “option2”) pollData.option2_count += 1; if (selectedOption == “option3”) pollData.option3_count += 1; if (selectedOption == “option4″) pollData.option4_count += 1; } if (isAnswered || selected option) { var predictorPromotionalBannerContainer = $(.predictor-contest-banner-container.Article-poll”); if (predictorPromotionalBannerContainer) { removeClass(predictorPromotionalBannerContainer, “hidden”); } } var totalVotes = Number (pollData.option1_count + pollData.option2_count + pollData.option3_count + pollData.option4_count); if (totalVotes && !Number.isNaN(totalVotes)) { var option1Percent = pollData.option1_count / totalVotes * 100; var option2Percent = pollData.option2_count / totalVotes * 100; var option3Percent = pollData.option3_count / totalVotes * 100; var option4Percent = pollData.option4_count / totalVotes * 100; var optionPercents = [option1Percent, option2Percent, option3Percent, option4Percent]; var pollOptions = $(“#poll-options”); var pollCount = $(“#poll-count”); var pollOptionsDom = ”; where optionsArray = [‘option1’, ‘option2’]; if (pollData.option3 !== “” && pollData.option3 !== null) { optionsArray.push(‘option3’) } if (pollData.option4 !== “” && pollData.option4 !== null) { optionsArray .push(‘option4’) } optionsArray.forEach(function (option, index) { var clickHandler=”onclick=”answerPoll(event, \”‘ + option + ‘\’)”‘; var optionClass = [‘poll-option’]; if (selectedOption) { optionClass.push(‘polling-option-response’); clickhandler=””; } if (selected option === option) { optionClass.push(‘selected-polling-option’); } pollOptionsDom += ‘
‘ + survey data[option] + ‘
‘; if (selectedOption) { pollOptionsDom += ‘
‘ + Math.round(optionPercentages[index]) + ‘%
‘; } pollOptionsDom += ‘
‘; }); pollOptions.innerHTML = pollOptionsDom; pollCount.innerHTML = totalVotes + ‘votes’; if (totalVotes > 10) { pollCount.classList.remove(“hidden”); } } trackArticlePollImpression(pollData); } function responsePoll(e, selectedOption) { e.preventDefault(); updatePollCountOnAnswer(selected option); var isDesktop = “1”; var gaPayload = { “question” : pollDataDefault.question, “answer” : e.target.textContent, “answer_option”: selectedOption.replace(“option”, “Option”), “category”: “GTA”, “site_location” : window.location.href, } if (pollTaglinePosition && pollTaglinePosition != “”) { gaPayload[“poll_position”] = holeSloganItem; } if (isDesktop) { enPayload[“device”] = “Desktop”; } else { gaPayload[“device”] = “Mobile”; } gtag(“event”, “ARTICLE_POLL_RESPONSE”, gaPayload); var url=” var data = { “poll_type”: “article”, “option”: selected option } pureJSAjaxPost(url, data, onPollResponseSuccess.bind(this, selected option), onPollResponseFail.bind(this, selected option), null , false) ; } function trackSponsoredLinkClick(e) { var pollTheme = “default”; gtag(‘event’, ‘click’, { ‘event_category’: ‘PollSponsoredLink’, ‘event_label’: pollTheme }); } var articlePollImpressionTracked = false ; function trackArticlePollImpression(pollData) { var pollElement = $(“#poll”); var intersectionObserverForArticlePoll = new IntersectionObserver( function(entries) { entries.forEach(function(entry) { if (articlePollImpressionTracked) return; if (!entry.target || ! entry.isIntersecting || entry.intersectingRatio < 0.5) return; setTimeout(function() { if (isInViewport(entry.target)) { articlePollImpressionTracked = true; var isDesktop = "1"; var gaPayload = { " question": pollData.question, "category": "GTA", "page_url": window.location.href, } if (isDesktop) { gaPayload["device"] = "Desktop"; } else { gaPayload["device"] = "Mobile"; } if (holeTaglinePosition && holeTaglinePosition != "") { enPayload["poll_position"] = pollTaglinePosition; } gtag("event", "ARTICLE_POLL_IMPRESSION", gaPayload); intersectionObserverForArticlePoll.unobserve(entry.target); } }, 1000); }); }, {threshold: 0.5 }); if (pollElement){ var isAnswered = pollElement.querySelector(.option-poll replied"); if (!isAnswered) { intersectionObserverForArticlePoll.observe(pollElement); } } }
” modalPopup.closeOnEsc = false; modalPopup.setHeader(“Why didn’t you like this content?”); modalPopup.setContentText(modalText); modalPopup.addCancelOkButton(“Submit”, resetRatingAndFeedbackForm, sendRating); modalPopup.removeCloseModalIcon(); modalPopup .disableDismissPopup(); modalPopup.open(); } else { sendRating(index); } } function sendRating() { var requestPayload = { “post_id”: 1749222, “rating_value”: ratingValue } if (ratingValue > 3) { requestPayload .rating_feedback_type = null; requestPayload.rating_feedback = null; } else { if (!$(‘input[name=”drone”]:checked’) || !$(‘input[name=”drone”]:checked’).value) { showErrorMessage(‘option’); return; } if (!$(.textarea of note after rating-feedback”) || !$(.textarea of note after rating-feedback”).value) { showErrorMessage(‘note’); return; } var selected option = $(‘input[name=”drone”]:checked’).value; var feedbackNote = $(.post-rating-feedback note textarea”).value; requestPayload.rating_feedback_type = selected option; requestPayload.rating_feedback = feedbackNote; } pureJSAjaxPost(addratingAPI, requestPayload, onsaveRatingSuccess, onsaveRatingFail, function() {}, true ); } function resetRatingAndFeedbackForm() { var activeStars = Array.from($all(‘.rating span.rating-star.active’)); for (var i=0; i < activeStars.length; i++) { activeStars[i].classList.remove("aktywne"); } if ($('wejście[name="drone"]:sprawdzone')) { $('wejście[name="drone"]:sprawdzone).sprawdzone = fałsz; } var userNote = document.querySelector(.obszar tekstowy notatki po ocenie-feedbacku"); uwaga użytkownika.value=""; modalPopup.close(); } funkcja onsaveRatingSuccess() { modalPopup.close(); savePostIdInUserRatedPostsCookie(); $("#układ-post-oceny").classList.add("ukryty"); $("#wiadomość-po-oceny").classList.remove("ukryty"); window.setInterval(funkcja showMessage() { $("#widget-post-rating").classList.add("ukryty"); }, 3000); } funkcja onsaveRatingFail() { console.error('Zapisanie oceny wpisu nie powiodło się!'); modalPopup.close(); } funkcja savePostIdInUserRatedPostsCookie() { userRatedPostIds.push(1749222); var czas wygaśnięcia = nowa data(); wygaśnięcieTime.setMonth(expiryTime.getMonth() + 12); // Wygaśnie po 1 roku setCookie("user_rated_post_ids", JSON.stringify(userRatedPostIds), wygaśnięcieTime); } funkcja isPostRatedByUser() { var userRatedPostIds = getCookie('user_rated_post_ids'); if (userRatedPostIds) { spróbuj { userRatedPostIds = JSON.parse(userRatedPostIds); } catch (err) { console.error(err); zwróć fałsz; } } else {zwróć fałsz; } if(userRatedPostIds.indexOf(1749222) >= 0) { return true; } else {return false; } } function getRatingCountByPostId(postId) { return new promise(function(resolve, reject) { pureJSAjaxGet(getRatingCountBaseURL + postId + ‘/rating/count’, function(data) { try { data = JSON.parse(data); if ( data.meta_value) { resolve(data.meta_value); } reject(“Failed to get rating count for post:” + postId); } catch (err) { reject(“Failed to get rating count for post:” + postId); } },function(err) { reject(“Failed to get the number of ratings for the post:” + postId); }, true); }); } function showErrorMessage(message type) { var MessageContainerId = ‘#’ + message type + ‘-error’; $(messageContainerId).classList.remove(‘hidden’); window.setInterval(function () { $(messageContainerId).classList.add(“hidden”); }, 5000); } (function() { var callFired = false; function lazyLoadPostRating() { if (callFired) return; callFired = true; if (!isPostRatedByUser()) { getRatingCountByPostId(1749222) .then(function(ratingCount) { if (ratingCount < 10) { $("#post-rating-widget").classList.remove("hidden"); } }) .catch(function(err){ console.error(err); }); } } document.addEventListener ("scroll", lazyLoadPostRating, { passive: true, once: true }); document.addEventListener("mousemove", lazyLoadPostRating, { passive: true, once: true }); document.addEventListener("touchmove", lazyLoadPostRating, { passive: true, once: true }); })();