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
75007047
Commit
75007047
authored
Jun 17, 2018
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix, 优化 service worker
parent
6758f353
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1680 additions
and
1685 deletions
+1680
-1685
package-lock.json
package-lock.json
+1665
-1665
src/app/app.module.ts
src/app/app.module.ts
+3
-2
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+1
-1
src/app/lobby/lobby.component.ts
src/app/lobby/lobby.component.ts
+11
-17
No files found.
package-lock.json
View file @
75007047
This diff is collapsed.
Click to expand it.
src/app/app.module.ts
View file @
75007047
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
HttpModule
,
JsonpModule
}
from
'
@angular/http
'
;
import
{
MatAutocompleteModule
,
MatButtonModule
,
...
...
@@ -37,6 +36,8 @@ import { ToolbarComponent } from './toolbar/toolbar.component';
import
{
WatchComponent
}
from
'
./watch/watch.component
'
;
import
{
WindbotComponent
}
from
'
./windbot/windbot.component
'
;
import
{
YGOProService
}
from
'
./ygopro.service
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
HttpModule
}
from
'
@angular/http
'
;
@
NgModule
({
declarations
:
[
...
...
@@ -55,6 +56,7 @@ import { YGOProService } from './ygopro.service';
ServiceWorkerModule
.
register
(
'
ngsw-worker.js
'
,
{
enabled
:
environment
.
production
}),
FormsModule
,
HttpModule
,
HttpClientModule
,
AppRoutingModule
,
BrowserAnimationsModule
,
MatInputModule
,
...
...
@@ -72,7 +74,6 @@ import { YGOProService } from './ygopro.service';
MatSnackBarModule
,
MatAutocompleteModule
,
ReactiveFormsModule
,
JsonpModule
,
MatMenuModule
,
MatProgressSpinnerModule
],
...
...
src/app/lobby/lobby.component.html
View file @
75007047
...
...
@@ -5,7 +5,7 @@
<mat-icon>
menu
</mat-icon>
</button>
<form
(submit)=
"search(key)"
>
<input
type=
search
placeholder=
"卡片搜索"
name=
"key"
[(ngModel)]=
"key"
matAutocomplete
=
"auto"
[formControl]=
"searchCtrl"
>
<input
type=
"search"
placeholder=
"卡片搜索"
name=
"key"
[(ngModel)]=
"key"
[matAutocomplete]
=
"auto"
[formControl]=
"searchCtrl"
>
<mat-autocomplete
#auto
="
matAutocomplete
"
>
<mat-option
*ngFor=
"let card of suggestion | async"
[value]=
"card"
(onSelectionChange)=
"search(card)"
>
...
...
src/app/lobby/lobby.component.ts
View file @
75007047
import
{
Component
,
HostBinding
}
from
'
@angular/core
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
Http
,
Jsonp
}
from
'
@angular/http
'
;
import
{
environment
}
from
'
../../environments/environment
'
;
import
{
LoginService
}
from
'
../login.service
'
;
import
{
routerTransition2
}
from
'
../router.animations
'
;
...
...
@@ -9,10 +8,7 @@ import { YGOProService } from '../ygopro.service';
import
'
rxjs/add/operator/filter
'
;
import
'
rxjs/add/operator/mergeMap
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
@
Component
({
selector
:
'
app-lobby
'
,
...
...
@@ -21,28 +17,26 @@ import 'rxjs/add/operator/mergeMap';
animations
:
[
routerTransition2
]
})
export
class
LobbyComponent
{
@
HostBinding
(
'
@routerTransition2
'
)
animation
:
''
;
@
HostBinding
(
'
@routerTransition2
'
)
animation
:
''
;
version
=
environment
.
version
;
build
:
BuildConfig
;
searchCtrl
=
new
FormControl
();
suggestion
=
this
.
searchCtrl
.
valueChanges
.
filter
(
name
=>
name
).
mergeMap
(
name
=>
this
.
jsonp
.
get
(
'
http://www.ourocg.cn/Suggest.aspx
'
,
{
params
:
{
callback
:
'
JSONP_CALLBACK
'
,
key
:
name
}
}).
map
(
response
=>
response
.
json
().
result
));
suggestion
=
this
.
searchCtrl
.
valueChanges
.
filter
(
name
=>
name
)
.
mergeMap
(
name
=>
this
.
http
.
get
(
`https://www.ourocg.cn/search/suggest/
${
name
}
`
));
key
:
string
;
arena_url
:
string
;
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOPro
Service
,
private
http
:
Http
,
private
jsonp
:
Jsonp
,
public
storage
:
StorageService
)
{
constructor
(
public
login
:
Login
Service
,
public
ygopro
:
YGOProService
,
private
http
:
HttpClient
,
public
storage
:
StorageService
)
{
const
arena_url
=
new
URL
(
'
https://mycard.moe/ygopro/arena
'
);
arena_url
.
searchParams
.
set
(
'
sso
'
,
login
.
token
);
this
.
arena_url
=
arena_url
.
toString
();
...
...
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