General

Political Football

‘);
}
});

/Scroll IF # id exist in URL
*/
if(url_id!=”){
var s = url_id;
var n = s.indexOf(‘/’);
if(n!=”&& typeof n!= ‘undefined’){
var id_var = s.substring(0, n != -1 ? n : s.length);
$(‘html, physique’).animate({
scrollTop: $(‘#’+id_var).offset().prime
},2000);
return groundless;
}
}

/Test for audio
*/

/script to address Encourage Button Match
*/

if(window.attachEvent){
window.attachEvent(‘onpopstate’, datHash);
}

unbiased datHash(tournament){
var str = $(‘#goback’).val();
if(str==”){
window.history.sprint(-Math.abs(pageChange));
}else{
window.history.sprint(-Math.abs(pageChange));
}
return groundless;
}

//
$(‘.submit-edit-hyperlink’).attr(‘href’, unbiased( _, motion){
return motion.substitute(‘https’, ‘http’);
});

/@unbiased for load article in limitless scroll
*/

$(‘a.inifiniteLoader’).conceal();

unbiased loadArticle(pageNumber){

$(‘a.inifiniteLoader’).stamp(‘lickety-split’);

$.ajax({

url : “https://www.thenation.com/wp-admin/admin-ajax.php”,
form : ‘POST’,
cache : groundless,
dataType : ‘json’,
facts : {motion:’infinite_scroll’,page_no: pageNumber,loop_file: ‘articleload’,slug:’activism,cities,class,tradition,economics,economy,authorities,labor,media,political-figures,political-ideologies,politics,social-justice,society,states’,curr_post_id:’387787′},
success : unbiased(receivedHTML){

if ( typeof receivedHTML == ‘object’ && receivedHTML!=null ){
if(typeof receivedHTML.html!==’undefined’ && receivedHTML.html!=”){
html = receivedHTML.html;
}
}else{
$(‘a.inifiniteLoader’).conceal();
$(“#single_article_footer”).stamp();
}

$(‘a.inifiniteLoader’).conceal(‘1000’);

if ( typeof receivedHTML == ‘object’ && receivedHTML!=null ){

$(“#wrap”).append(html); // This also can even be the div where our bellow may maybe be loaded

var postID = $($.parseHTML(html)).filter(“.scrolltrace”).attr(‘article-submit-id’);

$(‘.abody-‘+postID+’ .article-physique-interior’).youngsters(‘p:first-of-form’).html(unbiased (i, html) {
if ( $(‘.abody-‘+postID).youngsters(‘img’).length == “0” ){
var text = $(‘.abody-‘+postID+’ .article-physique-interior’).youngsters(‘p:first-of-form’).html();
$(‘.abody-‘+postID+’ .article-physique-interior’).youngsters(‘p:first-of-form’).html(text.substitute(/^(
<.>)?([A-Za-z0-9])/g,’$1$2‘));
}
});

if( !$(‘.abody-‘ + postID +”).mother or father().mother or father().hasClass(‘textContainer_Truncate’) ){
$(‘

‘).insertAfter(‘.abody-‘ + postID);
}

/Article Divider Depend
*/
article_divider = article_divider+1;
$(‘.abody-‘+postID+”).attr(“article-number”,article_divider);

/*for hiding meterpaywall popups when pixel adverts call starts here*/
var hidePixelBool = groundless;
var meetkatstep1 = jQuery(‘#paywall .step.one’);
var meetkatstep2 = jQuery(‘#paywall .step.two’);
var meetkatstep3 = jQuery(‘#paywall .step.three’);
var meetkatstep4 = jQuery(‘#paywall .step.four’);
if( typeof meetkatstep1!=’undefined’ && meetkatstep1.is(‘:seen’) ){
hidePixelBool = lovely;
}
if ( typeof meetkatstep2!=’undefined’ && meetkatstep2.is(‘:seen’) ){
hidePixelBool = lovely;
}
if( typeof meetkatstep3!=’undefined’ && meetkatstep3.is(‘:seen’) ){
hidePixelBool = lovely;
}
if( typeof meetkatstep4!=’undefined’ && meetkatstep4.is(‘:seen’) ){
hidePixelBool = lovely;
}
if( hidePixelBool===groundless ){
/*for hiding meterpaywall popups when pixel adverts call ends here*/
/Alternate Popup code delivery/
var enable_alterpopup_check;
enable_alterpopup_check =”;
if( typeof(enable_alterpopup_check) != “undefined” && enable_alterpopup_check == 1 ){
var alternate_article_no;
alternate_article_no = ”;
if( pageCounterPaywall % alternate_article_no == 0 && pageCounterPaywall!=0 ){
show_lightbox(”,”);
}
}
/Alternate Popup code End/
}

pageCounterPaywall++;
ajaxCarousel(postID);
ajaxGallery(postID);
articleNLogo(postID);

/Slider Lisp /
flag = groundless;
$(‘allotment.article-physique:closing img’).every(unbiased(){
if($(this).mother or father(“a”).mother or father(“decide”).hasClass(‘bx-merchandise’)){
flag = lovely;
}else{
$(this).mother or father(“a”).addClass(“gallery”);
}
});

if(flag){
var okay = $(‘allotment.article-physique:closing’).web(‘.gallery-2’).bxSlider({
adaptiveHeight: lovely,
adaptiveHeightSpeed: 500,
infiniteLoop: groundless,
hideControlOnEnd: groundless,
pager: groundless
});
okay.reloadSlider();
}
/Slider Lisp End */

var usera = navigator.userAgent.toLowerCase();
if ( $(‘.article-page’).length ) {
var slickWidth = $(‘.article-checklist.slick-breeze’).width();

if ($(‘.ie9’).length){
slickWidth = $(‘.recirc-carousel.slick-initialized.slick-slider’).width();
}
$(‘.slick-checklist.draggable’).css({‘width’ : slickWidth});
if( !/android|webos|iphone|ipad|ipod|blackberry/i.take a look at(usera) ){
$(‘.article-checklist.slick-breeze’).youngsters(‘li’).css({‘width’ : slickWidth});
$(‘.slick-checklist’).css({‘width’ : slickWidth});
}
}

var $newArticles = $(html);
var imagesLoading = [];

$newArticles.web(‘img’).every(unbiased() {

// For every characterize, obtain a recent deferred object that resolves when the
// characterize has loaded and add that to an array of deferred objects.

var loadingImage = $.Deferred();
imagesLoading.push(loadingImage);

// “this” is the characterize ingredient here and must hold a complete property.
// Stumble on http://stackoverflow.com/a/24201249

if (this.complete){
loadingImage.obtain to the backside of();
}else{
var adTimeout = window.setTimeout(unbiased() {
loadingImage.obtain to the backside of();
}, 3000);

this.addEventListener(‘load’, unbiased() {
loadingImage.obtain to the backside of();
window.clearTimeout(adTimeout);
});

this.addEventListener(‘error’, unbiased() {
// We truly don’t care if the characterize never hundreds, but we restful need
// to acquire to the backside of the promise so that we can reset the waypoints.
loadingImage.obtain to the backside of();
window.clearTimeout(adTimeout);
});

// Neat up tournament listeners
this.removeEventListener(‘load’, unbiased() {
loadingImage.obtain to the backside of();
window.clearTimeout(adTimeout);
});
this.removeEventListener(‘error’, unbiased() {
loadingImage.obtain to the backside of();
window.clearTimeout(adTimeout);
});
}
});

$.when.apply(this, imagesLoading).then(unbiased() {
fixedAds($(‘.postid-‘ + postID).youngsters(‘article’));
}, unbiased() {
console.log(arguments);
});
}
}
});
return groundless;
}

/Load 2d article on scroll
*/

$(window).bind(‘scroll’, unbiased(){

$(‘.scrolltrace’).every(unbiased(){

var submit = $(this);
var topp = submit.situation().prime;
var bott = submit.situation().prime + submit.prime();
var pos = $(window).scrollTop();

if ( pos>=topp && pos 0){

}else{
window.history.pushState({}, “”, $(‘.currentScr’).attr(‘articlelistlinks’));

articlePostId = $(‘.currentScr’).attr(“article-submit-id”);

/*Unusual non subscriber For Infinite Scroll*/
if (null != is_user_logged_in) {
var tn_sfg_local = localStorage.getItem(“tn_sfg_local”);
if (null != tn_sfg_local && undefined != tn_sfg_local && ” != tn_sfg_local) {
tn_sfg_local = JSON.parse(tn_sfg_local);
if (tn_sfg_local.contains(parseInt(articlePostId))) {
$(‘.currentScr’).web(‘.tn-sfg-add-to-checklist’).addClass(‘chosen’);
$(‘.currentScr’).web(‘.tn-sfg-add-to-checklist’).removeClass(‘conceal’);
}else {
$(‘.currentScr’).web(‘.tn-sfg-add-to-checklist’).removeClass(‘conceal’);
}
} else {
$(‘.currentScr’).web(‘.tn-sfg-add-to-checklist’).removeClass(‘conceal’);
}
}
/*Unusual non subscriber For Infinite Scroll*/

var allSubject = $(‘.postid-‘+articlePostId+’.currentScr input[name=”tpTags”]’).val();
var allAuthor = $(‘.postid-‘+articlePostId+’.currentScr input[name=”tpContentAuthor”]’).val();

var username = getCookie(‘SESSname’);
if(username != null){
_cbq.push([‘_acct’, ‘paid’]);
}else{
_cbq.push([‘_acct’, ‘anon’]);
}

console.log(“Chartbeat”);
pSUPERFLY.virtualPage({
sections: allSubject,
authors : allAuthor,
course : window.location.pathname,
title : $(‘.currentScr’).attr(‘articlelisttitle’)
});
}

/Taxonomy and Creator Space off in GA Match Originate */
var allSubject = allSubject.atomize up(‘,’);
$.every( allSubject, unbiased( i, allsubval ) {
gaTaxonomyAuthor( allsubval, $(‘.currentScr’).attr(‘articlelisttitle’), $(‘.currentScr’).attr(‘articlelistlinks’) );
});

var allAuthor = allAuthor.atomize up(‘,’);
$.every( allAuthor, unbiased( i, allautval ) {
gaTaxonomyAuthor( allautval, $(‘.currentScr’).attr(‘articlelisttitle’), $(‘.currentScr’).attr(‘articlelistlinks’) );
});
/Taxonomy and Creator Space off in GA Match End */

/Call E mail Signup for limitless scroll
*/
if( !$(‘.postid-‘+articlePostId+’ .article-physique img’).mother or father(“a”).mother or father(“decide”).hasClass(‘bx-merchandise’) ){

if( !$(“.abody-“+articlePostId+””).hasClass(“electronic mail-signup-visited”) ){
email_signup_module( articlePostId );
}
}

/Lisp Page Look Match */
dataLayer.push({
‘tournament’: ‘gaPageViewEvent’,
‘gaEventCategory’: ‘article’,
‘gaEventAction’: $(‘.currentScr’).attr(‘articlelisttitle’),
‘gaEventLabel’: articlePostId,
});
/Lisp Page Look Match */

/Article Divider Scrolled Over Total Depend
*/
dataLayer.push({
‘tournament’: ‘gaRecirculationEvent’,
‘gaEventCategory’: ‘recirculation’,
‘gaEventAction’: ‘article-divider-scrolled-over’,
‘gaEventLabel’: $(‘.currentScr’).attr(‘articlelistlinks’),
});

/Article Divider Scrolled Over Person Depend
*/
article_number = $(‘.abody-‘+articlePostId+”).attr(“article-number”);
if (typeof article_number !== typeof undefined && article_number !== groundless) {
dataLayer.push({
‘tournament’: ‘gaRecirculationEvent’,
‘gaEventCategory’: ‘recirculation’,
‘gaEventAction’: ‘article-divider-scrolled-over-‘+article_number+”,
‘gaEventLabel’: $(‘.currentScr’).attr(‘articlelistlinks’),
});
}

// Google Analytics for Infinite Scroll
/*ga(‘ship’, ‘pageview’, {
‘page’: $(‘.currentScr’).attr(‘articlelistlinks’),
‘title’: $(‘.currentScr’).attr(‘articlelisttitle’)
});*/
console.log(“Google”);
ga(‘house’, ‘dimension1’, $(‘.currentScr’).web(‘.tn_publish_date’).text());
ga(‘ship’, ‘pageview’, {
‘page’: window.location.pathname,
‘title’: $(‘.currentScr’).attr(‘articlelisttitle’)
});

dataLayer.push({
‘tournament’:’InfiniteScrollPageView’,
‘virtualPageURL’: window.location.pathname,
‘virtualPageTitle’ : $(‘.currentScr’).attr(‘articlelisttitle’)
});

$(“nav.significant ul li.article-meta h2”).html($(‘.currentScr’).attr(‘articlelisttitle’).substring(0,100));
$(“title”).html($(‘.currentScr’).attr(‘articlelisttitle’));

var linktext = $(‘.currentScr’).web(“.anchor_subject”).html();
if ( linktext!=” ){

var linkredirectval =$(‘.currentScr’).web(“.anchor_subject”).attr(‘subjectlink’);

if(typeof linkredirectval!=’undefined’){
var subject_head_link = ““+linktext+”“;
$(‘.tophead_subject’).html(subject_head_link);
}else{
var subject_head_link = “”;
$(‘.tophead_subject’).html(subject_head_link);
}

}

pageChange = parseInt(pageChange) + 1;
}

}else{
$(this).removeClass(‘currentScr’);
}
});

$current_article = $(‘.scrolltrace.currentScr’);
// Load next leaderboard advert on reach to backside motion tout
if($current_article.hasClass(‘currentScr’)){

articlePostId = $(‘.currentScr’).attr(“article-submit-id”);

var windowTop = $(window).scrollTop();

if( $current_article.web(‘.enlarge-lower’).length != 0 ){

if( !$(‘#enlarge-lower-‘+articlePostId+”).hasClass(‘enlarge-shut’) && !$(‘#enlarge-lower-‘+articlePostId+”).hasClass(‘tn-first-enlarge’)){

if( $(‘.abody-‘+articlePostId+”).hasClass(‘withhold-reading’) ){

/Overflow Hidden Mother or father Div */
$(‘.abody-‘+articlePostId+”).mother or father().addClass(“withhold-reading-mother or father”);

/Conceal Article Footer */
$(‘#article-footer-‘+articlePostId+”).conceal();

/Conceal Rev Lisp Block */
$(‘#tabola-block-‘+articlePostId+”).conceal();

/Conceal apart wrap modules */
$(‘.scrolltrace.currentScr .apart-wrap .advert-wrap’).no longer(‘:eq(0)’).conceal();

/Gift enlarge Minimize */
$(‘#enlarge-lower-‘+articlePostId+”).stamp();
}else{

// Place when the page loaded
eval(“pushDataPianoOnInfinite_”+articlePostId+”()”);
tp.abilities.fabricate();

}
}
}
}

var loadPoint = $(‘.article-physique:closing’).offset().prime – 68;

if (loadPoint!=groundless && $(window).scrollTop() >= loadPoint){
if( $(‘.scrolltrace’).length==count ){

loagAgn = lovely;

if(loagAgn){
count++;

if(count
eval(“pushDataPianoOnInfinite_”+$article_id+”()”);
// Place when the page loaded
tp.abilities.fabricate();

$(‘.abody-‘+$article_id+”).removeClass(‘withhold-reading’);

$(‘.abody-‘+$article_id+”).removeClass(‘no-reading’);

/Overflow Visible Mother or father */
$(‘.abody-‘+$article_id+”).mother or father().removeClass(“withhold-reading-mother or father”);

/Gift Article Footer */
$(‘#article-footer-‘+$article_id+”).stamp();

/Gift Rev Lisp Block */
$(‘#tabola-block-‘+$article_id+”).stamp();

/Gift apart wrap modules */
$(‘.postid-‘+$article_id+’ .apart-wrap .advert-wrap’).no longer(‘:eq(0)’).stamp();

/Conceal enlarge Minimize */
$(‘#enlarge-lower-‘+$article_id+”).conceal();

/Connected Single Article Tune
*/
relatedSingleArticle( $article_id );

/Connected A few Article Tune
*/
relatedMultiArticle( $article_id );

/Contemporary Peril Module Tune
*/
currentIssueModule( $article_id );

/Inline CTA One Tune
*/
inlineCtaOne( $article_id );

/Inline CTA Two Tune
*/
inlineCtaTwo( $article_id );

/Inline CTA Two Tune
*/
inlineCtaSignup( $article_id );

/Creator Highlight Tune
*/
authorHighlight( $article_id );

/Series Module Tune
*/
seriesModule( $article_id );

/Notify Module Tune
*/
commentModule( $article_id );

/Books Salad Tune
*/
booksSalad( $article_id );

/Action Tout Module Tune
*/
actionToutModule( $article_id );

/Sidebar Community Module Tune
*/
sidebarCommunityModule( $article_id );
tp.push([“setCustomVariable”, “book_and_arts_article”, “true”]);
console.log(“pushed variable book_and_arts_article lovely”);

});

$(‘physique’).on(‘click’,’.click_comment’,unbiased(tournament){

tournament.preventDefault();

/Overall Data */
var article_id = $(this).attr(“article-submit-id”);
var comment_container = $(this).closest(‘.article-footer’).web(‘.commentContainer’);
var post_comment_list = comment_container.web(‘.post_comment_list’);
var _loader = comment_container.web(‘.post_comment_list_loader’);
var _count = $(this).web(‘.title’);

/Test if user logged_in */
$is_user_logged_in = groundless;
$username = getCookie(‘SESSname’);
if( $username != null ){
$is_user_logged_in = lovely;
$username = Scandalous64.decode($username);
comment_container.web(‘.logged-in-as’).web(‘.login_user’).html($username);
}

if( $is_user_logged_in ){
comment_container.web(‘perform’).stamp();
}else{
comment_container.web(‘.have to-log-in’).stamp();
}
/Test if user logged_in */

/Birth commnet allotment */
comment_container.slideToggle(‘tiring’);

/Add shut class */
$(this).web(‘.open’).toggleClass(‘shut’);

/Test for ajax call */
if( post_comment_list.html().length == 0){

/Swap Point of curiosity */
are trying{
comment_container.web(‘textarea’).focal point();
}accumulate(e){}

/post_comment_list_loader */
_loader.stamp();

$.ajax({
url :ajax_object.ajax_url,
facts:{
‘motion’ : ‘article_comment_list’,
‘article_id’ : article_id
},
form:’POST’,
success:unbiased( response ){
if( typeof response == ‘string’ ){
response = JSON.parse( response );
if( response.house == ‘success’ ){
_loader.conceal();
post_comment_list.earlier than(response.sorting);
post_comment_list.append(response.comment_list);
_count.html(‘Comments (‘+response.count+’)’);
}else if( response.house == ‘fail’ ){
_loader.conceal();
}
}
}
});
}
});

jQuery( “.action_tout_remove_gallery a” ).removeClass( “gallery imgHover” ).extend( 1000 );

$(doc).on(‘click’,’.nation_convsersation’,unbiased(tournament){

tournament.preventDefault();

/Overall Data */
var article_id = $(this).attr(“article-id”);
var _click_comment = $(‘.postid-‘+article_id+’ .click_comment’);
var comment_container = _click_comment.closest(‘.article-footer’).web(‘.commentContainer’);
var post_comment_list = comment_container.web(‘.post_comment_list’);
var _loader = comment_container.web(‘.post_comment_list_loader’);
var _count = _click_comment.web(‘.title’);

/Test if user logged_in */
$is_user_logged_in = groundless;
$username = getCookie(‘SESSname’);
if( $username != null ){
$is_user_logged_in = lovely;
$username = Scandalous64.decode($username);
comment_container.web(‘.logged-in-as’).web(‘.login_user’).html($username);
}

if( $is_user_logged_in ){
comment_container.web(‘perform’).stamp();
}else{
comment_container.web(‘.have to-log-in’).stamp();
}
/Test if user logged_in */

/Birth commnet allotment */
comment_container.slideToggle(‘tiring’);

/Add shut class */
$(‘html, physique’).animate({scrollTop: _click_comment.offset().prime},2000);
_click_comment.web(‘.open’).toggleClass(‘shut’);

/Test for ajax call */
if( post_comment_list.html().length == 0){

/Swap Point of curiosity */
are trying{
comment_container.web(‘textarea’).focal point();
}accumulate(e){}

/post_comment_list_loader */
_loader.stamp();

$.ajax({
url :ajax_object.ajax_url,
facts:{
‘motion’ : ‘article_comment_list’,
‘article_id’ : article_id
},
form:’POST’,
success:unbiased( response ){
if( typeof response == ‘string’ ){
response = JSON.parse( response );
if( response.house == ‘success’ ){
_loader.conceal();
post_comment_list.earlier than(response.sorting);
post_comment_list.append(response.comment_list);
_count.html(‘Comments (‘+response.count+’)’);
}else if( response.house == ‘fail’ ){
_loader.conceal();
}
}
}
});
}

});

$(“.social-portion-icon”).click(unbiased(){
$(“.nav-toggle, .logo”).toggleClass(“hidden”);
$(“.portion-icons”).toggleClass(“breeze-portion”);
$(“.header-bar a.social-sharing”).toggleClass(“portion-icons-shut”);
});

/Click on Match Monitoring for Connected Single Article
*/

$(doc).on(‘click’, ‘.linked-oneup-click’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaRelatedSingleArticleEvent’,
‘gaEventCategory’: ‘linked-single-article’,
‘gaEventAction’: ‘linked-single-article-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Connected Multi Article
*/

$(doc).on(‘click’, ‘.linked-multi-click’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaRelatedMultiArticleEvent’,
‘gaEventCategory’: ‘linked-multi-article’,
‘gaEventAction’: ‘linked-multi-article-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Contemporary Peril
*/

$(doc).on(‘click’, ‘.magazine_button a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaCurrentIssueModuleEvent’,
‘gaEventCategory’: ‘current-danger-module’,
‘gaEventAction’: ‘current-danger-module-click’,
‘gaEventLabel’: $(this).web(‘input’).val(),
});
});

/Click on Match Monitoring for In-line CTA 1
*/

$(doc).on(‘click’, ‘.inline-cta-1 .cta a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaInlineCtaOneEvent’,
‘gaEventCategory’: ‘inline-cta-1’,
‘gaEventAction’: ‘inline-cta-1-click’,
‘gaEventLabel’: $(this).web(‘input’).val(),
});
});

/Click on Match Monitoring for In-line CTA 2
*/

$(doc).on(‘click’, ‘.inline-cta-2 .cta a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaInlineCtaTwoEvent’,
‘gaEventCategory’: ‘inline-cta-2’,
‘gaEventAction’: ‘inline-cta-2-click’,
‘gaEventLabel’: $(this).web(‘input’).val(),
});
});
/Click on Match Monitoring for In-line CTA Signup
*/

$(doc).on(‘click’, ‘.inline-cta_form .cta a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaInlineCtaSignupEvent’,
‘gaEventCategory’: ‘inline-cta-signup’,
‘gaEventAction’: ‘inline-cta-signup-click’,
‘gaEventLabel’: $(this).web(‘input’).val(),
});
});

/Click on Match Monitoring for Footer Supreme Most modern From NAtion
*/

$(doc).on(‘click’, ‘#article-footer-closing .most trendy-from h3 a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaInfiniteScrollfooterEvent’,
‘gaEventCategory’: ‘limitless-scroll-footer-most trendy-articles’,
‘gaEventAction’: ‘limitless-scroll-footer-most trendy-articles-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Footer Supreme Editor Picks
*/

$(doc).on(‘click’, ‘#article-footer-closing .editors-picks h3 a, #article-footer-closing .editors-picks .tale a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaInfiniteScrollfooterEvent’,
‘gaEventCategory’: ‘limitless-scroll-footer-editor-picks’,
‘gaEventAction’: ‘limitless-scroll-footer-editor-picks-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Creator Highlight
*/

$(doc).on(‘click’, ‘.creator-modules .newrelated-blocks > a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaAuthorHighlight’,
‘gaEventCategory’: ‘creator-Highlight’,
‘gaEventAction’: ‘creator-Highlight-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Series Module
*/

$(doc).on(‘click’, ‘.sequence-modules .sequence-modules-blocks .sequence-blocks > a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaSeriesModule’,
‘gaEventCategory’: ‘sequence-module’,
‘gaEventAction’: ‘sequence-module-click’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});

/Click on Match Monitoring for Notify Module
*/

$(doc).on(‘click’, ‘.comment-module .comment-blocks .cta input’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaCommentsModule’,
‘gaEventCategory’: ‘comments-module’,
‘gaEventAction’: ‘comments-module-click’,
‘gaEventLabel’: $(this).val(),
});
});

/Click on Match Monitoring for Books Salad
*/

$(doc).on(‘click’, ‘.e book-module .newrelated-blocks a’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaBooksSalad’,
‘gaEventCategory’: ‘books-salad’,
‘gaEventAction’: ‘books-salad-click’,
‘gaEventLabel’: $(this).mother or father().mother or father().web(‘h5’).text(),
});

});

/Click on Match Monitoring for Action Tout Module
*/

$(doc).on(‘click’, ‘apart.takeaction .cta input’,unbiased(){
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaActionToutModule’,
‘gaEventCategory’: ‘motion-tout-module’,
‘gaEventAction’: ‘motion-tout-module-click’,
‘gaEventLabel’: doc.URL,
});
});

/Click on Match Monitoring for Retain Studying 2/3/4/5
*/

$(doc).on(‘click’, ‘.enlarge-lower a’,unbiased(){

var article_number = $(this).of us(‘.scrolltrace’).web(‘.article-physique’).attr(‘article-number’);

if (typeof article_number !== typeof undefined && article_number !== groundless) {
/Click on Match
*/
dataLayer.push({
‘tournament’: ‘gaKeepReading’,
‘gaEventCategory’: ‘withhold-reading’,
‘gaEventAction’: ‘withhold-reading-‘+article_number+’-click’,
‘gaEventLabel’: doc.URL,
});
}
});

/Article E mail Signal Up
*/

$(doc).on(‘click’,’.para_one_button_email’,unbiased(){
/Tune Click on On Signal Up Button GTM
*/
var current_email_signup = $(this).of us(“.electronic mail-signup-module”);
var current_step = current_email_signup.attr(“facts-allotment”);
var article_id = $(this).of us(“#url-title”).mother or father().attr(“article-submit-id”);
paragraphOneClickEvent(article_id, current_step);

var electronic mail = current_email_signup.web(“#para-one-electronic mail-input-“+current_step+””).val();
var sailthru_list = current_email_signup.web(“#para-one-sailthru-checklist-“+current_step+””).val();
var current_parent = $(this).mother or father();

if( electronic mail!=” && typeof electronic mail!==typeof undefined){
jQuery.ajax({
url :ajax_object.ajax_url,
form :”POST”,
facts :”sailthru_email_take_action=”+electronic mail+”&take_action_sailthru_list_final=”+sailthru_list+”&motion=action_tout_sailthru”,
success : unbiased(facts){
if( facts.indexOf(‘errormsg’) > 0 ){
current_parent.web(‘.footer_email_error’).html(facts);
}else{
/Tune Winning Signal Up GTM
*/

if( typeof article_id !== typeof undefined && typeof current_step !== typeof undefined && (typeof paragraph_module !== typeof undefined) && (paragraph_module[article_id][current_step].event_name!=””) ){
dataLayer.push({
‘tournament’: ‘gaParagraphOneEvent’,
‘gaEventCategory’: ”+ paragraph_module[article_id][current_step].event_name +”,
‘gaEventAction’: ”+ paragraph_module[article_id][current_step].event_name +’-checklist’,
‘gaEventLabel’: electronic mail,
});
}

var nextTNstep = parseInt(current_step)+1;
nextTNstep = ( nextTNstep > 5 )? 0 : nextTNstep;
var step = getParaOneNextStep(article_id, nextTNstep);

var cookieDateTNstep = contemporary Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
doc.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;course=/”;

var cookieDateTNlifetime = contemporary Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
doc.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;course=/”;

$(“.abody-“+article_id+” .electronic mail-signup-module”).conceal();
current_email_signup.next(“#para-one-thankyou-“+article_id+””).stamp();
}
}
});
}else{
current_parent.web(‘.footer_email_error’).html(‘Please Enter E mail’);
}
});

/Paragraph one various module
*/

$(doc).on(‘click’,’.para_one_button’,unbiased(){
/Tune Click on On Signal Up Button GTM
*/
var current_step = $(this).of us(“.electronic mail-signup-module”).attr(“facts-allotment”);
var article_id = $(this).of us(“#url-title”).mother or father().attr(“article-submit-id”);
var nextTNstep = parseInt(current_step)+1;

nextTNstep = ( nextTNstep > 5 )? 0 : nextTNstep;
var step = getParaOneNextStep(article_id, nextTNstep);

var cookieDateTNstep = contemporary Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
doc.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;course=/”;

var cookieDateTNlifetime = contemporary Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
doc.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;course=/”;

paragraphOneClickEvent(article_id, current_step);
});

$(doc).on(‘click’,’.inline_cta_signup’,unbiased(){

var current_email_signup = $(this).of us(“.inline-cta-perform-module”);
var article_id = $(this).of us(“#url-title”).mother or father().attr(“article-submit-id”);
$(“.inline_cta__form_error_”+article_id).html(“”);
$(“.inline_cta__form_toperror_”+article_id).html(“”);
var electronic mail = $(“#inline_cta__email_”+article_id).val();
var sailthru_list = $(“#inline_cta__sail_list_”+article_id).val();
var current_parent = $(this).mother or father();

if( electronic mail!=” && typeof electronic mail!==typeof undefined){
if(!isValidEmailAddress(electronic mail)){
$(“.inline_cta__form_error_”+article_id).html(”);
}
else{
jQuery.ajax({
url :ajax_object.ajax_url,
form :”POST”,
facts :”article_id=”+article_id+”&electronic mail=”+electronic mail+”&checklist=”+sailthru_list+”&motion=inlinecta-signup”,
success : unbiased(facts){
if( facts.indexOf(‘errormsg’) > 0 ){
$(“.inline_cta__form_error_”+article_id).html(facts);
}else{
$(“.inline_cta__signup_module_”+article_id).conceal();
if (facts.indexOf(‘verify_email’) > 0) {
$(“#inline_cta__form_thanks”+article_id).html(facts);
}
$(“#inline_cta__form_thanks”+article_id).stamp();
}
}
});
}
}else{
$(“.inline_cta__form_error_”+article_id).html(”);
}
});

});

Related Articles

Back to top button
%d bloggers like this: