Skip to content

Commit

Permalink
Fixed small error in the doc and example
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin committed Jul 31, 2014
1 parent 1179b6e commit d30f3e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function adBlockDetected() {
// Recommended audit because AdBlock lock the file 'fuckadblock.js'
// If the file is not called, the variable does not exist 'fuckAdBlock'
// This means that AdBlock is present
if(fuckAdBlock === undefined) {
if(typeof fuckAdBlock === 'undefined') {
adBlockDetected();
} else {
fuckAdBlock.onDetected(adBlockDetected);
Expand Down
56 changes: 28 additions & 28 deletions test.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,6 @@
border-radius: 4px;
}
</style>

<script src="./fuckadblock2.js"></script>
<script>
function adBlockDetected() {
document.getElementById('adb-actived').style.display = 'block';
document.getElementById('adb-not-actived').style.display = 'none';
}
function adBlockNotDetected() {
document.getElementById('adb-actived').style.display = 'none';
document.getElementById('adb-not-actived').style.display = 'block';
}

if(fuckAdBlock === undefined) {
adBlockDetected();
} else {
fuckAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);
}

function checkAgain() {
document.getElementById('adb-actived').style.display = 'none';
document.getElementById('adb-not-actived').style.display = 'none';
fuckAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);
setTimeout(function() {
fuckAdBlock.check();
}, 500);
}
</script>
</head>
<body>
<div class="container">
Expand Down Expand Up @@ -96,7 +69,7 @@ <h3 class="text-left">Code exemple</h3>
// Recommended audit because AdBlock lock the file 'fuckadblock.js'
// If the file is not called, the variable does not exist 'fuckAdBlock'
// This means that AdBlock is present
if(fuckAdBlock === undefined) {
if(typeof fuckAdBlock === 'undefined') {
adBlockDetected();
} else {
fuckAdBlock.onDetected(adBlockDetected);
Expand Down Expand Up @@ -168,5 +141,32 @@ <h3 class="text-left">Method available</h3>
</div>
</div>
</div>

<script src="./fuckadblock.js"></script>
<script>
function adBlockDetected() {
document.getElementById('adb-actived').style.display = 'block';
document.getElementById('adb-not-actived').style.display = 'none';
}
function adBlockNotDetected() {
document.getElementById('adb-actived').style.display = 'none';
document.getElementById('adb-not-actived').style.display = 'block';
}

if(typeof fuckAdBlock === 'undefined') {
adBlockDetected();
} else {
fuckAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);
}

function checkAgain() {
document.getElementById('adb-actived').style.display = 'none';
document.getElementById('adb-not-actived').style.display = 'none';
fuckAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);
setTimeout(function() {
fuckAdBlock.check();
}, 500);
}
</script>
</body>
</html>

0 comments on commit d30f3e4

Please sign in to comment.