1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/views/layouts/_rsidebar.html.erb
2016-01-08 19:20:32 +00:00

65 lines
3.0 KiB
Plaintext

<% if Rails.env.production? %>
<div class="adRnav">
<script type="text/javascript">
if(WURFL.is_mobile){
//Mobile and tablet ad
(function (){
if(window.CHITIKA===undefined) {window.CHITIKA = {'units' :[]};};
var unit = {"calltype":"async[2]","publisher":"cwimer","width":468,"height":60,"sid":"Chitika Default"};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
}());
} else {
//Desktop ad
(function (){
if(window.CHITIKA===undefined) {window.CHITIKA = {'units' :[]};};
var unit = {"calltype":"async[2]","publisher":"cwimer","width":120,"height":600,"sid":"Chitika Default"};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
}());
}
</script>
<script type="text/javascript" src="//cdn.chitika.net/getads.js" async></script>
</div>
<% end %>
<div class="afs_ads">&nbsp;</div>
<div class="well" id="blocked_message" style="display: none;">
<p>We've detected that you have an ad blocker enabled! Please consider disabling it for <strong>wrestlingdev.com</strong>. This site is free for users and supported by ads. Ad blockers also block performance monitoring that help us with user experience.</p>
</div>
<script>
(function() {
var message = "We've detected that you have an ad blocker enabled! Please consider disabling it for wrestlingdev.com. This site is free for users and supported by ads. Ad blockers also block performance monitoring that help us with user experience.";
// Define a function for showing the message.
// Set a timeout of 2 seconds to give adblocker
// a chance to do its thing
var tryMessage = function() {
setTimeout(function() {
if(!document.getElementsByClassName) return;
var ads = document.getElementsByClassName('afs_ads'),
ad = ads[ads.length - 1];
if(!ad
|| ad.innerHTML.length == 0
|| ad.clientHeight === 0) {
//alert(message);
document.getElementById("blocked_message").style.display = 'block';
//window.location.href = '[URL of the donate page. Remove the two slashes at the start of thsi line to enable.]';
} else {
ad.style.display = 'none';
}
}, 2000);
}
/* Attach a listener for page load ... then show the message */
if(window.addEventListener) {
window.addEventListener('load', tryMessage, false);
} else {
window.attachEvent('onload', tryMessage); //IE
}
})();
</script>