mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Ad blocker checker?
This commit is contained in:
35
app/views/layouts/_rsidebar.html.erb
Normal file
35
app/views/layouts/_rsidebar.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="afs_ads"> </div>
|
||||
<script>
|
||||
(function() {
|
||||
var message = "We've detected that you have an ad blocker enabled! Please enable it and help support our work!";
|
||||
|
||||
// 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.write(message);
|
||||
//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>
|
||||
@@ -30,6 +30,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="sidebar-nav-fixed pull-right affix">
|
||||
<div class="well">
|
||||
<ul class="nav ">
|
||||
<%= render 'layouts/rsidebar' %>
|
||||
</ul>
|
||||
</div>
|
||||
<!--/.well -->
|
||||
</div>
|
||||
<!--/sidebar-nav-fixed -->
|
||||
</div>
|
||||
</body>
|
||||
<% end %>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<div class="center hero-unit">
|
||||
<h1>Welcome to WrestlingDev</h1>
|
||||
<br>
|
||||
<p>This website was created to help wrestling coaches run their tournaments. It is 2015, why are we still running bout sheets to tables and why are we still using resources to push cards on a bout board? This website was created as a free way for coaches to run a tournament smoothly with as few workers as possible.</p>
|
||||
<p>This website was created to help wrestling coaches run their tournaments. It is 2015, why are we still running bout sheets to tables and why are we still using resources to push cards on a bout board? This website was created as a <strong>free</strong> way for coaches to run a tournament smoothly with as few workers as possible.</p>
|
||||
<br>
|
||||
<p>If you would like to run a tournament, please click log in and then click sign up.</p>
|
||||
<br>
|
||||
<%= link_to "Browse Tournaments", '/static_pages/tournaments', class: "btn btn-large btn-primary" %>
|
||||
<p></p>
|
||||
|
||||
Reference in New Issue
Block a user