Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mycard Mobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GaiaXalter
Mycard Mobile
Commits
af78fe45
Commit
af78fe45
authored
Jul 21, 2017
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openDrawer, backHome, share
parent
e349c038
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
67 additions
and
14 deletions
+67
-14
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+2
-2
src/app/login.service.ts
src/app/login.service.ts
+4
-0
src/app/new-room/new-room.component.ts
src/app/new-room/new-room.component.ts
+1
-1
src/app/room-list/room-list.component.css
src/app/room-list/room-list.component.css
+4
-2
src/app/room-list/room-list.component.html
src/app/room-list/room-list.component.html
+1
-1
src/app/room-list/room-list.component.ts
src/app/room-list/room-list.component.ts
+2
-1
src/app/watch/watch.component.css
src/app/watch/watch.component.css
+4
-2
src/app/watch/watch.component.html
src/app/watch/watch.component.html
+1
-1
src/app/watch/watch.component.ts
src/app/watch/watch.component.ts
+2
-1
src/app/windbot/windbot.component.css
src/app/windbot/windbot.component.css
+6
-0
src/app/windbot/windbot.component.html
src/app/windbot/windbot.component.html
+8
-2
src/app/windbot/windbot.component.ts
src/app/windbot/windbot.component.ts
+2
-1
src/app/ygopro.service.ts
src/app/ygopro.service.ts
+30
-0
No files found.
src/app/lobby/lobby.component.html
View file @
af78fe45
<md-toolbar
color=
"primary"
>
<button
id=
"menu"
md-icon-button
>
<button
id=
"menu"
md-icon-button
(click)=
"ygopro.openDrawer()"
>
<md-icon>
menu
</md-icon>
</button>
<form
(submit)=
"search(key)"
>
...
...
@@ -71,7 +71,7 @@
<md-icon
fontSet=
"fa"
fontIcon=
"fa-trophy"
></md-icon>
<br>
决斗数据库
</a></md-grid-tile>
<md-grid-tile>
<button
md-raised-button
><span
class=
"icon"
>
233
</span><br>
直连
</button>
<button
md-raised-button
(click)=
"ygopro.backHome()"
><span
class=
"icon"
>
233
</span><br>
直连
</button>
</md-grid-tile>
</md-grid-list>
...
...
src/app/login.service.ts
View file @
af78fe45
...
...
@@ -14,4 +14,8 @@ export class LoginService {
localStorage
.
setItem
(
'
login
'
,
token
);
}
avatar
(
username
)
{
return
'
https://ygobbs.com/user_avatar/ygobbs.com/
'
+
username
+
'
/25/1.png
'
;
}
}
src/app/new-room/new-room.component.ts
View file @
af78fe45
...
...
@@ -42,7 +42,7 @@ export class NewRoomComponent {
}
share
(
host_password
:
string
)
{
this
.
ygopro
.
share
(
'
房间密码是
'
+
host_password
);
}
}
src/app/room-list/room-list.component.css
View file @
af78fe45
.avatar
{
width
:
1em
;
height
:
1em
;
width
:
24px
;
height
:
24px
;
border-radius
:
50%
;
vertical-align
:
middle
;
}
.game-title
{
...
...
src/app/room-list/room-list.component.html
View file @
af78fe45
...
...
@@ -15,7 +15,7 @@
<ng-container
cdkColumnDef=
"users"
>
<md-header-cell
*cdkHeaderCellDef
>
玩家
</md-header-cell>
<md-cell
*cdkCellDef=
"let room"
>
<img
*ngFor=
"let user of room.users"
class=
"avatar"
[src]=
"
'https://ygobbs.com/user_avatar/ygobbs.com/' + user.username + '/25/1.png'
"
>
<img
*ngFor=
"let user of room.users"
class=
"avatar"
[src]=
"
login.avatar(user.username)
"
>
</md-cell>
</ng-container>
...
...
src/app/room-list/room-list.component.ts
View file @
af78fe45
...
...
@@ -3,6 +3,7 @@ import 'rxjs/add/observable/merge';
import
'
rxjs/add/operator/map
'
;
import
'
rxjs/add/operator/startWith
'
;
import
'
rxjs/Rx
'
;
import
{
LoginService
}
from
'
../login.service
'
;
import
{
RoomListDataSource
,
YGOProService
}
from
'
../ygopro.service
'
;
@
Component
({
...
...
@@ -14,7 +15,7 @@ export class RoomListComponent {
displayedColumns
=
[
'
title
'
,
'
users
'
,
'
mode
'
,
'
extra
'
];
dataSource
=
new
RoomListDataSource
(
this
.
ygopro
.
servers
.
filter
(
server
=>
server
.
custom
));
constructor
(
public
ygopro
:
YGOProService
,
private
changeDetector
:
ChangeDetectorRef
)
{
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOProService
,
private
changeDetector
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
...
...
src/app/watch/watch.component.css
View file @
af78fe45
.avatar
{
width
:
1em
;
height
:
1em
;
width
:
24px
;
height
:
24px
;
border-radius
:
50%
;
vertical-align
:
middle
;
}
.game-title
{
...
...
src/app/watch/watch.component.html
View file @
af78fe45
...
...
@@ -32,7 +32,7 @@
<ng-container
cdkColumnDef=
"users"
>
<md-header-cell
*cdkHeaderCellDef
>
玩家
</md-header-cell>
<md-cell
*cdkCellDef=
"let room"
>
<img
*ngFor=
"let user of room.users"
class=
"avatar"
[src]=
"
'https://ygobbs.com/user_avatar/ygobbs.com/' + user.username + '/25/1.png'
"
>
<img
*ngFor=
"let user of room.users"
class=
"avatar"
[src]=
"
login.avatar(user.username)
"
>
</md-cell>
</ng-container>
...
...
src/app/watch/watch.component.ts
View file @
af78fe45
import
{
ChangeDetectorRef
,
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
LoginService
}
from
'
../login.service
'
;
import
{
RoomListDataSource
,
YGOProService
}
from
'
../ygopro.service
'
;
@
Component
({
...
...
@@ -11,7 +12,7 @@ export class WatchComponent implements OnInit {
displayedColumns
=
[
'
mode
'
,
'
title
'
,
'
users
'
,
'
extra
'
];
dataSource
=
new
RoomListDataSource
(
this
.
ygopro
.
servers
,
'
started
'
);
constructor
(
public
ygopro
:
YGOProService
,
private
changeDetector
:
ChangeDetectorRef
)
{
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOProService
,
private
changeDetector
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
...
...
src/app/windbot/windbot.component.css
View file @
af78fe45
.avatar
{
width
:
24px
;
height
:
24px
;
border-radius
:
50%
;
vertical-align
:
middle
;
}
src/app/windbot/windbot.component.html
View file @
af78fe45
...
...
@@ -2,6 +2,12 @@
<md-list>
<h3
md-subheader
>
选择对手
</h3>
<md-list-item
(click)=
"ygopro.join_windbot()"
>
随机
</md-list-item>
<md-list-item
*ngFor=
"let windbot of ygopro.windbot"
(click)=
"ygopro.join_windbot(windbot)"
>
{{windbot}}
</md-list-item>
<md-list-item
(click)=
"ygopro.join_windbot()"
>
<md-icon
md-list-icon
>
airplanemode_active
</md-icon>
<h4
md-line
>
随机
</h4>
</md-list-item>
<md-list-item
*ngFor=
"let windbot of ygopro.windbot"
(click)=
"ygopro.join_windbot(windbot)"
>
<img
md-list-icon
[src]=
"login.avatar(windbot)"
>
<h4
md-line
>
{{windbot}}
</h4>
</md-list-item>
</md-list>
src/app/windbot/windbot.component.ts
View file @
af78fe45
import
{
Component
}
from
'
@angular/core
'
;
import
{
LoginService
}
from
'
../login.service
'
;
import
{
YGOProService
}
from
'
../ygopro.service
'
;
@
Component
({
...
...
@@ -8,6 +9,6 @@ import { YGOProService } from '../ygopro.service';
})
export
class
WindbotComponent
{
constructor
(
public
ygopro
:
YGOProService
)
{
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOProService
)
{
}
}
src/app/ygopro.service.ts
View file @
af78fe45
...
...
@@ -233,6 +233,33 @@ export class YGOProService {
}
}
openDrawer
()
{
try
{
window
.
ygopro
.
openDrawer
();
}
catch
(
error
)
{
console
.
error
(
error
);
alert
(
JSON
.
stringify
({
method
:
'
openDrawer
'
,
params
:
[]
}));
}
}
backHome
()
{
try
{
window
.
ygopro
.
backHome
();
}
catch
(
error
)
{
console
.
error
(
error
);
alert
(
JSON
.
stringify
({
method
:
'
backHome
'
,
params
:
[]
}));
}
}
share
(
text
:
string
)
{
try
{
window
.
ygopro
.
share
(
text
);
}
catch
(
error
)
{
console
.
error
(
error
);
alert
(
JSON
.
stringify
({
method
:
'
share
'
,
params
:
[
text
]
}));
}
}
}
...
...
@@ -305,6 +332,9 @@ declare global {
// 残局模式
puzzle_mode
():
void
openDrawer
():
void
backHome
():
void
share
(
text
:
string
):
void
};
}
}
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