mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
rewrite: move to google ads
This commit is contained in:
parent
7fba8db654
commit
aafb9b6cdd
4 changed files with 40 additions and 17 deletions
|
|
@ -28,7 +28,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User',
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.authenticated = function() {
|
$rootScope.authenticated = function() {
|
||||||
User.settings.auth.apiId !== "";
|
return User.settings.auth.apiId !== "";
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.dismissAlert = function() {
|
$rootScope.dismissAlert = function() {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,16 @@ habitrpg.directive('taskFocus',
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
habitrpg.directive('habitrpgAdsense', function() {
|
||||||
|
return {
|
||||||
|
restrict: 'A',
|
||||||
|
transclude: true,
|
||||||
|
replace: true,
|
||||||
|
template: '<div ng-transclude></div>',
|
||||||
|
link: function ($scope, element, attrs) {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directive that executes an expression when the element it is applied to loses focus.
|
* Directive that executes an expression when the element it is applied to loses focus.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
28
views/tasks/ads.jade
Normal file
28
views/tasks/ads.jade
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
div(ng-if='authenticated() && user.flags.ads!="hide"')
|
||||||
|
span.pull-right
|
||||||
|
a(x-bind='click:showStripe', tooltip='Remove Ads')
|
||||||
|
i.icon-remove
|
||||||
|
br
|
||||||
|
a(href='#', data-target='#why-ads-modal', data-toggle='modal', tooltip='Why Ads?')
|
||||||
|
i.icon-question-sign
|
||||||
|
|
||||||
|
div(ng-if='list.type=="habit"', habitrpg-adsense)
|
||||||
|
script(async='async', src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js')
|
||||||
|
// Habit3
|
||||||
|
ins.adsbygoogle(style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576')
|
||||||
|
script.
|
||||||
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
|
|
||||||
|
div(ng-if='list.type=="daily"', habitrpg-adsense)
|
||||||
|
script(async='async', src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js')
|
||||||
|
// Habit3
|
||||||
|
ins.adsbygoogle(style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576')
|
||||||
|
script.
|
||||||
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
|
|
||||||
|
div(ng-if='list.type=="todo"', habitrpg-adsense)
|
||||||
|
script(async='async', src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js')
|
||||||
|
// Habit3
|
||||||
|
ins.adsbygoogle(style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576')
|
||||||
|
script.
|
||||||
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||||
|
|
@ -56,22 +56,7 @@ div(ng-controller='TasksCtrl')
|
||||||
|
|
||||||
br
|
br
|
||||||
|
|
||||||
// Ads
|
include ./ads
|
||||||
div(ng-if='authenticated() && user.flags.ads != "hide" && list.main')
|
|
||||||
span.pull-right
|
|
||||||
a(x-bind='click:showStripe', tooltip='Remove Ads')
|
|
||||||
i.icon-remove
|
|
||||||
br
|
|
||||||
a(href='#', data-target='#why-ads-modal', data-toggle='modal', tooltip='Why Ads?')
|
|
||||||
i.icon-question-sign
|
|
||||||
a(ng-if='list.type=="habit"', href='http://www.amazon.com/gp/product/1400069289/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1400069289&linkCode=as2&tag=ha0d2-20') The Power of Habit: Why We Do What We Do in Life and Business
|
|
||||||
img(src='//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1400069289', width='1', height='1', border='0', alt='', style='border:none !important; margin:0px !important;')
|
|
||||||
a(ng-if='list.type=="daily"', href='http://www.amazon.com/gp/product/0142000280/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0142000280&linkCode=as2&tag=ha0d2-20') Getting Things Done: The Art of Stress-Free Productivity
|
|
||||||
img(src='//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0142000280', width='1', height='1', border='0', alt='', style='border:none !important; margin:0px !important;')
|
|
||||||
a(ng-if='list.type=="todo"', href='http://www.amazon.com/gp/product/0312430000/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0312430000&linkCode=as2&tag=ha0d2-20') The Checklist Manifesto: How to Get Things Right
|
|
||||||
img(src='//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0312430000', width='1', height='1', border='0', alt='', style='border:none !important; margin:0px !important;')
|
|
||||||
a(ng-if='list.type=="reward"', href='http://www.amazon.com/gp/product/1594484805/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1594484805&linkCode=as2&tag=ha0d2-20') Drive: The Surprising Truth About What Motivates Us
|
|
||||||
img(src='//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1594484805', width='1', height='1', border='0', alt='', style='border:none !important; margin:0px !important;')
|
|
||||||
|
|
||||||
// Todo Tabs
|
// Todo Tabs
|
||||||
div(ng-if='list.type=="todo"', ng-class='{"tabbable tabs-below": list.type=="todo"}')
|
div(ng-if='list.type=="todo"', ng-class='{"tabbable tabs-below": list.type=="todo"}')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue