Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Tabu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Tabu
Commits
7c37a2d1
Commit
7c37a2d1
authored
Dec 28, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement functionality for Input-field at gamesearch
parent
894e88a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
app.module.ts
src/app/app.module.ts
+2
-0
select-game.component.html
src/app/select-game/select-game.component.html
+4
-4
select-game.component.ts
src/app/select-game/select-game.component.ts
+16
-1
No files found.
src/app/app.module.ts
View file @
7c37a2d1
...
...
@@ -17,6 +17,7 @@ import {MatCardModule} from '@angular/material/card';
import
{
OverviewComponent
}
from
'
./overview/overview.component
'
;
import
{
ErrorComponent
}
from
'
./error/error.component
'
;
import
{
MatProgressSpinnerModule
}
from
'
@angular/material/progress-spinner
'
;
import
{
FormsModule
}
from
'
@angular/forms
'
;
@
NgModule
({
declarations
:
[
...
...
@@ -39,6 +40,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
MatInputModule
,
MatCardModule
,
MatProgressSpinnerModule
,
FormsModule
],
providers
:
[],
bootstrap
:
[
AppComponent
]
...
...
src/app/select-game/select-game.component.html
View file @
7c37a2d1
...
...
@@ -8,18 +8,18 @@
<br>
<mat-card
class=
"transparent"
>
<mat-card-title>
Spielsuche
</mat-card-title>
<mat-card-subtitle>
Finde ein Spiel über den Spielnamen oder erstelle ein neues
</mat-card-subtitle>
<mat-card-subtitle>
Finde ein Spiel über den Spielnamen oder erstelle ein neues
Spiel
</mat-card-subtitle>
<mat-card-content>
<form>
<mat-form-field>
<mat-label>
Spielname
</mat-label>
<input
type=
"text"
pattern=
"[0-9A-Za-z]*"
matInput
>
<input
#spielname
type=
"text"
matInput
(keyup)=
"checkSpielname(spielname.value)"
(keypress)=
"keyPressAlphaNumeric($event)"
>
</mat-form-field>
</form>
</mat-card-content>
<mat-card-actions>
<button
mat-raised-button
color=
"primary"
(click)=
"getSpielSessions()"
>
Spiel erstellen
</button>
<button
mat-raised-button
color=
"primary"
(click)=
"joinGame($event
)"
>
Spiel beitreten
</button>
<button
[disabled]=
"buttonsDisabled"
mat-raised-button
color=
"primary"
(click)=
"getSpielSessions()"
>
Spiel erstellen
</button>
<button
[disabled]=
"buttonsDisabled"
mat-raised-button
color=
"primary"
(click)=
"joinGame(
)"
>
Spiel beitreten
</button>
</mat-card-actions>
</mat-card>
</div>
src/app/select-game/select-game.component.ts
View file @
7c37a2d1
...
...
@@ -9,6 +9,7 @@ import {TabuMiddlewareService} from '../dao/TabuMiddlewareService';
})
export
class
SelectGameComponent
implements
OnInit
{
buttonsDisabled
=
true
;
constructor
(
private
router
:
Router
,
private
server
:
TabuMiddlewareService
)
{
}
...
...
@@ -21,7 +22,21 @@ export class SelectGameComponent implements OnInit {
console
.
log
(
'
Response:
'
,
response
);
}
joinGame
(
event
:
any
):
void
{
joinGame
():
void
{
this
.
router
.
navigate
([
'
/overview
'
]);
}
keyPressAlphaNumeric
(
event
:
KeyboardEvent
):
boolean
{
if
(
/
[
a-zA-Z0-9
]
/
.
test
(
event
.
key
))
{
return
true
;
}
else
{
event
.
preventDefault
();
return
false
;
}
}
checkSpielname
(
spielname
:
string
):
void
{
console
.
log
(
spielname
)
this
.
buttonsDisabled
=
spielname
.
length
===
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment