‘;
newWin.file.write(NewDocumentWrite);
// newWin.addEventListener(‘load’,feature(){
// });
newWin.print();
newWin.shut();
}
/@feature for print article
*/
feature tn_print_fn(){
var tn_current_url=window.self-discipline.href;
if(check_comment == true){
window.start(tn_current_url+’?print=1&comment=1′,’_blank’);
}else{
window.start(tn_current_url+’?print=1′,’_blank’);
}
return faux;
}
/@feature sailthru action tout
*/
feature add_action_tout_sailthru(post_id){
var ajaxurl=ajax_object.ajax_url;
var sailthru_email_take_action = file.getElementById(‘take_action_sailthru_email_’+post_id).worth;
if(sailthru_email_take_action!=”){
var take_action_sailthru_list_final = file.getElementById(‘take_action_sailthru_list_final_’+post_id).worth;
var action_tout_sailthru=’action_tout_sailthru’;
jQuery.ajax({
url :ajaxurl,
type :”POST”,
information :”sailthru_email_take_action=”+sailthru_email_take_action+”&take_action_sailthru_list_final=”+take_action_sailthru_list_final+”&action=”+action_tout_sailthru,
success : feature(information){
file.getElementById(‘action_tout_response_’+post_id).innerHTML=information;
file.getElementById(‘take_action_sailthru_email_’+post_id).worth=”;
}
});
}else{
var error_msg=’Please Enter Email’;
file.getElementById(‘action_tout_response_’+post_id).innerHTML=error_msg;
}
}
/Take a look at for logged in user
*/
feature getParaOneNextStep( articlePostId, step ){
if( typeof articlePostId !== typeof undefined && is_user_logged_in!=null && typeof paragraph_module!=typeof undefined && paragraph_module[articlePostId][step].user_logged_in==1 ){
step = parseInt(step)+1;
step = ( step > 5 )? 0 : step;
step = getParaOneNextStep( articlePostId, step );
}
return step;
}
/@feature Email Signal Up Logic
*/
feature email_signup_module( articlePostId ){
/Take a look at For Email Signal Up Cookie
*/
if( typeof paragraph_module[articlePostId] !== typeof undefined ){
/Veil All */
$(“.abody-“+articlePostId+” .electronic mail-signup-module”).hide();
/Veil All */
var TNstep = getCookie(‘TNstep’);
if( TNstep!=null ){
var step = getParaOneNextStep(articlePostId, TNstep);
$(“.abody-“+articlePostId+” .electronic mail-signup-module.para-one-“+paragraph_module[articlePostId][step].remark+””).show();
/show match monitoring */
paragraphOneShowEvent(articlePostId, step);
/show match monitoring */
}else{
var TNlifetime = getCookie(‘TNlifetime’);
if( TNlifetime!=null ){
nextTNstep = parseInt(TNlifetime)+1;
nextTNstep = ( nextTNstep > 5 )? 0 : nextTNstep;
var step = getParaOneNextStep(articlePostId, nextTNstep);
var cookieDateTNstep = fresh Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
file.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;path=/”;
var cookieDateTNlifetime = fresh Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
file.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;path=/”;
$(“.abody-“+articlePostId+” .electronic mail-signup-module.para-one-“+paragraph_module[articlePostId][step].remark+””).show();
/show match monitoring */
paragraphOneShowEvent(articlePostId,step);
/show match monitoring */
}else{
var step = getParaOneNextStep(articlePostId, 0);
var cookieDateTNstep = fresh Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
file.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;path=/”;
var cookieDateTNlifetime = fresh Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
file.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;path=/”;
$(“.abody-“+articlePostId+” .electronic mail-signup-module.para-one-“+paragraph_module[articlePostId][step].remark+””).show();
/show match monitoring */
paragraphOneShowEvent(articlePostId, step);
/show match monitoring */
}
}
}
}
/Match Tracking Capabilities
*/
/Paragraph One Present Match Trigger */
feature paragraphOneShowEvent( articlePostId, step ){
if( typeof articlePostId !== typeof undefined && typeof step !== typeof undefined && (typeof paragraph_module[articlePostId] !== typeof undefined) && (paragraph_module[articlePostId][step].event_name!=””) ){
/Notice Views paragraph one module GTM
*/
dataLayer.push({
‘match’: ‘gaParagraphOneShowEvent’,
‘gaEventCategory’: ”+ paragraph_module[articlePostId][step].event_name +”,
‘gaEventAction’: ”+ paragraph_module[articlePostId][step].event_name +’-show’,
‘gaEventLabel’: file.URL,
});
}
}
/Paragraph One Click Match Trigger */
feature paragraphOneClickEvent( articlePostId, step ){
if( typeof articlePostId !== typeof undefined && typeof step !== typeof undefined && (typeof paragraph_module[articlePostId] !== typeof undefined) && (paragraph_module[articlePostId][step].event_name!=””) ){
dataLayer.push({
‘match’: ‘gaParagraphOneEvent’,
‘gaEventCategory’: ”+ paragraph_module[articlePostId][step].event_name +”,
‘gaEventAction’: ”+ paragraph_module[articlePostId][step].event_name +’-click on’,
‘gaEventLabel’: file.URL,
});
}
}
/Match Tracking Capabilities
*/
/Linked Single Article */
feature relatedSingleArticle( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.connected-oneup”).length > 0 ){
var rely = jQuery(“.postid-“+articlePostId+” aside.connected-oneup”).length;
for( i=0; i 0 ){
var rely = jQuery(“.postid-“+articlePostId+” aside.connected-multi”).length;
for( i=0; i 0 ){
/Notice Views Recent Disclose Module GTM
*/
dataLayer.push({
‘match’: ‘gaCurrentIssueModuleShowEvent’,
‘gaEventCategory’: ‘current-be troubled-module’,
‘gaEventAction’: ‘current-be troubled-module-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Inline CTA 1 Views */
feature inlineCtaOne( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.inline-cta-1″).length > 0 ){
/Notice Views Recent Disclose Module GTM
*/
dataLayer.push({
‘match’: ‘gaInlineCtaOneShowEvent’,
‘gaEventCategory’: ‘inline-cta-1’,
‘gaEventAction’: ‘inline-cta-1-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Inline CTA 2 Views */
feature inlineCtaTwo( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.inline-cta-2″).length > 0 ){
/Notice Views Recent Disclose Module GTM
*/
dataLayer.push({
‘match’: ‘gaInlineCtaTwoShowEvent’,
‘gaEventCategory’: ‘inline-cta-2’,
‘gaEventAction’: ‘inline-cta-2-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
feature inlineCtaSignup( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.inline-cta_form”).length > 0 ){
/Notice Views Recent Disclose Module GTM
*/
dataLayer.push({
‘match’: ‘gaInlineCtaSignupShowEvent’,
‘gaEventCategory’: ‘inline-cta-signup’,
‘gaEventAction’: ‘inline-cta-signup-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Creator Spotlight Views */
feature authorHighlight( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.creator-modules”).length > 0 ){
/Notice Views Creator Spotlight GTM
*/
dataLayer.push({
‘match’: ‘gaAuthorHighlightShowEvent’,
‘gaEventCategory’: ‘creator-Spotlight’,
‘gaEventAction’: ‘creator-Spotlight-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Series Module Views */
feature seriesModule( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.series-modules”).length > 0 ){
/Notice Views Series Module GTM
*/
dataLayer.push({
‘match’: ‘gaSeriesModuleShowEvent’,
‘gaEventCategory’: ‘series-module’,
‘gaEventAction’: ‘series-module-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Commentary Module Views */
feature commentModule( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.comment-module”).length > 0 ){
/Notice Views Commentary Module GTM
*/
dataLayer.push({
‘match’: ‘gaCommentsModuleShowEvent’,
‘gaEventCategory’: ‘feedback-module’,
‘gaEventAction’: ‘feedback-module-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Books Salad Views */
feature booksSalad( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.book-module”).length > 0 ){
/Notice Views Books Salad GTM
*/
dataLayer.push({
‘match’: ‘gaBooksSaladShowEvent’,
‘gaEventCategory’: ‘books-salad’,
‘gaEventAction’: ‘books-salad-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Motion Tout Module Views */
feature actionToutModule( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.takeaction”).length > 0 ){
/Notice Views Motion Tout Module GTM
*/
dataLayer.push({
‘match’: ‘gaActionToutModuleShowEvent’,
‘gaEventCategory’: ‘action-tout-module’,
‘gaEventAction’: ‘action-tout-module-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Sidebar Neighborhood Module Views */
feature sidebarCommunityModule( articlePostId ){
if( jQuery(“.postid-“+articlePostId+” .enlarge-lop”).length ==0 || jQuery(“.postid-“+articlePostId+” .enlarge-shut”).length !=0 ){
if( jQuery(“.postid-“+articlePostId+” aside.n-group”).length > 0 ){
/Notice Views Sidebar Neighborhood Module GTM
*/
dataLayer.push({
‘match’: ‘gaSidebarShowEvent’,
‘gaEventCategory’: ‘sidebar-group’,
‘gaEventAction’: ‘sidebar-group-show’,
‘gaEventLabel’: file.URL,
});
}
}
}
/Taxnonomy and Creator GA Match on single article page */
feature gaTaxonomyAuthor( gaEventCategory, gaEventAction, gaEventLabel ){
dataLayer.push({
“match”: “gaglobaltaxonomyauthor”,
“gaEventCategory”: gaEventCategory,
“gaEventAction”: gaEventAction,
“gaEventLabel”: gaEventLabel
});
}
jQuery( file ).ready(feature($) {
/*============== Variables ==================*/
var preventLoad_article = faux;
var flag = faux;
var $e = $(‘.article-body’).kids().final();
var $t = $e.prop(“tagName”);
var tagsArray = [‘FORM’,’ASIDE’];
var anothertagsArray = {‘UL’:’li’,’OL’:’li’,’BLOCKQUOTE’:’p’};
var url_id = window.self-discipline.hash.substr(1);
var pageChange = 1;
var articlePostId = 418557;
var rely = 1;
var article_divider = 1;
var loagAgn = faux;
var scroll_art_recric = true;
var checklist;
/*============== Variables ==================*/
/Taxnonomy and Creator GA Match on single article page */
var allSubject = $(‘.postid-‘+articlePostId+’ input[name=”tpTags”]’).val();
var allAuthor = $(‘.postid-‘+articlePostId+’ input[name=”tpContentAuthor”]’).val();
var first_article_title = $(‘.postid-‘+articlePostId).attr(‘articlelisttitle’);
var first_article_path = $(‘.postid-‘+articlePostId).attr(‘articlelistlinks’);
var allSubject = allSubject.wreck up(‘,’);
$.each and every( allSubject, feature( i, allsubval ) {
gaTaxonomyAuthor( allsubval, first_article_title, first_article_path );
});
var allAuthor = allAuthor.wreck up(‘,’);
$.each and every( allAuthor, feature( i, allautval ) {
gaTaxonomyAuthor( allautval, first_article_title, first_article_path );
});
/Body inform image in gallery
*/
$(‘fragment.article-body img’).each and every(feature() {
if($(this).mother or father(“a”).mother or father(“resolve”).hasClass(‘bx-merchandise’)){
flag = true;
}else{
var href_val = $(this).mother or father(“a”).attr(‘href’);
var img_src = $(this).attr(‘src’);
if( href_val === img_src && !$(this).dad and mom().hasClass(“electronic mail-signup-module”) ){
$(this).mother or father(“a”).addClass(“gallery”);
}else{
if( !$(this).mother or father(“a”).hasClass(“no-target-blank”) ){
$(this).mother or father(“a”).attr(‘target’,’_blank’);
}
}
}
});
/Walk image slider
*/
if(flag){
runSlider(jQuery(‘.gallery-2′));
}
/Email Signal Up
*/
if(!flag){
email_signup_module( 418557 );
}
/Article N impress
*/
articleNLogo( 418557 );
/Linked Single Article Notice
*/
relatedSingleArticle( 418557 );
/Linked A few Article Notice
*/
relatedMultiArticle( 418557 );
/Recent Disclose Module Notice
*/
currentIssueModule( 418557 );
/Inline CTA One Notice
*/
inlineCtaOne( 418557 );
/Inline CTA Two Notice
*/
inlineCtaTwo( 418557 );
/Inline CTA Signup Notice
*/
inlineCtaSignup( 418557 );
/Creator Spotlight Notice
*/
authorHighlight( 418557 );
/Series Module Notice
*/
seriesModule( 418557 );
/Commentary Module Notice
*/
commentModule( 418557 );
/Books Salad Notice
*/
booksSalad( 418557 );
/Motion Tout Module Notice
*/
actionToutModule( 418557 );
/Sidebar Neighborhood Module Notice
*/
sidebarCommunityModule( 418557 );
/@feature for print article
*/
/Take a look at for video
*/
/Red dot after article inform
*/
if(jQuery.inArray($t, tagsArray )!=’-1′){
}else{
if($t in anothertagsArray){
$(‘.article-body > p:final-of-type’).toggleClass(‘modified’);
$e.procure(anothertagsArray[$t]+’:final’).addClass(‘redotclass’);
}
}
/this wrapped in jQuery will give us the present .letter-q div
*/
$(‘resolve’).each and every(feature(){
if( $(this).hasClass(‘alignright’)||$(this).hasClass(‘alignleft’) || $(this).hasClass(‘aligncenter’) ){
$(this).after(‘
‘);
}
});
/Scroll IF # identity 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, body’).animate({
scrollTop: $(‘#’+id_var).offset().prime
},2000);
return faux;
}
}
/Take a look at for audio
*/
/script to deal with Motivate Button Match
*/
if(window.attachEvent){
window.attachEvent(‘onpopstate’, datHash);
}
feature datHash(match){
var str = $(‘#goback’).val();
if(str==”){
window.historical previous.stride(-Math.abs(pageChange));
}else{
window.historical previous.stride(-Math.abs(pageChange));
}
return faux;
}
//
$(‘.put up-edit-hyperlink’).attr(‘href’, feature( _, action){
return action.replace(‘https’, ‘http’);
});
/@feature for load article in countless scroll
*/
$(‘a.inifiniteLoader’).hide();
feature loadArticle(pageNumber){
$(‘a.inifiniteLoader’).show(‘like a flash’);
$.ajax({
url : “https://www.thenation.com/wp-admin/admin-ajax.php”,
type : ‘POST’,
cache : faux,
dataType : ‘json’,
information : {action:’infinite_scroll’,page_no: pageNumber,loop_file: ‘articleload’,slug:’tradition,training,weapons-and-gun-modify,political-figures,politics,public-faculties,society,formative years’,curr_post_id:’418557′},
success : feature(receivedHTML){
if ( typeof receivedHTML == ‘object’ && receivedHTML!=null ){
if(typeof receivedHTML.html!==’undefined’ && receivedHTML.html!=”){
html = receivedHTML.html;
}
}else{
$(‘a.inifiniteLoader’).hide();
$(“#single_article_footer”).show();
}
$(‘a.inifiniteLoader’).hide(‘1000’);
if ( typeof receivedHTML == ‘object’ && receivedHTML!=null ){
$(“#wrap”).append(html); // This will most in all probability be the div the save our inform would possibly per chance be loaded
var postID = $($.parseHTML(html)).filter(“.scrolltrace”).attr(‘article-put up-identity’);
var postLink = $($.parseHTML(html)).filter(“.scrolltrace”).attr(‘articlelistlinks’);
var postTitle = $($.parseHTML(html)).filter(“.scrolltrace”).attr(‘articlelisttitle’);
$(‘.abody-‘+postID+’ .article-body-inside of’).kids(‘p:first-of-type’).html(feature (i, html) {
if ( $(‘.abody-‘+postID).kids(‘img’).length == “0” ){
var text = $(‘.abody-‘+postID+’ .article-body-inside of’).kids(‘p:first-of-type’).html();
$(‘.abody-‘+postID+’ .article-body-inside of’).kids(‘p:first-of-type’).html(text.replace(/^()?([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 ads call begins here*/
var hidePixelBool = faux;
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(‘:visible’) ){
hidePixelBool = true;
}
if ( typeof meetkatstep2!=’undefined’ && meetkatstep2.is(‘:visible’) ){
hidePixelBool = true;
}
if( typeof meetkatstep3!=’undefined’ && meetkatstep3.is(‘:visible’) ){
hidePixelBool = true;
}
if( typeof meetkatstep4!=’undefined’ && meetkatstep4.is(‘:visible’) ){
hidePixelBool = true;
}
if( hidePixelBool===faux ){
/*for hiding meterpaywall popups when pixel ads call ends here*/
/Alternate Popup code start/
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 Discontinue/
}
pageCounterPaywall++;
ajaxCarousel(postID);
ajaxGallery(postID);
articleNLogo(postID);
/Slider Screech material /
flag = faux;
$(‘fragment.article-body:final img’).each and every(feature(){
if($(this).mother or father(“a”).mother or father(“resolve”).hasClass(‘bx-merchandise’)){
flag = true;
}else{
$(this).mother or father(“a”).addClass(“gallery”);
}
});
if(flag){
var okay = $(‘fragment.article-body:final’).procure(‘.gallery-2’).bxSlider({
adaptiveHeight: true,
adaptiveHeightSpeed: 500,
infiniteLoop: faux,
hideControlOnEnd: faux,
pager: faux
});
okay.reloadSlider();
}
/Slider Screech material Discontinue */
var usera = navigator.userAgent.toLowerCase();
if ( $(‘.article-page’).length ) {
var slickWidth = $(‘.article-checklist.slick-fade’).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.test(usera) ){
$(‘.article-checklist.slick-fade’).kids(‘li’).css({‘width’ : slickWidth});
$(‘.slick-checklist’).css({‘width’ : slickWidth});
}
}
var $newArticles = $(html);
var imagesLoading = [];
$newArticles.procure(‘img’).each and every(feature() {
// For every and every image, create a fresh deferred object that resolves when the
// image has loaded and add that to an array of deferred objects.
var loadingImage = $.Deferred();
imagesLoading.push(loadingImage);
// “this” is the image component here and will hold a whole property.
// Seek for http://stackoverflow.com/a/24201249
if (this.full){
loadingImage.accumulate to the bottom of();
}else{
var adTimeout = window.setTimeout(feature() {
loadingImage.accumulate to the bottom of();
}, 3000);
this.addEventListener(‘load’, feature() {
loadingImage.accumulate to the bottom of();
window.clearTimeout(adTimeout);
});
this.addEventListener(‘error’, feature() {
// We if truth be told develop now no longer care if the image never hundreds, but we restful need
// to construct up to the bottom of the promise so as that we are in a position to reset the waypoints.
loadingImage.accumulate to the bottom of();
window.clearTimeout(adTimeout);
});
// Racy up match listeners
this.removeEventListener(‘load’, feature() {
loadingImage.accumulate to the bottom of();
window.clearTimeout(adTimeout);
});
this.removeEventListener(‘error’, feature() {
loadingImage.accumulate to the bottom of();
window.clearTimeout(adTimeout);
});
}
});
$.when.observe(this, imagesLoading).then(feature() {
fixedAds($(‘.postid-‘ + postID).kids(‘article’));
}, feature() {
});
/Inifnite Scroll Half This */
var newSharePostID = window.__sharethis__.config[‘inline-share-buttons’];
newSharePostID.identity=”inline-part-button-“+postID;
newSharePostID.url= postLink;
newSharePostID.title= postTitle;
var shareLoadPromise = fresh Promise(feature(resolutionFunc,rejectionFunc){resolutionFunc()});
shareLoadPromise.then(feature(){
window.__sharethis__.load(‘inline-part-buttons’, newSharePostID);
})
.then(feature(){
$(“#inline-part-button-“+postID+” > .st-final “).removeClass(“st-final”);
$(“#inline-part-button-“+postID).append(”);
});
if (getCookie(‘SESSuserinfo’) != faux) {
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.entails(parseInt(postID))) {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).addClass(‘selected’);
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}else {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}
} else {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}
}
}
}
});
return faux;
}
/Load 2nd article on scroll
*/
$(window).bind(‘scroll’, feature(){
$(‘.scrolltrace’).each and every(feature(){
var put up = $(this);
var topp = put up.save().prime;
var bott = put up.save().prime + put up.height();
var pos = $(window).scrollTop();
if ( pos>=topp && pos 0){
}else{
window.historical previous.pushState({}, “”, $(‘.currentScr’).attr(‘articlelistlinks’));
articlePostId = $(‘.currentScr’).attr(“article-put up-identity”);
/*Original non subscriber For Limitless 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.entails(parseInt(articlePostId))) {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).addClass(‘selected’);
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}else {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}
} else {
$(‘.currentScr’).procure(‘.tn-sfg-add-to-checklist’).removeClass(‘hide’);
}
}
/*Original non subscriber For Limitless 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’]);
}
pSUPERFLY.virtualPage({
sections: allSubject,
authors : allAuthor,
path : window.self-discipline.pathname,
title : $(‘.currentScr’).attr(‘articlelisttitle’)
});
}
/Taxonomy and Creator Trigger in GA Match Open */
var allSubject = allSubject.wreck up(‘,’);
$.each and every( allSubject, feature( i, allsubval ) {
gaTaxonomyAuthor( allsubval, $(‘.currentScr’).attr(‘articlelisttitle’), $(‘.currentScr’).attr(‘articlelistlinks’) );
});
var allAuthor = allAuthor.wreck up(‘,’);
$.each and every( allAuthor, feature( i, allautval ) {
gaTaxonomyAuthor( allautval, $(‘.currentScr’).attr(‘articlelisttitle’), $(‘.currentScr’).attr(‘articlelistlinks’) );
});
/Taxonomy and Creator Trigger in GA Match Discontinue */
/Call Email Signup for countless scroll
*/
if( !$(‘.postid-‘+articlePostId+’ .article-body img’).mother or father(“a”).mother or father(“resolve”).hasClass(‘bx-merchandise’) ){
if( !$(“.abody-“+articlePostId+””).hasClass(“electronic mail-signup-visited”) ){
email_signup_module( articlePostId );
}
}
/Screech material Net page Witness Match */
dataLayer.push({
‘match’: ‘gaPageViewEvent’,
‘gaEventCategory’: ‘article’,
‘gaEventAction’: $(‘.currentScr’).attr(‘articlelisttitle’),
‘gaEventLabel’: articlePostId,
});
/Screech material Net page Witness Match */
/Article Divider Scrolled Over Complete Depend
*/
dataLayer.push({
‘match’: ‘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 !== faux) {
dataLayer.push({
‘match’: ‘gaRecirculationEvent’,
‘gaEventCategory’: ‘recirculation’,
‘gaEventAction’: ‘article-divider-scrolled-over-‘+article_number+”,
‘gaEventLabel’: $(‘.currentScr’).attr(‘articlelistlinks’),
});
}
// Google Analytics for Limitless Scroll
/*ga(‘send’, ‘pageview’, {
‘page’: $(‘.currentScr’).attr(‘articlelistlinks’),
‘title’: $(‘.currentScr’).attr(‘articlelisttitle’)
});*/
ga(‘set up’, ‘dimension1’, $(‘.currentScr’).procure(‘.tn_publish_date’).text());
ga(‘send’, ‘pageview’, {
‘page’: window.self-discipline.pathname,
‘title’: $(‘.currentScr’).attr(‘articlelisttitle’)
});
dataLayer.push({
‘match’:’InfiniteScrollPageView’,
‘virtualPageURL’: window.self-discipline.pathname,
‘virtualPageTitle’ : $(‘.currentScr’).attr(‘articlelisttitle’)
});
$(“nav.main ul li.article-meta h2”).html($(‘.currentScr’).attr(‘articlelisttitle’).substring(0,100));
$(“title”).html($(‘.currentScr’).attr(‘articlelisttitle’));
var linktext = $(‘.currentScr’).procure(“.anchor_subject”).html();
if ( linktext!=” ){
var linkredirectval =$(‘.currentScr’).procure(“.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 subsequent leaderboard advert on attain to bottom action tout
if($current_article.hasClass(‘currentScr’)){
articlePostId = $(‘.currentScr’).attr(“article-put up-identity”);
var windowTop = $(window).scrollTop();
if( $current_article.procure(‘.enlarge-lop’).length != 0 ){
if( !$(‘#enlarge-lop-‘+articlePostId+”).hasClass(‘enlarge-shut’) && !$(‘#enlarge-lop-‘+articlePostId+”).hasClass(‘tn-first-enlarge’)){
if( $(‘.abody-‘+articlePostId+”).hasClass(‘assist-finding out’) ){
/Overflow Hidden Parent Div */
$(‘.abody-‘+articlePostId+”).mother or father().addClass(“assist-finding out-mother or father”);
/Veil Article Footer */
$(‘#article-footer-‘+articlePostId+”).hide();
/Veil Rev Screech material Block */
$(‘#tabola-block-‘+articlePostId+”).hide();
/Veil aside wrap modules */
$(‘.scrolltrace.currentScr .aside-wrap .advert-wrap’).now no longer(‘:eq(0)’).hide();
/Present enlarge Minimize */
$(‘#enlarge-lop-‘+articlePostId+”).show();
}else{
// Attain when the page loaded
eval(“pushDataPianoOnInfinite_”+articlePostId+”()”);
tp.trip.attain();
}
}
}
}
var loadPoint = $(‘.article-body:final’).offset().prime – 68;
if (loadPoint!=faux && $(window).scrollTop() >= loadPoint){
if( $(‘.scrolltrace’).length==rely ){
loagAgn = true;
if(loagAgn){
rely++;
if(rely
eval(“pushDataPianoOnInfinite_”+$article_id+”()”);
// Attain when the page loaded
tp.trip.attain();
/Linked Single Article Notice
*/
relatedSingleArticle( $article_id );
/Linked A few Article Notice
*/
relatedMultiArticle( $article_id );
/Recent Disclose Module Notice
*/
currentIssueModule( $article_id );
/Inline CTA One Notice
*/
inlineCtaOne( $article_id );
/Inline CTA Two Notice
*/
inlineCtaTwo( $article_id );
/Inline CTA Two Notice
*/
inlineCtaSignup( $article_id );
/Creator Spotlight Notice
*/
authorHighlight( $article_id );
/Series Module Notice
*/
seriesModule( $article_id );
/Commentary Module Notice
*/
commentModule( $article_id );
/Books Salad Notice
*/
booksSalad( $article_id );
/Motion Tout Module Notice
*/
actionToutModule( $article_id );
/Sidebar Neighborhood Module Notice
*/
sidebarCommunityModule( $article_id );
}, 2000);
tp.push([“setCustomVariable”, “book_and_arts_article”, “true”]);
$(‘.abody-‘+$article_id+”).removeClass(‘assist-finding out’);
$(‘.abody-‘+$article_id+”).removeClass(‘no-finding out’);
/Overflow Considered Parent */
$(‘.abody-‘+$article_id+”).mother or father().removeClass(“assist-finding out-mother or father”);
/Present Article Footer */
$(‘#article-footer-‘+$article_id+”).show();
/Present Rev Screech material Block */
$(‘#tabola-block-‘+$article_id+”).show();
/Present aside wrap modules */
$(‘.postid-‘+$article_id+’ .aside-wrap .advert-wrap’).now no longer(‘:eq(0)’).show();
/Veil enlarge Minimize */
$(‘#enlarge-lop-‘+$article_id+”).hide();
if (sharethis_infinite.entails($article_id) === faux && 0 a’,feature(){
/Click Match
*/
dataLayer.push({
‘match’: ‘gaAuthorHighlight’,
‘gaEventCategory’: ‘creator-Spotlight’,
‘gaEventAction’: ‘creator-Spotlight-click on’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});
/Click Match Tracking for Series Module
*/
$(file).on(‘click on’, ‘.series-modules .series-modules-blocks .series-blocks > a’,feature(){
/Click Match
*/
dataLayer.push({
‘match’: ‘gaSeriesModule’,
‘gaEventCategory’: ‘series-module’,
‘gaEventAction’: ‘series-module-click on’,
‘gaEventLabel’: $(this).attr(‘href’),
});
});
/Click Match Tracking for Commentary Module
*/
$(file).on(‘click on’, ‘.comment-module .comment-blocks .cta input’,feature(){
/Click Match
*/
dataLayer.push({
‘match’: ‘gaCommentsModule’,
‘gaEventCategory’: ‘feedback-module’,
‘gaEventAction’: ‘feedback-module-click on’,
‘gaEventLabel’: $(this).val(),
});
});
/Click Match Tracking for Books Salad
*/
$(file).on(‘click on’, ‘.book-module .newrelated-blocks a’,feature(){
/Click Match
*/
dataLayer.push({
‘match’: ‘gaBooksSalad’,
‘gaEventCategory’: ‘books-salad’,
‘gaEventAction’: ‘books-salad-click on’,
‘gaEventLabel’: $(this).mother or father().mother or father().procure(‘h5’).text(),
});
});
/Click Match Tracking for Motion Tout Module
*/
$(file).on(‘click on’, ‘aside.takeaction .cta input’,feature(){
/Click Match
*/
dataLayer.push({
‘match’: ‘gaActionToutModule’,
‘gaEventCategory’: ‘action-tout-module’,
‘gaEventAction’: ‘action-tout-module-click on’,
‘gaEventLabel’: file.URL,
});
});
/Click Match Tracking for Withhold Finding out 2/3/4/5
*/
$(file).on(‘click on’, ‘.enlarge-lop a’,feature(){
var article_number = $(this).dad and mom(‘.scrolltrace’).procure(‘.article-body’).attr(‘article-number’);
if (typeof article_number !== typeof undefined && article_number !== faux) {
/Click Match
*/
dataLayer.push({
‘match’: ‘gaKeepReading’,
‘gaEventCategory’: ‘assist-finding out’,
‘gaEventAction’: ‘assist-finding out-‘+article_number+’-click on’,
‘gaEventLabel’: file.URL,
});
}
});
/Article Email Signal Up
*/
$(file).on(‘click on’,’.para_one_button_email’,feature(){
/Notice Click On Signal Up Button GTM
*/
var current_email_signup = $(this).dad and mom(“.electronic mail-signup-module”);
var current_step = current_email_signup.attr(“information-fragment”);
var article_id = $(this).dad and mom(“#url-title”).mother or father().attr(“article-put up-identity”);
paragraphOneClickEvent(article_id, current_step);
var electronic mail = current_email_signup.procure(“#para-one-electronic mail-input-“+current_step+””).val();
var sailthru_list = current_email_signup.procure(“#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,
type :”POST”,
information :”sailthru_email_take_action=”+electronic mail+”&take_action_sailthru_list_final=”+sailthru_list+”&action=action_tout_sailthru”,
success : feature(information){
if( information.indexOf(‘errormsg’) > 0 ){
current_parent.procure(‘.footer_email_error’).html(information);
}else{
/Notice A hit 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({
‘match’: ‘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 = fresh Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
file.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;path=/”;
var cookieDateTNlifetime = fresh Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
file.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;path=/”;
$(“.abody-“+article_id+” .electronic mail-signup-module”).hide();
current_email_signup.subsequent(“#para-one-thankyou-“+article_id+””).show();
}
}
});
}else{
current_parent.procure(‘.footer_email_error’).html(‘Please Enter Email’);
}
});
/Paragraph one diversified module
*/
$(file).on(‘click on’,’.para_one_button’,feature(){
/Notice Click On Signal Up Button GTM
*/
var current_step = $(this).dad and mom(“.electronic mail-signup-module”).attr(“information-fragment”);
var article_id = $(this).dad and mom(“#url-title”).mother or father().attr(“article-put up-identity”);
var nextTNstep = parseInt(current_step)+1;
nextTNstep = ( nextTNstep > 5 )? 0 : nextTNstep;
var step = getParaOneNextStep(article_id, nextTNstep);
var cookieDateTNstep = fresh Date();
cookieDateTNstep.setTime(cookieDateTNstep.getTime() + (30*24*60*60*1000));
file.cookie = “TNstep=”+step+”;expires=”+cookieDateTNstep.toUTCString()+”;path=/”;
var cookieDateTNlifetime = fresh Date();
cookieDateTNlifetime.setTime(cookieDateTNlifetime.getTime() + (10*365*24*60*60*1000));
file.cookie = “TNlifetime=”+step+”;expires=”+cookieDateTNlifetime.toUTCString()+”;path=/”;
paragraphOneClickEvent(article_id, current_step);
});
$(file).on(‘click on’,’.inline_cta_signup’,feature(){
var current_email_signup = $(this).dad and mom(“.inline-cta-create-module”);
var article_id = $(this).dad and mom(“#url-title”).mother or father().attr(“article-put up-identity”);
$(“.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,
type :”POST”,
information :”article_id=”+article_id+”&electronic mail=”+electronic mail+”&checklist=”+sailthru_list+”&action=inlinecta-signup”,
success : feature(information){
if( information.indexOf(‘errormsg’) > 0 ){
$(“.inline_cta__form_error_”+article_id).html(information);
}else{
$(“.inline_cta__signup_module_”+article_id).hide();
if (information.indexOf(‘verify_email’) > 0) {
$(“#inline_cta__form_thanks”+article_id).html(information);
}
$(“#inline_cta__form_thanks”+article_id).show();
}
}
});
}
}else{
$(“.inline_cta__form_error_”+article_id).html(”);
}
});
});
feature isJSON(string){
are attempting {
JSON.parse(string);
} take (e) {
return faux;
}
return true;
}
Practice The Nation
Accumulate Email Updates
Join our free day by day newsletter, alongside with occasional affords for applications that give a take to our journalism. By signing up to safe emails, you compromise to safe occasional promotional affords for applications that give a take to The Nation’s journalism. That that possibilities are you’ll well perchance unsubscribe or modify your preferences at any time. That that possibilities are you’ll well be taught our Privacy Protection here.
Copyright (c) 2022 The Nation Company LLC