33 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/add-contacts/add-contacts.component.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | align-items: center;
4 | height: 70px;
5 | }
6 |
7 | .input-style {
8 | margin-top: 15px;
9 | height: inherit;
10 | }
11 |
12 | .spinner {
13 | margin: 20px;
14 | height: 50px;
15 | width: 50px;
16 | }
17 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/add-contacts/add-contacts.component.spec.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
14 |
15 | import { AddContactsComponent } from "./add-contacts.component";
16 |
17 | //describe('AddContactsComponent', () => {
18 | // let component: AddContactsComponent;
19 | // let fixture: ComponentFixture;
20 | //
21 | // beforeEach(async(() => {
22 | // TestBed.configureTestingModule({
23 | // declarations: [ AddContactsComponent ]
24 | // })
25 | // .compileComponents();
26 | // }));
27 | //
28 | // beforeEach(() => {
29 | // fixture = TestBed.createComponent(AddContactsComponent);
30 | // component = fixture.componentInstance;
31 | // fixture.detectChanges();
32 | // });
33 | //
34 | // it('should create', () => {
35 | // expect(component).toBeTruthy();
36 | // });
37 | //});
38 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | import { NgModule } from "@angular/core";
14 | import { Routes, RouterModule } from "@angular/router";
15 | import { MainComponent } from "./main/main.component";
16 |
17 | const routes: Routes = [
18 | {
19 | path: "games",
20 | loadChildren: () => import("./games").then((mod) => mod.GAMES),
21 | },
22 | { path: "**", component: MainComponent },
23 | ];
24 |
25 | @NgModule({
26 | imports: [RouterModule.forRoot(routes, {})],
27 | exports: [RouterModule],
28 | })
29 | export class AppRoutingModule {}
30 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/app.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Angular2Guy/AngularPwaMessenger/09e31743a730756358cda21187f9c157f5beab3f/frontend/src/angular/src/app/app.component.scss
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | import { TestBed, waitForAsync } from "@angular/core/testing";
14 | import { RouterTestingModule } from "@angular/router/testing";
15 | import { AppComponent } from "./app.component";
16 |
17 | describe("AppComponent", () => {
18 | beforeEach(waitForAsync(() => {
19 | TestBed.configureTestingModule({
20 | imports: [RouterTestingModule],
21 | declarations: [AppComponent],
22 | }).compileComponents();
23 | }));
24 |
25 | it("should create the app", () => {
26 | const fixture = TestBed.createComponent(AppComponent);
27 | const app = fixture.debugElement.componentInstance;
28 | expect(app).toBeTruthy();
29 | });
30 |
31 | // it(`should have as title 'messenger'`, () => {
32 | // const fixture = TestBed.createComponent(AppComponent);
33 | // const app = fixture.debugElement.componentInstance;
34 | // expect(app.title).toEqual('messenger');
35 | // });
36 | //
37 | // it('should render title in a h1 tag', () => {
38 | // const fixture = TestBed.createComponent(AppComponent);
39 | // fixture.detectChanges();
40 | // const compiled = fixture.debugElement.nativeElement;
41 | // expect(compiled.querySelector('h1').textContent).toContain('Welcome to messenger!');
42 | // });
43 | });
44 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | import { Component } from "@angular/core";
14 |
15 | @Component({
16 | selector: "app-root",
17 | templateUrl: "./app.component.html",
18 | styleUrls: ["./app.component.scss"],
19 | standalone: false
20 | })
21 | export class AppComponent {
22 | protected title = "messenger";
23 | }
24 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/camera/camera.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Send Image to: {{ data.receiver.name }}
5 |
6 | @if (showCameraMsg) {
7 |
8 | Please enable your camera in the browser.
9 |
10 | }
11 |
12 |
13 |
14 |
22 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/camera/camera.component.scss:
--------------------------------------------------------------------------------
1 | .video {
2 | width: 100%;
3 | }
4 |
5 | .hide {
6 | display: none;
7 | }
8 |
9 | .container {
10 | margin: 10px;
11 | }
12 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/camera/camera.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
2 |
3 | import { CameraComponent } from "./camera.component";
4 |
5 | //describe('CameraComponent', () => {
6 | // let component: CameraComponent;
7 | // let fixture: ComponentFixture;
8 | //
9 | // beforeEach(async(() => {
10 | // TestBed.configureTestingModule({
11 | // declarations: [ CameraComponent ]
12 | // })
13 | // .compileComponents();
14 | // }));
15 | //
16 | // beforeEach(() => {
17 | // fixture = TestBed.createComponent(CameraComponent);
18 | // component = fixture.componentInstance;
19 | // fixture.detectChanges();
20 | // });
21 | //
22 | // it('should create', () => {
23 | // expect(component).toBeTruthy();
24 | // });
25 | //});
26 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/common/constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | /* eslint-disable @typescript-eslint/naming-convention */
14 |
15 | export class Constants {
16 | static readonly IMAGE_TYPE = "image/jpeg";
17 | static readonly IMAGE_PREFIX = "data:" + Constants.IMAGE_TYPE + ";base64,";
18 | static readonly B64_IMAGE_PREFIX = "JPGBASE64";
19 | }
20 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/common/messages.ts:
--------------------------------------------------------------------------------
1 | export interface Message {
2 | type: string;
3 | data: T;
4 | }
5 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/common/tuple.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2018 Sven Loesekann
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 | http://www.apache.org/licenses/LICENSE-2.0
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 | */
13 | export class Tuple {
14 | private localA: A;
15 | private localB: B;
16 |
17 | constructor(a: A, b: B) {
18 | this.localA = a;
19 | this.localB = b;
20 | }
21 |
22 | get a(): A {
23 | return this.localA;
24 | }
25 |
26 | get b(): B {
27 | return this.localB;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/frontend/src/angular/src/app/contacts/contacts.component.html:
--------------------------------------------------------------------------------
1 |