Skip to content

Commit 7fb8834

Browse files
committed
ads popup.
1 parent d31ecac commit 7fb8834

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

animations.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
</div>
151151
<div class="container"
152152
ng-app="application">
153+
154+
<div ng-controller="adsController"></div>
153155
<div class="row">
154156
<div class="col-md-3 col-sm-12">
155157
<div class="space10"></div>

app.js

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ angular.module('application', ['cp.ngConfirm'])
44
function ($ngConfirmDefaults) {
55
// modify the defaults here.
66
// $ngConfirmDefaults.theme = 'modern';
7-
8-
97
}
108
])
119
.controller('quickFeaturesController', [
@@ -15,6 +13,7 @@ angular.module('application', ['cp.ngConfirm'])
1513
'$ngConfirmDefaults',
1614
'$timeout',
1715
function ($scope, $ngConfirm, $interval, $ngConfirmDefaults, $timeout) {
16+
1817
$scope.materialTheme = function () {
1918
$ngConfirm({
2019
title: 'Alert',
@@ -1020,6 +1019,50 @@ angular.module('application', ['cp.ngConfirm'])
10201019
});
10211020
};
10221021
}
1022+
])
1023+
.controller('adsController', [
1024+
'$scope',
1025+
'$timeout',
1026+
'$ngConfirm',
1027+
function ($scope, $timeout, $ngConfirm) {
1028+
$timeout(function () {
1029+
if (typeof google_jobrunner == 'undefined' && !localStorage['adsok']) {
1030+
$ngConfirm({
1031+
title: 'Hmmm, ad blocker',
1032+
theme: 'material',
1033+
content: "Ads aren't what you're here for. But ads help me support my work. So, please consider to add this domain to your blocker's whitelist.",
1034+
closeIcon: false,
1035+
buttons: {
1036+
done: {
1037+
text: 'Did it',
1038+
btnClass: 'btn-green',
1039+
action: function () {
1040+
$ngConfirm('I really appreciate this. Thank you.', 'You\'re awesome');
1041+
$timeout(function () {
1042+
location.reload();
1043+
}, 1000);
1044+
}
1045+
},
1046+
doNotAskAgain: {
1047+
text: 'Don\'t ask',
1048+
action: function () {
1049+
localStorage['adsok'] = true;
1050+
}
1051+
},
1052+
donate: {
1053+
text: 'Donate',
1054+
btnClass: 'btn-default',
1055+
action: function () {
1056+
window.open('https://www.paypal.me/bonifacepereira', '_blank');
1057+
localStorage['adsok'] = true;
1058+
}
1059+
}
1060+
1061+
}
1062+
});
1063+
}
1064+
}, 1000);
1065+
}
10231066
]);
10241067

10251068

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162
</div>
163163
<div class="container"
164164
ng-app="application">
165+
166+
<div ng-controller="adsController"></div>
167+
165168
<div class="row">
166169
<div class="col-md-3 col-sm-12">
167170
<div class="space10"></div>

themes.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
</div>
151151
<div class="container"
152152
ng-app="application">
153+
154+
<div ng-controller="adsController"></div>
153155
<div class="row">
154156
<div class="col-md-3 col-sm-12">
155157
<div class="space10"></div>

0 commit comments

Comments
 (0)