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
f970995f
Commit
f970995f
authored
Jun 17, 2018
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean
parent
b03882eb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
49 deletions
+33
-49
angular.json
angular.json
+1
-1
package.json
package.json
+1
-1
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+3
-0
src/app/new-room/new-room.component.ts
src/app/new-room/new-room.component.ts
+8
-13
src/app/ygopro.service.ts
src/app/ygopro.service.ts
+0
-9
src/index.html
src/index.html
+1
-1
src/typings.d.ts
src/typings.d.ts
+19
-24
No files found.
angular.json
View file @
f970995f
...
...
@@ -29,7 +29,7 @@
"production"
:
{
"optimization"
:
true
,
"outputHashing"
:
"all"
,
"sourceMap"
:
fals
e
,
"sourceMap"
:
tru
e
,
"extractCss"
:
true
,
"namedChunks"
:
false
,
"aot"
:
true
,
...
...
package.json
View file @
f970995f
{
"name"
:
"mycard-mobile"
,
"version"
:
"1.0.2
2
"
,
"version"
:
"1.0.2
3
"
,
"license"
:
"UNLISENCED"
,
"scripts"
:
{
"ng"
:
"ng"
,
...
...
src/app/lobby/lobby.component.html
View file @
f970995f
...
...
@@ -79,6 +79,9 @@
<mat-grid-tile>
<button
mat-raised-button
(click)=
"ygopro.backHome()"
><span
class=
"icon"
>
233
</span><br>
直连
</button>
</mat-grid-tile>
<!--<mat-grid-tile><a mat-raised-button>-->
<!--<mat-icon>casino</mat-icon>-->
<!--<br>轮抽 (开发中)</a></mat-grid-tile>-->
</mat-grid-list>
<mat-card
*ngIf=
"ygopro.points"
>
...
...
src/app/new-room/new-room.component.ts
View file @
f970995f
...
...
@@ -4,7 +4,6 @@ import { LoginService } from '../login.service';
import
{
routerTransition
}
from
'
../router.animations
'
;
import
{
YGOProService
}
from
'
../ygopro.service
'
;
@
Component
({
selector
:
'
app-new-room
'
,
templateUrl
:
'
new-room.component.html
'
,
...
...
@@ -12,42 +11,39 @@ import { YGOProService } from '../ygopro.service';
animations
:
[
routerTransition
]
})
export
class
NewRoomComponent
{
@
HostBinding
(
'
@routerTransition
'
)
animation
=
''
;
@
HostBinding
(
'
@routerTransition
'
)
animation
=
''
;
@
ViewChild
(
'
hostPasswordInput
'
)
hostPasswordInput
:
ElementRef
;
@
ViewChild
(
'
hostPasswordInput
'
)
hostPasswordInput
:
ElementRef
;
host_password
=
(
this
.
login
.
user
.
external_id
^
0x54321
).
toString
();
room
=
{
title
:
this
.
login
.
user
.
username
+
'
的房间
'
,
'
private
'
:
false
,
options
:
{
...
this
.
ygopro
.
default_options
}
private
:
false
,
options
:
{
...
this
.
ygopro
.
default_options
}
};
constructor
(
public
ygopro
:
YGOProService
,
private
login
:
LoginService
,
private
snackBar
:
MatSnackBar
)
{
}
copy
(
host_password
:
string
)
{
try
{
this
.
hostPasswordInput
.
nativeElement
.
select
();
if
(
document
.
execCommand
(
'
copy
'
))
{
this
.
snackBar
.
open
(
`房间密码
${
host_password
}
已复制到剪贴板`
,
undefined
,
{
duration
:
3000
});
this
.
snackBar
.
open
(
`房间密码
${
host_password
}
已复制到剪贴板`
,
undefined
,
{
duration
:
3000
});
}
else
{
console
.
log
(
'
Oops, unable to copy
'
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
share
(
host_password
:
string
)
{
this
.
ygopro
.
share
(
'
房间密码是
'
+
host_password
);
return
navigator
.
share
({
text
:
'
房间密码是
'
+
host_password
});
}
set_start_lp
()
{
...
...
@@ -57,5 +53,4 @@ export class NewRoomComponent {
this
.
room
.
options
.
start_lp
=
8000
;
}
}
}
src/app/ygopro.service.ts
View file @
f970995f
...
...
@@ -396,15 +396,6 @@ export class YGOProService {
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
]
}));
}
}
}
type
Message
=
...
...
src/index.html
View file @
f970995f
...
...
@@ -5,7 +5,7 @@
<title>
MyCard Mobile
</title>
<base
href=
"/"
>
<meta
name=
"theme-color"
content=
"#673ab7"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1
, user-scalable=no
"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
>
</head>
<body>
...
...
src/typings.d.ts
View file @
f970995f
/* SystemJS module definition */
declare
var
module
:
NodeModule
;
interface
NodeModule
{
id
:
string
;
}
interface
Window
{
ygopro
:
{
// 加入房间
join
(
address
:
string
,
port
:
number
,
username
:
string
,
password
:
string
):
void
join
(
address
:
string
,
port
:
number
,
username
:
string
,
password
:
string
):
void
;
// 编辑卡组
edit_deck
():
void
edit_deck
():
void
;
// 观看录像,进入观看录像界面
watch_replay
():
void
watch_replay
():
void
;
// 残局模式
puzzle_mode
():
void
openDrawer
():
void
backHome
():
void
share
(
text
:
string
):
void
updateUser
(
name
:
string
,
avatar
:
string
,
status
:
string
):
void
readFile
(
path
:
string
):
string
writeFile
(
path
:
string
,
data
:
string
):
string
readdir
(
path
:
string
):
string
unlink
(
path
:
string
):
boolean
getFileLastModified
(
path
:
string
):
number
setFileLastModified
(
path
:
string
,
time
:
number
):
void
puzzle_mode
():
void
;
openDrawer
():
void
;
backHome
():
void
;
updateUser
(
name
:
string
,
avatar
:
string
,
status
:
string
):
void
;
readFile
(
path
:
string
):
string
;
writeFile
(
path
:
string
,
data
:
string
):
string
;
readdir
(
path
:
string
):
string
;
unlink
(
path
:
string
):
boolean
;
getFileLastModified
(
path
:
string
):
number
;
setFileLastModified
(
path
:
string
,
time
:
number
):
void
;
};
}
interface
Navigator
{
share
:
(
options
:
{
title
?:
string
;
text
?:
string
;
url
?:
string
})
=>
Promise
<
{}
>
;
}
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