TheTyee / design-article.thetyee.ca

Working in the open on The Tyee's new article page design
http://thetyee.github.io/design-article.thetyee.ca/
Creative Commons Zero v1.0 Universal
3 stars 0 forks source link

ad-blocker js broken in github repo #340

Closed alexgreen closed 2 years ago

alexgreen commented 8 years ago

The ad-blocker test in aritcle_custom.js doesn't work when run locally and on github.io:

// add .ad-blocker if ad blocker present
if(typeof canRunAds == "undefined") {
        $("body").addClass("ad-blocker");   
}

The ad-blocker class is added even when no ad-blocker is active. See: http://thetyee.github.io/design-article.thetyee.ca/library

This makes it impossible to test the placement and appearance of ads.

Can the conditional be rewritten so that it functions when run locally and from github?

phillipadsmith commented 8 years ago

I can look into that today.

phillipadsmith commented 8 years ago

Hi @alexgreen,

Can you try now.

The /ui/js/ads.js script was missing.

Phillip.

alexgreen commented 8 years ago

I pulled those commits but it's still not working. .ad-blocker gets applied to body even when there's no ad blocker active.

I'm also noticing that the comments show in an expanded state upon page load. Seems like a js issue. possibly related?

MrBryan commented 8 years ago

They need to do that so that hash links work when people get comment emails -- it loads showing then when the page completes loading, if there is no hash link, they contract

MrBryan commented 8 years ago

But if they stay showing then yes something is broken on develop

alexgreen commented 8 years ago

if there is no hash link, they contract

Comments disclosure seems to be working now.

ad-blocker js is still misfiring.

alexgreen commented 8 years ago

Is the ad-blocker js in the repo different from what's on the live site? Why would it work on the live site and not in the repo?

phillipadsmith commented 8 years ago

Is the ad-blocker js in the repo different from what's on the live site? Why would it work on the live site and not in the repo?

I believe this is resolved? @alexgreen Can you confirm?

alexgreen commented 8 years ago

no, still the same problem is evident in both develop and gh-pages. i.e. the js applies the body class regardless of whether there's an ad-blocker active or not.

alexgreen commented 7 years ago

This is still broken

alexgreen commented 7 years ago

I've commented out the ad-blocker js since it doesn't work in the repo: dda5fecbda225eacd61b600ed4984c125e4955c5

alexgreen commented 7 years ago

still broken in develop