function editAvatar(A){new TWP.Overlay($("",{width:"600px",height:"300px",src:jQuery(A.target).parent().attr("href")}),null);}(function(C){wp_e2=window.wp_e2||{};wp_e2.extensions=C.extend({},wp_e2.extensions);wp_e2.config=C.extend({},wp_e2.config);wp_e2_defaults={allow_comments:true,allow_links:true,allow_photos:false,allow_videos:false,commentMaxLength:2000,defaulttab:"top",display_ugc_photos:false,display_more:true,includebadges:true,includepause:true,includepermalink:false,includereply:true,includereport:true,includerecommend:true,includeshare:true,includesorts:true,includetabs:true,isallcomments:false,max_items_to_display:0,maxItemsTop:3,maxItems:15,photoCommentMaxLength:500,source:"washpost.com",topicCommentMaxLength:140,filesMax:1};wp_e2_core={apiBaseURL:"http://echoapi.wpdigital.net",echoSubmissionProxyURL:"http://apps.echoenabled.com/v2/esp/activity",appkey:"dev.washpost.com",backplaneSettings:{serverBaseURL:"http://api.echoenabled.com/v1",busName:"washpost.com"},bookmarkletUrl:"https://testapp12b:7001/bookmarklet/edit-comment.html",counterTarget:".echo-counter",debug:false,default_items:15,default_plugins:{streamPluginArray:[{"name":"TWP_Stream","thisContainer":""}],submitboxPluginArray:[{"name":"FormAuth","nestedPlugins":[{"name":"SubmitAuth"}]},{"name":"SubmitForm"}],replyPluginArray:[{"name":"Reply","actionString":"Add your thoughts...","nestedPlugins":[{"name":"FormAuth","nestedPlugins":[{"name":"ReplyAuth"}]},{"name":"ReplyForm","thisContainer":""}]}],ugcstreamPluginArray:[{"name":"TWP_UGC_Gallery"}],ugcsubmitboxPluginArray:[{"name":"FormAuth","nestedPlugins":[{"name":"SubmitAuth"}]},{"name":"SubmitForm"},{"name":"FileUpload","thumbnailRes":[90,60],"previewRes":[300,200],"webRes":[610,407],"showDefaultInputs":false,"fileSizeMax":5120,"fileSizeMin":0,"filesMax":1,"storageServer":"http://twp_echo_ugc.s3.amazonaws.com/comment_photos/","authorName":""}]},environment:{"dev":{logOutURL:TWP.signin.logouturl_page+"?destination=",logInURL:TWP.signin.logincommentsurl_page+"?destination=",profileURL:TWP.signin.registrationcommentsurl_page+"?destination=",registerURL:TWP.signin.registrationcommentsurl_page+"?destination=",proxyURL:"http://bunsen.wapolabs.com/identity/1.5.2/js/wapo_jskit_login_redirect.js",twp_echojsUrl:"/rw/sites/twpweb/js/echo2/v2/core/twp_comments_echo2.js",metaUrl:"http://iddevreg.digitalink.com/identity/public/visitor/submit_metadata.json",bookmarkletUrl:"https://testapp12b:7001/bookmarklet/edit-comment.html",mongoUserActionUrl:"http://data.washingtonpost.com/features/comment_user_action/",argusBaseUrl:"https://argus-stg.washingtonpost.com/api/",commentProfileUrl:"/mycomments",appkey:"dev.washpost.com"},"qa":{logOutURL:TWP.signin.logouturl_page+"?destination=",logInURL:TWP.signin.logincommentsurl_page+"?destination=",profileURL:TWP.signin.registrationcommentsurl_page+"?destination=",registerURL:TWP.signin.registrationcommentsurl_page+"?destination=",proxyURL:"http://bunsen.wapolabs.com/identity/1.5.2/js/wapo_jskit_login_redirect.js",twp_echojsUrl:"/rw/sites/twpweb/js/echo2/v2/core/twp_comments_echo2.js",metaUrl:"https://idstg.digitalink.com/identity/public/visitor/submit_metadata.json",bookmarkletUrl:"https://testapp12b:7001/bookmarklet/edit-comment.html",mongoUserActionUrl:"http://data.washingtonpost.com/features/comment_user_action/",argusBaseUrl:"https://argus-stg.washingtonpost.com/api/",commentProfileUrl:"/mycomments",appkey:"dev.washpost.com"},"stage":{logOutURL:TWP.signin.logouturl_page+"?destination=",logInURL:TWP.signin.logincommentsurl_page+"?destination=",profileURL:TWP.signin.registrationcommentsurl_page+"?destination=",registerURL:TWP.signin.registrationcommentsurl_page+"?destination=",proxyURL:"http://bunsen.wapolabs.com/identity/1.5.2/js/wapo_jskit_login_redirect.js",twp_echojsUrl:"/rw/sites/twpweb/js/echo2/v2/core/twp_comments_echo2.js",metaUrl:"http://id.washingtonpost.com/identity/public/visitor/submit_metadata.json",bookmarkletUrl:"https://testapp12b:7001/bookmarklet/edit-comment.html",mongoUserActionUrl:"http://data.washingtonpost.com/features/comment_user_action/",argusBaseUrl:"https://argus.washingtonpost.com/api/",commentProfileUrl:"/mycomments",appkey:"prod.washpost.com"},"prod":{logOutURL:TWP.signin.logouturl_page+"?destination=",logInURL:TWP.signin.logincommentsurl_page+"?destination=",profileURL:TWP.signin.registrationcommentsurl_page+"?destination=",registerURL:TWP.signin.registrationcommentsurl_page+"?destination=",proxyURL:"http://bunsen.wapolabs.com/identity/1.5.2/js/wapo_jskit_login_redirect.js",twp_echojsUrl:"/rw/sites/twpweb/js/echo2/v2/core/twp_comments_echo2.js",metaUrl:"http://id.washingtonpost.com/identity/public/visitor/submit_metadata.json",bookmarkletUrl:"https://liveadmin.washingtonpost.com/bookmarklet/edit-comment.html",mongoUserActionUrl:"http://data.washingtonpost.com/features/comment_user_action/",argusBaseUrl:"https://argus.washingtonpost.com/api/",commentProfileUrl:"/mycomments",appkey:"prod.washpost.com"}},guid:window.location.href,identityjsUrl:"",liveUpdatesTimeout:{counter:{"default":20,"closed":0,"no_webtype":60},stream:{"default":20,"closed":0,"no_webtype":0}},logOutURL:"",logInURL:"",markerDisplay:{"top_commenter":"Post Forum Member","top_local":"Washingtologist","top_sports":"SuperFan","staff":"Post Writer","fact_checker":"Fact Checker","post_recommended":"Post Recommended","world_watcher":"World Watcher","culture_connoisseur":"Culture Connoisseur"},metaUrl:"",moderationrequired:false,pageURL:window.location.href,profileURL:"",proxyURL:"",registerURL:"",sectionid:"",source:"washpost.com",streamPluginArray:[],streamSettings:{defaults:{appkey:"dev.washpost.com",target:"#comment-stream",apiBaseURL:"",children:{additionalItemsPerPage:300,moreButtonSlideTimeout:400,itemsSlideTimeout:400,maxDepth:2},childrenItemsPerPage:10,childrenSortOrder:"chronological",plugins:[],truncateReplies:{after:0,clickable:true},streamStateLabel:{icon:true,text:true},viaLabel:{icon:true,text:true},reTag:false,streamStateToggleBy:"button",maxBodyCharacters:2000,aggressiveSanitization:false,openLinksInNewWindow:false,sortorder:"reverseChronological",reply:false,request:"childrenof",allowedItemStates:["Untouched","CommunityFlagged","ModeratorApproved"],allowedUserStates:["ModeratorApproved"],safeHTML:"aggressive",childrenMaxDepth:1}},streamTabs:{all:{active:false,userMarkers:[""],xxchildrenMaxDepth:1,xxchildrenItemsPerPage:3,childrenSortOrder:"chronological",maxBodyCharacters:2000,title:"All Comments",defaultsort:"reverseChronological",displaysort:true},top:{active:false,userMarkers:[],itemMarkers:[],userMarkersxx:["top_commenter","top_local","top_sports","staff"],itemMarkersxx:["post_recommended"],title:"Top Comments",childrenMaxDepth:1,childrenItemsPerPage:1,childrenSortOrder:"chronological",tabUrl:"",maxBodyCharacters:500,request:"childrenof",defaultsort:"reverseChronological",displaysort:true}},streamClient:null,streamId:"",streamTarget:"#echo_comment_stream",submitboxPluginArray:[],submitTarget:"#comment-box",tabs:"",twp_echojsUrl:"",uploadPhotoPluginArray:[]};wp_e2.createDataObject=function(H,E){var G={};if(typeof H.attr("data")!=="undefined"&&H.attr("data").length>0){var D=H.attr("data").split("&");for(var F=0;F0){wp_e2[G].max_items_to_display=data.maxitems;if((wp_e2[G].webType).toLowerCase().indexOf("blogstory")<0&&(wp_e2[G].webType).toLowerCase().indexOf("discussion_story")<0){wp_e2[G].streamTabs.top=C.extend(true,{},wp_e2[G].streamTabs.top,{tabUrl:data.articleurlfacet+"?ctab=top_comments"});wp_e2[G].streamTabs.all=C.extend(true,{},wp_e2[G].streamTabs.all,{tabUrl:data.articleurlfacet+"?ctab=all_comments"});}}if((wp_e2[G].webType).toLowerCase().indexOf("discussion_story")>=0){if(typeof wp_e2[G].streamTabs.top!="undefined"){wp_e2[G].streamTabs.top.title="Top Posts";}if(typeof wp_e2[G].streamTabs.all!="undefined"){wp_e2[G].streamTabs.all.title="All Posts";}}if((wp_e2[G].webType).toLowerCase().indexOf("topic_story")>=0){wp_e2[G].commentMaxLength=(typeof wp_e2.config.topicCommentMaxLength!="undefined")?wp_e2.config.topicCommentMaxLength:wp_e2_defaults.topicCommentMaxLength;}else{wp_e2[G].commentMaxLength=wp_e2_defaults.commentMaxLength;}if(wp_e2[G].webType=="ugc_photo_story"){wp_e2[G].commentMaxLength=wp_e2_defaults.photoCommentMaxLength;wp_e2.default_plugins.streamPluginArray=wp_e2.default_plugins.ugcstreamPluginArray;wp_e2.default_plugins.submitboxPluginArray=wp_e2.default_plugins.ugcsubmitboxPluginArray;}wp_e2[G]=C.extend(wp_e2[G],wp_e2.config);});};C(".echo_container").not(".processed").buildecho(wp_e2.config.options);C.extend(wp_e2,wp_e2_core,wp_e2_defaults,wp_e2.config,wp_e2.extensions);wp_e2.initDataObject();wp_e2.plugins=C.extend({},wp_e2.default_plugins,wp_e2.plugins);wp_e2.streamSettings.defaults.apiBaseURL=wp_e2.apiBaseURL;var A=((typeof TWP==="undefined")||(typeof TWP.Data==="undefined")||(typeof TWP.Data.environment)==="undefined")?"dev":TWP.Data.environment;var B=(typeof eidosBase!=="undefined"&&eidosBase!=="")?eidosBase:"";C.each(wp_e2.environment[A],function(D,E){wp_e2[D]=E;});if(window.location.href.indexOf("echodebug=true",0)>0){wp_e2.debug=true;}if(typeof TWP_Debug=="undefined"||TWP_Debug==""){TWP_Debug={};}if(!TWP_Debug.initialTime){TWP_Debug.initialTime=new Date();}wp_e2.debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2_identity.js - Starting Identity Load");})(jQuery);var wapoIdentity;function wapoIdentityInit(){function A(){var B=null;var C=null;}A.prototype.reconcileUsernames=function(){if(typeof (this.wapo_username)!=="undefined"&&this.wapo_username!==null&&typeof (this.echo_username)!=="undefined"&&this.echo_username!==null){if(this.wapo_username===this.echo_username){if(this.wapo_username){this.loginCallback();this.echoLoginCallback();}else{this.logoutCallback();this.echoLogoutCallback();}}else{if(this.wapo_username===""){this.logoutCallback();Backplane.resetCookieChannel();this.echoLogoutCallback();}else{if(this.wapo_username!==""&&this.echo_username!==""){this.callLogoutPortableContact();Backplane.resetCookieChannel();this.loginCallback();this.echoLoginCallback();}else{if(this.wapo_username!==""&&this.echo_username===""){this.loginCallback();this.echoLoginCallback();}}}}}};A.prototype.init=function(){var B,C;if(!$wpjQ.browser.msie){document.domain=wapoEnv.site_base_domain;}this.updateWapoUsername();this.updateEchoUsername();$wpjQ(document).bind(wapoEnv.event_name_logout,function(){wapoIdentity.wapo_username=null;wapoIdentity.echo_username=null;wapoIdentity.updateWapoUsername();wapoIdentity.updateEchoUsername();});$wpjQ(document).bind(wapoEnv.event_name_login,function(){wapoIdentity.wapo_username=null;wapoIdentity.echo_username=null;wapoIdentity.updateWapoUsername();wapoIdentity.updateEchoUsername();});$wpjQ(document).bind(wapoEnv.event_name_new_registration,function(){wapoIdentity.wapo_username=null;wapoIdentity.echo_username=null;wapoIdentity.updateWapoUsername();wapoIdentity.updateEchoUsername();});};A.prototype.updateWapoUsername=function(){var D=this.getIsMemberOfCommentingGroup();if(D===true){var B=wapoUtilities.Get_Cookie(wapoEnv.cookie_login_id);if(typeof (B)!=="undefined"&&B!==null){var E=wapoUtilities.Get_Cookie(wapoEnv.cookie_display);if(typeof (E)!="undefined"&&E!==null){var C=E.split("|");if(C.length>0){wapoIdentity.wapo_username=C[0];if(wapoIdentity.wapo_username.substr(0,1)==='"'){wapoIdentity.wapo_username=wapoIdentity.wapo_username.substring(1);}}}}}else{wapoIdentity.wapo_username="";wapoIdentity.reconcileUsernames();}};A.prototype.updateEchoUsername=function(){this.echo_user=new Echo.User({"appkey":wapoEnv.jskit_consumer_key});this.echo_user.init(function(){wapoIdentity.echo_user.accounts=wapoIdentity.echo_user.getActiveAccounts();wapoIdentity.setEchoUsername();});};A.prototype.setEchoUsername=function(){if(typeof (this.echo_user)!=="undefined"&&typeof (this.echo_user.accounts)!=="undefined"&&this.echo_user.accounts.length>0){this.echo_username=this.echo_user.accounts[0].username;this.reconcileUsernames();}else{this.echo_username="";this.reconcileUsernames();}};A.prototype.loginCallback=function(){if(typeof (this.echo_user)==="undefined"||typeof (this.echo_user.accounts)==="undefined"||this.echo_user.accounts.length===0||this.echo_username!==this.wapo_username){this.callLoginPortableContact();
}else{Echo.Broadcast.unsubscribe("Submit.onPostInit");this.postComment();}var C=$wpjQ("#wapo_change_avatar");if(C!==null){var B=Backplane.getChannelName();C.html('Edit Avatar');}};A.prototype.callLoginPortableContact=function(){var B=Backplane.getChannelName();var C={type:"GET",url:"http:"+wapoEnv.wapo_site_url+"public/visitor/login_portable_contact.json?jskit_channel="+B,dataType:"jsonp",cache:false,jsonp:wapoEnv.param_name_jsonp_callback,success:function(D){if(D!==null&&typeof D["response"]!=="undefined"&&D["response"]!==null){if(D["response"].indexOf("invalid")!==-1){wapoIdentity.echoLogoutCallback();}else{if(D["response"].indexOf("result=success")!==-1){wapoIdentity.echoLoginCallback();Echo.Broadcast.unsubscribe("Submit.onPostInit");wapoIdentity.postComment();}}}},error:function(){}};$wpjQ.ajax(C);Backplane.expectMessagesWithin(10);};A.prototype.logoutCallback=function(){this.callLogoutPortableContact();Echo.Broadcast.subscribe("Submit.onPostInit",function(F,C,E,D){wapoIdentity.storeComment(F,C,E,D);});var B=$wpjQ("#wapoChangeAvatarLink");if(B!==null){B.remove();}};A.prototype.callLogoutPortableContact=function(){var F=null;if(typeof (this.echo_user)!=="undefined"&&typeof (this.echo_user.accounts)!=="undefined"&&this.echo_user.accounts.length>0){for(var D=0;D0){g=O.max_items_to_display;}}}var X=" (("+N+M+") "+(U!=""?" AND "+U:"")+") ";var R="";if((typeof O.source!="undefined"&&O.source.indexOf("Twitter")>=0)){R="("+V.streamSettings[P].request+": "+b+" ("+e+")"+" "+U+" source:Twitter"+") ";}var J="";if((typeof O.source!="undefined"&&O.source.indexOf("washpost.com")>=0)){J="("+V.streamSettings[P].request+": "+b+" source:"+O.source.toString()+X+" )";}var a="";if(typeof O.streamid!="undefined"&&O.streamid!=""){a="("+V.streamSettings[P].request+":"+wp_e2.STREAM_BASE+"/"+O.streamid+((typeof V.streamSettings[P].allowedItemMarkers!=="undefined"&&V.streamSettings[P].allowedItemMarkers.toString()!="")?" markers: "+V.streamSettings[P].allowedItemMarkers.toString():"")+" ("+e+")"+")";}var Q=(J!="")?J:"";if(typeof wp_e2[T]!="undefined"&&wp_e2[T].displayuserstream){Q="scope: "+b+" user.id:'"+wp_e2.echo_user.account.id+"'"+" itemsPerPage: "+g+" sortOrder: "+V.streamSettings[P].sortorder+" safeHTML: permissive"+" childrenSortOrder:"+V.streamSettings[P].childrenSortOrder+" childrenItemsPerPage:"+f+" children: "+childrenLevelsToShow+" "+" ("+S+M+") ";}else{if(c!=""){Q="childrenof: "+c+" itemsPerPage: "+g+" sortOrder: "+V.streamSettings[P].sortorder+" safeHTML:"+V.streamSettings[P].safeHTML+" children: "+childrenLevelsToShow+" childrenSortOrder:"+V.streamSettings[P].childrenSortOrder+" childrenItemsPerPage:"+f+" "+" (("+S+M+") "+((P==="top")?"":(U!=""?" AND "+U:""))+") ";}else{if(d!=""){Q="url: "+d+" itemsPerPage: "+g+" sortOrder: "+V.streamSettings[P].sortorder+" safeHTML:"+V.streamSettings[P].safeHTML+" children: "+childrenLevelsToShow+" childrenSortOrder:"+V.streamSettings[P].childrenSortOrder+" childrenItemsPerPage:"+f+" "+" (("+S+M+") "+((P==="top")?"":(U!=""?" AND "+U:""))+") ";}else{Q=Q+((a!=""&&Q!=="")?" OR "+a:a);Q=Q+((R!=""&&Q!=="")?" OR "+R:R);Q="("+Q+")"+" itemsPerPage: "+g+" sortOrder: "+V.streamSettings[P].sortorder+" safeHTML:"+V.streamSettings[P].safeHTML+" childrenSortOrder:"+V.streamSettings[P].childrenSortOrder+" childrenItemsPerPage:"+f+" children: "+childrenLevelsToShow+" "+" (("+S+M+") "+((P==="top")?"":(U!=""?" AND "+U:""))+") ";}}}debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - query - "+T+" - "+P+": "+Q);return Q;};wp_e2.isTopCommenter=function(K,J){currUserMarkers=wp_e2.echo_user.get("markers");if(wp_e2[K].streamTabs.top){for(i=0;i0||C(L).hasClass("echo-counter")){thisId="echo-counter";wp_e2[thisContainer][thisId]={};wp_e2[thisContainer][thisId].streamSettings=C.extend(true,{},wp_e2.streamSettings);wp_e2.initStreamTabs(thisContainer,thisId);}});};wp_e2.renderCommentCount=function(J){if(wp_e2.isUserSynced()){C(wp_e2.COUNTER_TARGET).each(function(){var O="";var N=C(this).closest(".echo_container").attr("id");if(typeof C(this).attr("guid")!=="undefined"){O=C(this).attr("guid");}if(typeof O=="undefined"||O==""){O=(typeof N!=="undefined")?wp_e2[N].guid:wp_e2.guid;}var L=C(this).closest("a").attr("rel");var P=(typeof L!=="undefined"&&L!="")?L:"all";var M=wp_e2.getTimeoutValue("counter","default",N);wp_e2.streamSettings[P]=C.extend(true,{},wp_e2.streamSettings.defaults);wp_e2.streamSettings[P].target=this;wp_e2.streamSettings[P].query=wp_e2.getQuery(P,O,N,wp_e2.COUNTER_CLASS);wp_e2.streamSettings[P].liveUpdatesTimeout=M;wp_e2.streamSettings[P].liveUpdates=(M=="0")?false:true;var K=C(this).data("stream");if(typeof K=="undefined"||K==null){C(this).data("stream",new Echo.Counter(wp_e2.streamSettings[P]));}else{K.config.set("targetURL",O);K.config.set("query",wp_e2.streamSettings[P].query);K.refresh();}debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - started counter and attached to .echo-counter for stream: ["+N+"]["+P+"].streamSettings["+P+"]");});}};wp_e2.initCommentStream=function(K){var J=(typeof K!="undefined")?C(wp_e2.STREAM_TARGET,K):C(".echo_container "+wp_e2.STREAM_TARGET);J.each(function(){var M=C(this).attr("id");var Q=C(this).closest(".echo_container").attr("id");var P=wp_e2[Q].guid;if(typeof C(this).attr("guid")!=="undefined"){P=C(this).attr("guid");}var O=wp_e2[Q].itemurl;wp_e2[Q][M]={};wp_e2[Q][M].streamSettings=C.extend(true,{},wp_e2.streamSettings);wp_e2.initTabs(Q,M);C.each(wp_e2.streamPluginArray,function(R,S){C.extend(S,{"thisContainer":Q});});wp_e2[Q][M].streamSettings["defaults"].plugins=wp_e2[Q][M].streamSettings["defaults"].plugins.concat(wp_e2.streamPluginArray);if(wp_e2[Q].includerecommend===true){wp_e2[Q][M].streamSettings["defaults"].plugins=wp_e2[Q][M].streamSettings["defaults"].plugins.concat({"name":"TWP_Like","thisContainer":Q});}if(wp_e2[Q].allow_comments===true&&wp_e2[Q].includereply===true){if(typeof wp_e2.plugins.replyPluginArray[0]!="undefined"){C.each(wp_e2.plugins.replyPluginArray[0].nestedPlugins,function(R,S){C.extend(S,{"thisContainer":Q});});}wp_e2[Q][M].streamSettings["defaults"].plugins=wp_e2[Q][M].streamSettings["defaults"].plugins.concat(wp_e2.plugins.replyPluginArray);}if(wp_e2[Q].includeshare===true){wp_e2[Q][M].streamSettings["defaults"].plugins=wp_e2[Q][M].streamSettings["defaults"].plugins.concat({"name":"TWP_Share","thisContainer":Q});
}if(wp_e2[Q].includereport===true){wp_e2[Q][M].streamSettings["defaults"].plugins=wp_e2[Q][M].streamSettings["defaults"].plugins.concat({"name":"TWP_CommunityFlag","thisContainer":Q});Echo.Localization.extend({"Plugins.CommunityFlag.flaggedThis":" reported this.","Plugins.CommunityFlag.flagControl":"Report","Plugins.CommunityFlag.unflagControl":"Reported","Plugins.CommunityFlag.flagProcessing":"Reporting...","Plugins.CommunityFlag.unflagProcessing":"Unreporting..."});}wp_e2.initStreamTabs(Q,M);var N=wp_e2.getTimeoutValue("stream",wp_e2[Q].webType,Q);var L=(typeof O!="undefined"&&O!="")?O:P;debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - init Comment Stream - "+Q+" - "+P+"-"+M+"-"+O);C.each(wp_e2[Q].streamTabs,function(R,S){tab=R.toLowerCase();wp_e2[Q][M].streamSettings[tab].target="#"+M;wp_e2[Q][M].streamSettings[tab].targetURL=L;wp_e2[Q][M].streamSettings[tab].query=wp_e2.getQuery(tab,P,Q,M,O);wp_e2[Q][M].streamSettings[tab].liveUpdatesTimeout=N;wp_e2[Q][M].streamSettings[tab].liveUpdates=(N=="0")?false:true;wp_e2[Q][M].streamSettings[tab].streamStateLabel.icon=(N=="0")?false:true;wp_e2[Q][M].streamSettings[tab].streamStateLabel.text=(N=="0")?false:true;});});};wp_e2.renderCommentStream=function(K,J,L){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - check for stream render: "+K);if(wp_e2.isUserSynced()){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - stream render: "+K+" userloginstate: "+A+" echo_user: "+wp_e2.echo_user.logged());var J=C("#"+L).closest(".echo_container").attr("id");var M=wp_e2[J][L].streamSettings;M[K].reply=wp_e2[J].allow_comments;M[K].query=wp_e2.getQuery(K,M[K].targetURL,J,L,wp_e2[J].itemurl);if(wp_e2[J].webType==wp_e2.WEBTYPE_PHOTO){M[K].liveUpdates=false;}if(typeof C("#"+L).data("stream")=="undefined"||C("#"+L).data("stream")==null){C("#"+L).data("stream",new Echo.Stream(M[K]));}else{thisClient=C("#"+L).data("stream");thisClient.config.set("maxBodyCharacters",M[K].maxBodyCharacters);thisClient.config.set("query",M[K].query);setTimeout(function(){thisClient.refresh();},0);}debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - comment stream rendered for stream: "+K);}};wp_e2.refreshComments=function(J){C.each(J.containers,function(N,P){var M=C(P.container).closest(".echo_container").attr("id");var L=C(wp_e2.STREAM_TARGET,C("#"+M)).attr("id");var K=C(".comment-stream-tabs li.active a",C("#"+M)).attr("rel");var O=(typeof K=="undefined"||K=="")?wp_e2[M].defaulttab:K;C.each(wp_e2[M].streamTabs,function(Q,R){wp_e2[M][L].streamSettings[Q].targetURL=P.guid;});wp_e2.renderCommentStream(O,M,L);wp_e2.refreshSubmitBox(P.guid,C("#"+M));wp_e2.renderCommentCount(P.guid);});};wp_e2.initSubmitBox=function(K){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - ---Submit Box Initialized");var J=(typeof K!="undefined")?C(wp_e2.SUBMIT_BOX_TARGET,K):C(".echo_container "+wp_e2.SUBMIT_BOX_TARGET);J.each(function(){var L=C(this);var N="#"+C(this).attr("id");var O=C(this).closest(".echo_container").attr("id");var T=C("#"+O);var Q=wp_e2[O].guid;if(typeof C(this).attr("guid")!=="undefined"){Q=C(this).attr("guid");}var M=wp_e2[O].itemurl;if(wp_e2[O].allow_comments===false){C(".comment-box-header .weigh-in",T).html('Comments are closed.');}wp_e2.setSubmitMarkers(O);if(wp_e2[O].allow_comments){C.each(wp_e2.submitboxPluginArray,function(U,V){C.extend(V,{"thisContainer":O,"authorName":wp_e2.echo_user.get("name"),"photoCommentMaxLength":wp_e2[O].photoCommentMaxLength});C.each(V,function(W,X){(typeof X[0]=="object")?C.extend(X[0],{"thisContainer":O}):"";});});var S=(typeof M!="undefined"&&M!="")?M:Q;var P=(typeof wp_e2[O].webType!=="undefined"&&wp_e2[O].webType!==wp_e2.WEBTYPE_PHOTO)?"compact":"standard";var R="Type your comment here";L.data("submitbox",new Echo.Submit({"target":N,"appkey":wp_e2.appkey,"targetURL":S,"apiBaseURL":wp_e2.apiBaseURL,"plugins":C.extend(true,{},wp_e2.submitboxPluginArray),"mode":P,"actionString":R}));}});};wp_e2.renderSubmitBox=function(J){if(wp_e2.isUserSynced()&&I===true){C(wp_e2.SUBMIT_BOX_TARGET).each(function(){var N=C(this);var K="#"+C(this).attr("id");var L=C(this).closest(".echo_container").attr("id");var M=C("#"+L);if(C("div"+wp_e2.SUBMIT_BOX_TARGET,M).hasClass("hidden")){C("div"+wp_e2.SUBMIT_BOX_TARGET,M).removeClass("hidden");}debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - unhiding comment box for userLoginState: "+J+" isRendered: "+I);});}};wp_e2.refreshSubmitBox=function(K,M){var L=C("div"+wp_e2.SUBMIT_BOX_TARGET,M);if(typeof L.data("submitbox")!="undefined"&&L.data("submitbox")!=null){var J=L.data("submitbox");J.config.set("targetURL",K);setTimeout(function(){J.refresh();},0);}};wp_e2.initStreamTabs=function(K,J){C.each(wp_e2[K].streamTabs,function(L,M){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - "+L+": "+M.title+": "+M.active+" "+((M.userMarkers)?M.userMarkers.toString():"")+" "+((M.itemMarkers)?M.itemMarkers.toString():""));tab=L.toLowerCase();wp_e2[K][J].streamSettings[tab]=C.extend(true,{},wp_e2[K][J].streamSettings.defaults,M);if((typeof M.userMarkers!="undefined")&&M.userMarkers.toString()!==""){wp_e2[K][J].streamSettings[tab].allowedUserMarkers=M.userMarkers;}if((typeof M.userStates!="undefined")&&M.userStates.toString()!==""){wp_e2[K][J].streamSettings[tab].allowedUserStates=M.userStates;}if((typeof M.itemMarkers!="undefined")&&M.itemMarkers.toString()!==""){wp_e2[K][J].streamSettings[tab].allowedItemMarkers=M.itemMarkers;}if((typeof M.itemStates!="undefined")&&M.itemStates.toString()!==""){wp_e2[K][J].streamSettings[tab].allowedItemStates=M.itemStates;}if((typeof M.children!="undefined")&&M.children!==""){wp_e2[K][J].streamSettings[tab].children=M.children;}if((typeof M.maxItems!="undefined")&&M.maxItems!==""){wp_e2[K][J].streamSettings[tab].maxItems=M.maxItems;}if((typeof M.request!="undefined")&&M.request!==""){wp_e2[K][J].streamSettings[tab].request=M.request;}});};wp_e2.initTabs=function(M,J){var N=C("#"+M);if(wp_e2[M].includetabs&&C("li.tab",N).length==0){C.each(wp_e2[M].streamTabs,function(R,T){var S=C('');if(T.active===true){S.addClass("active");}S.append(''+T.title+"");C(".comment-stream-tabs",N).prepend(S);});C("#echo-comments-overview").clone().appendTo(C(".comment-stream-tabs li.echo-comments-tip span.thistip",N));var Q=C("#echo-comments-overview",N);var O=C(".badge-list",Q);var L="";if(O.length>0&&typeof wp_e2[M].streamTabs.top!="undefined"){C.each(wp_e2[M].streamTabs.top.userMarkers,function(R,S){if(S!="staff"){L+=(typeof wp_e2[M].markerDisplay[S]!=="undefined")?wp_e2[M].markerDisplay[S]+", ":"";}});O.html(L.substring(0,L.lastIndexOf(", ")));}try{(C("#"+M+" .tooltip.echo-comments-tip").length>0)?C("#"+M+" .tooltip.echo-comments-tip").tooltip():"";}catch(P){}var K=TWP.Util.Url.getParameters(window.location.href)["ctab"];K=(typeof K=="undefined")?"":(K.substring(0,K.indexOf("_"))=="")?"top":K.substring(0,K.indexOf("_"));if(K!=""){C(".comment-stream-tabs li",C("#"+M)).removeClass("active");C('.comment-stream-tabs li a[rel|="'+K+'"]',C("#"+M)).parents("li").addClass("active");}C(".comment-stream-tabs li.tab a").click(function(T){debug&&window.console&&console.log&&console.log("url in tab?"+(C(this).attr("href").indexOf("http")>=0)+" "+T);C(this).parents("ul").find("li").removeClass("active");C(this).parents("li").addClass("active");var S=C(this).attr("rel").toLowerCase();
var R=C(this).closest(".echo_container").attr("id");var U=C(this).closest(".comment-header").attr("rel");thisSort=C(".comment-sortorder",C("#"+R));if(wp_e2[R][U].streamSettings[S].displaysort=="false"){thisSort.hide();}else{C('.comment-sortorder-select option[value="'+wp_e2[R][U].streamSettings[S].sortorder+'"]',C("#"+R)).attr("selected","selected");thisSort.show();}debug&&window.console&&console.log&&console.log("url in tab?"+C(this).attr("href"));if(typeof T.which!=="undefined"&&C(this).attr("href")&&C(this).attr("href").indexOf("http")>=0){window.location.href=C(this).attr("href");}else{T.stopPropagation();T.preventDefault();}wp_e2.renderCommentStream(S,R,U);T.stopImmediatePropagation();T.stopPropagation();return false;});}if(wp_e2[M].includesorts){C("#comment-stream-sortorder li a",N).click(function(R){C(this).parents("ul").find("li").removeClass("active");C(this).parents("li").addClass("active");var S=C(this).closest(".comment-header").attr("rel");C("#"+S).attr("sortorder",C(this).attr("rel"));if(C(".comment-stream-tabs li.active a",N).length>0){C(".comment-stream-tabs li.active a",N).click();}else{wp_e2[M][S].streamSettings[wp_e2[M].defaulttab].sortorder=C("#"+S).attr("sortorder");wp_e2.renderCommentStream(wp_e2[M].defaulttab,M,S);}R.stopImmediatePropagation();R.stopPropagation();return false;});}};wp_e2.setAvatarEvent=function(){C("a.comment-overlay").unbind();C("a.comment-overlay").click(function(J){J.preventDefault();if(typeof editAvatar!=="undefined"){editAvatar(J);}});};wp_e2.isWashingtonpostDomainName=function(){var K=false;var J=TWP.Util.Url.getHostName().substring(TWP.Util.Url.getHostName().indexOf(".")+1);for(i=0;i=0){K=true;}}return K;};wp_e2.init=function(){if(typeof (Echo)!=="undefined"){if(typeof wapoEnv!=="undefined"&&!wp_e2.isWashingtonpostDomainName()){wapoEnv.site_base_domain=TWP.Util.Url.getHostName().substring(TWP.Util.Url.getHostName().indexOf(".")+1);wapoEnv.site_url="//"+TWP.Util.Url.getHostName();}if(typeof wapoIdentityInit==="function"){wapoIdentityInit();}}wp_e2.initOmnitureVariables();wp_e2.backplaneSettings.targetURL=wp_e2.guid;wp_e2.streamSettings.defaults.appkey=wp_e2.appkey;Echo.Broadcast.subscribe("Stream.onMoreButtonPress",function(L,N,J){var K=C(N.target).closest(".echo_container").attr("id");if(typeof sendDataToOmniture==="function"){try{sendDataToOmniture("echo.onmore","event5",H);debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - MORE: omniture event5");}catch(M){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - MORE: omniture event5"+M);}}});Echo.Broadcast.subscribe("Stream.onRender",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Stream.onRender");});Echo.Broadcast.subscribe("Stream.onRerender",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Stream.onRerender");});Echo.Broadcast.subscribe("Stream.Item.onRender",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Stream.Item.onRender");try{C(".tooltip",C(L.item.target)).tooltip();}catch(M){}});Echo.Broadcast.subscribe("Stream.onReady",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Stream.onReady");});Echo.Broadcast.subscribe("Photo.onUploadError",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - photo upload error");C(".echo-submit-header",L.target).hide().html(''+L+' 
').fadeIn(3000,function(){C(".notice-close",L.target).click(function(){C(".echo-submit-header").fadeOut(1000,function(){C(".echo-submit-header p").remove();});});});C('input[name="Filedata"]',L.target).click(function(){C(".echo-submit-header").fadeOut(1000,function(){C(".echo-submit-header p").remove();});});});Echo.Broadcast.subscribe("Submit.onPostInit",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Post Init");});Echo.Broadcast.subscribe("Submit.onPostComplete",function(P,N,Q){var O=C(N.target).closest(".echo_container").attr("id");var M=C("#"+O+" .echo_stream").attr("id");var U=C("#"+O);if(typeof sendDataToOmniture==="function"){try{D.eVar26=(wp_e2[O].display_ugc_photos===true)?"submit - ugc":"submit - comments";sendDataToOmniture("echo.onpostcomplete","event3",D);debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Post COmplete: omniture event3");D.eVar26="";}catch(L){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Post COmplete: omniture event3 - "+L);}}wp_e2.resetCharacterLimit(N.target,O);try{var K="";var T=(wp_e2[O].webType==wp_e2.WEBTYPE_DISCUSSION_STORY)?"View your Post":"View Your Comment";var J=C("#ugc-photo-gallery");if(J.length>0){K='';}else{if(C("div.comments_allComments",U).length==0&&((typeof wp_e2[O].webType!=="undefined")&&wp_e2[O].webType.toLowerCase()!=wp_e2.WEBTYPE_BLOG)){K='';}else{K="';}}if((C(".comment-stream-tabs .tab.active a",U).attr("rel")==="top"&&!wp_e2.isTopCommenter(O,M))){var S=C(".echo-submit-header",U);S.hide().html(K).fadeIn(3000,function(){C(".notice-close",U).click(function(){C(".echo-submit-header .echo-view-all-comments",U).fadeOut(1000,function(){C(this).remove();});});S.find(".echo-view-all-comments").fadeOut(3000,function(){C(this).remove();S.show();});});}}catch(R){}});Echo.Broadcast.subscribe("Counter.onUpdate",function(K,L,J){C(L.target).html(L.data.count);});Echo.Broadcast.subscribe("Submit.onRender",function(L,M,J){var K=C(M.target).closest(".echo_container").attr("id");if((M.data&&M.data.unique)||typeof K=="undefined"){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Submit.onRender (Reply) triggered wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged()+" userLoginState: "+A);}else{debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Submit.onRender triggered wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged()+" userLoginState: "+A);C("input.echo-submit-markers",M.target).val(wp_e2[K].submitMarkers);C("#share-comments",M.target).children().remove();if(C("div.module.share.comments.inline.hidden").length>0){C("div.module.share.comments.inline.hidden").clone(true).removeClass("hidden").appendTo(C("#share-comments",M.target));(C.isFunction(C.fn.share))?C("div.module.share.comments.inline").share():"";}I=true;wp_e2.renderSubmitBox(A);
wp_e2.setAvatarEvent();}});Echo.Broadcast.subscribe("Submit.onRerender",function(L,M,J){var K=C(M.target).closest(".echo_container").attr("id");if(M.data&&M.data.unique){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Submit.onRerender (Reply) triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());}else{debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Submit.onRerender triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());C("input.echo-submit-markers",M.target).val(wp_e2[K].submitMarkers);(C.isFunction(C.fn.share))?C("div.module.share.comments.inline").share():"";I=true;wp_e2.renderSubmitBox(A);wp_e2.setAvatarEvent();}});Echo.Broadcast.subscribe("Submit.onExpand",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - onExpand triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());});Echo.Broadcast.subscribe("User.onInvalidate",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - User.onInvalidate triggered. wp_e2.echo_user.logged is: "+wp_e2.echo_user.logged());});Echo.Broadcast.subscribe("User.onInit",function(K,L,J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - onInit triggered");wp_e2.echo_user=new Echo.User({"appkey":wp_e2.appkey,"apiBaseURL":wp_e2.apiBaseURL});wp_e2.echo_user.init(function(){var M=wp_e2.echo_user.getActiveAccounts();});B=true;Echo.Broadcast.publish("User.TWPInitComplete");wp_e2.initContainers();});if(typeof Echo=="object"){Echo.LoginStateChange=function(J){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Echo.LoginStateChange triggered for login state: "+J);A=J;wp_e2.renderSubmitBox(J);wp_e2.renderCommentCount();C(".echo_container .echo_stream_container").each(function(M,N){var L=C(N).closest(".echo_container").attr("id");if(C(".comment-stream-tabs li.active a",N).length>0){C(".comment-stream-tabs li.active a",N).click();}else{var K=C(wp_e2.STREAM_TARGET,N).attr("id");wp_e2.renderCommentStream(wp_e2[L].defaulttab,L,K);}});C(".comment-stream").trigger("wp_e2Init.Complete");};}else{debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - no echo present");}debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - init complete");F=true;};wp_e2.initContainers=function(L){var K=(typeof L!="undefined")?C(L):C(".echo_container");K.each(function(M,O){var N=C(O).attr("class").replace(/\s+/g," ").split(" ");C.each(N,function(P,Q){if(typeof wp_e2.plugins[Q+"PluginArray"]!="undefined"){wp_e2[Q+"PluginArray"]=wp_e2[Q+"PluginArray"]||[];wp_e2[Q+"PluginArray"]=wp_e2[Q+"PluginArray"].concat(wp_e2.plugins[Q+"PluginArray"]);if(wp_e2.extensions[Q+"PluginArray"]){wp_e2[Q+"PluginArray"]=wp_e2[Q+"PluginArray"].concat(wp_e2.extensions[Q+"PluginArray"]);}}});});wp_e2.initSubmitBox(L);wp_e2.initCommentStream(L);wp_e2.initCommentCount(L);wp_e2.renderCommentCount(L);var J=(typeof L!="undefined")?C(".echo_stream_container",L):C(".echo_stream_container");J.each(function(N,O){var M=C(O).closest(".echo_container").attr("id");if(C(".comment-stream-tabs li.active a",O).length>0){C(".comment-stream-tabs li.active a",O).click();}else{thisId=C(wp_e2.STREAM_TARGET,O).attr("id");wp_e2.renderCommentStream(wp_e2[M].defaulttab,M,thisId);}C(O).trigger("wp_e2Init.Complete");});K.removeClass("unprocessed").addClass("processed");};wp_e2.setSubmitMarkers=function(K){var J=(wp_e2[K].sectionid!==""&&typeof wp_e2[K].sectionid!="undefined")?wp_e2[K].sectionid:"";J+=(wp_e2[K].moderationrequired===true)?", "+wp_e2.MODERATION_REQUIRED:"";J+=(wp_e2[K].display_ugc_photos===true)?", "+wp_e2.PHOTO:"";wp_e2[K].submitMarkers=J;};wp_e2.getTimeoutValue=function(M,J,K){if(typeof K!=="undefined"&&wp_e2[K].allow_comments==false){J="closed";}else{if(typeof J=="undefined"||J==""){J="no_webtype";}}var L=(typeof wp_e2.liveUpdatesTimeout[M][J]!=="undefined")?wp_e2.liveUpdatesTimeout[M][J]:wp_e2.liveUpdatesTimeout[M]["default"];return L;};wp_e2.initOmnitureVariables=function(){var J={};try{J={"eVar1":s.eVar1,"eVar2":s.eVar2,"eVar8":s.eVar8,"eVar17":s.eVar17,"eVar33":s.eVar33};}catch(K){}C.extend(D,J);H={"eVar26":"view more - comments"};C.extend(H,J);};wp_e2.isUserSynced=function(){var J=false;if(typeof A!=="undefined"&&A!==null&&typeof wp_e2.echo_user!=="undefined"&&((A==="login"&&wp_e2.echo_user.logged())||(A==="logout"&&!wp_e2.echo_user.logged()))){J=true;}return J;};wp_e2.initToolTips=function(){C(".echo-sign-in").each(function(){C(this).attr("href",wp_e2.logInURL+wp_e2.pageURL);});};wp_e2.toString=function(K,J){for(myKey in K){console.log("config"+((typeof J==="undefined"||J===-1)?"":"["+J+"]")+"["+myKey+"] = "+K[myKey]);if(typeof K[myKey]==="object"){wp_e2.toString(K[myKey],myKey);}}};C(document).ready(function(){debug&&window.console&&console.log&&console.log("["+(new Date()-TWP_Debug.initialTime)/1000+"]"+"echo2/v2/core/twp_comments_echo2.js - Document Ready");wp_e2.init();wp_e2.initToolTips();});})(jQuery);