Skip to content

Commit

Permalink
fix: add ng2-adsense library for google adsense support
Browse files Browse the repository at this point in the history
  • Loading branch information
SudharakaP committed Jun 12, 2020
1 parent 7ef33ec commit 3cc61b6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"core-js": "3.2.1",
"moment": "2.26.0",
"ng-jhipster": "0.10.1",
"ng2-adsense": "6.0.3",
"ngx-cookie": "4.0.2",
"ngx-infinite-scroll": "7.1.0",
"ngx-webstorage": "4.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void configure(HttpSecurity http) throws Exception {
.accessDeniedHandler(problemSupport)
.and()
.headers()
.contentSecurityPolicy("default-src 'self' https://usebasin.com/ https://www.google-analytics.com/; frame-src 'self' https://www.youtube.com/ https://js.stripe.com/ https://repl.it/@SudharakaP/; img-src 'self' https://avatars.dicebear.com https://www.google-analytics.com/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://js.stripe.com/v3/ https://www.google-analytics.com/ https://drive.google.com/; style-src 'self' 'unsafe-inline'")
.contentSecurityPolicy("default-src 'self' https://usebasin.com/ https://www.google-analytics.com/ https://pagead2.googlesyndication.com/ https://adservice.google.ca https://adservice.google.com https://www.googletagservices.com https://tpc.googlesyndication.com; frame-src 'self' https://www.youtube.com/ https://js.stripe.com/ https://repl.it/@SudharakaP/; img-src 'self' https://avatars.dicebear.com https://www.google-analytics.com/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://js.stripe.com/v3/ https://www.google-analytics.com/ https://drive.google.com/ https://pagead2.googlesyndication.com/ https://adservice.google.ca https://adservice.google.com https://www.googletagservices.com https://tpc.googlesyndication.com; style-src 'self' 'unsafe-inline'")
.and()
.referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN)
.and()
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ <h5 class="card-title">Revenue Neutral</h5>
</div>
</div>
</div>
<ng-adsense [adSlot]="1809182877"></ng-adsense>
</div>
</div>
</section>
Expand Down Expand Up @@ -120,6 +121,7 @@ <h1 class="mb-3 display-4">Meet Our Team</h1>
aspires to improve and help uplift the education landscape of Sri Lanka.
</p>
</div>
<ng-adsense [adSlot]="9572122827"></ng-adsense>
</div>
</div>
</section>
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/app/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import { MatButtonModule, MatInputModule, MatSnackBarModule } from '@angular/mat
import { EmailComponent } from './email/email.component';
import { EMAIL_ROUTE } from 'app/home/email/email.route';
import { ReactiveFormsModule } from '@angular/forms';
import { AdsenseModule } from 'ng2-adsense';

@NgModule({
imports: [
OpenLearnrSharedModule,
RouterModule.forChild([HOME_ROUTE, ...EMAIL_ROUTE]),
AdsenseModule.forRoot({
adClient: 'ca-pub-8063185008208498'
}),
MatSnackBarModule,
MatButtonModule,
MatInputModule,
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="shortcut icon" href="favicon.ico" />
<link rel="manifest" href="manifest.webapp" />
<link rel="stylesheet" href="content/css/loading.css">
<script data-ad-client="ca-pub-8063185008208498" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->
</head>
<body>
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9084,6 +9084,13 @@ ng-jhipster@0.10.1:
dependencies:
tslib "^1.9.0"

ng2-adsense@6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/ng2-adsense/-/ng2-adsense-6.0.3.tgz#664b33ce7af67d9fae231098693731389716a5b0"
integrity sha512-+QPjmrgLjNtLun7Ms7JpexGAm0wiveCumQwPElkiGRTQTLiXG5Gay5QN3mmSfYo9azfSILMpZEouO9oDI4PwhA==
dependencies:
tslib "^1.9.0"

ngx-cookie@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/ngx-cookie/-/ngx-cookie-4.0.2.tgz#dc0044826cc3482b723fa70ecc6cd12af057d862"
Expand Down

0 comments on commit 3cc61b6

Please sign in to comment.