Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 3cc61b6

Browse files
committed
fix: add ng2-adsense library for google adsense support
1 parent 7ef33ec commit 3cc61b6

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"core-js": "3.2.1",
3030
"moment": "2.26.0",
3131
"ng-jhipster": "0.10.1",
32+
"ng2-adsense": "6.0.3",
3233
"ngx-cookie": "4.0.2",
3334
"ngx-infinite-scroll": "7.1.0",
3435
"ngx-webstorage": "4.0.2",

src/main/java/com/asanka/tutor/config/SecurityConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void configure(HttpSecurity http) throws Exception {
6363
.accessDeniedHandler(problemSupport)
6464
.and()
6565
.headers()
66-
.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'")
66+
.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'")
6767
.and()
6868
.referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN)
6969
.and()

src/main/webapp/app/home/home.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ <h5 class="card-title">Revenue Neutral</h5>
9090
</div>
9191
</div>
9292
</div>
93+
<ng-adsense [adSlot]="1809182877"></ng-adsense>
9394
</div>
9495
</div>
9596
</section>
@@ -120,6 +121,7 @@ <h1 class="mb-3 display-4">Meet Our Team</h1>
120121
aspires to improve and help uplift the education landscape of Sri Lanka.
121122
</p>
122123
</div>
124+
<ng-adsense [adSlot]="9572122827"></ng-adsense>
123125
</div>
124126
</div>
125127
</section>

src/main/webapp/app/home/home.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import { MatButtonModule, MatInputModule, MatSnackBarModule } from '@angular/mat
77
import { EmailComponent } from './email/email.component';
88
import { EMAIL_ROUTE } from 'app/home/email/email.route';
99
import { ReactiveFormsModule } from '@angular/forms';
10+
import { AdsenseModule } from 'ng2-adsense';
1011

1112
@NgModule({
1213
imports: [
1314
OpenLearnrSharedModule,
1415
RouterModule.forChild([HOME_ROUTE, ...EMAIL_ROUTE]),
16+
AdsenseModule.forRoot({
17+
adClient: 'ca-pub-8063185008208498'
18+
}),
1519
MatSnackBarModule,
1620
MatButtonModule,
1721
MatInputModule,

src/main/webapp/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link rel="shortcut icon" href="favicon.ico" />
1212
<link rel="manifest" href="manifest.webapp" />
1313
<link rel="stylesheet" href="content/css/loading.css">
14+
<script data-ad-client="ca-pub-8063185008208498" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
1415
<!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->
1516
</head>
1617
<body>

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9084,6 +9084,13 @@ [email protected]:
90849084
dependencies:
90859085
tslib "^1.9.0"
90869086

9087+
9088+
version "6.0.3"
9089+
resolved "https://registry.yarnpkg.com/ng2-adsense/-/ng2-adsense-6.0.3.tgz#664b33ce7af67d9fae231098693731389716a5b0"
9090+
integrity sha512-+QPjmrgLjNtLun7Ms7JpexGAm0wiveCumQwPElkiGRTQTLiXG5Gay5QN3mmSfYo9azfSILMpZEouO9oDI4PwhA==
9091+
dependencies:
9092+
tslib "^1.9.0"
9093+
90879094
90889095
version "4.0.2"
90899096
resolved "https://registry.yarnpkg.com/ngx-cookie/-/ngx-cookie-4.0.2.tgz#dc0044826cc3482b723fa70ecc6cd12af057d862"

0 commit comments

Comments
 (0)