Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
syntax_j
mycard
Commits
f010d597
Commit
f010d597
authored
Oct 20, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decks
parent
c5b54b1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
app/ygopro.component.html
app/ygopro.component.html
+3
-3
app/ygopro.component.ts
app/ygopro.component.ts
+31
-6
No files found.
app/ygopro.component.html
View file @
f010d597
<form
class=
"form-inline"
>
<form
class=
"form-inline"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"exampleSelect1"
>
卡组
</label>
<label
for=
"exampleSelect1"
>
卡组
</label>
<select
class=
"form-control"
id=
"exampleSelect1"
>
<select
class=
"form-control"
id=
"exampleSelect1"
name=
"deck"
[(ngModel)]=
"current_deck"
>
<option
*ngFor=
"let
item of decks"
>
{{item
}}
</option>
<option
*ngFor=
"let
deck of decks"
[ngValue]=
"deck"
>
{{deck
}}
</option>
</select>
</select>
</div>
</div>
<button
type=
"submit"
class=
"btn btn-secondary"
>
编辑
</button>
<button
type=
"submit"
class=
"btn btn-secondary"
(click)=
"edit_deck(current_deck)"
>
编辑
</button>
<button
type=
"submit"
class=
"btn btn-secondary"
>
删除
</button>
<button
type=
"submit"
class=
"btn btn-secondary"
>
删除
</button>
<button
type=
"submit"
(click)=
"refresh()"
class=
"btn btn-secondary"
>
刷新
</button>
<button
type=
"submit"
(click)=
"refresh()"
class=
"btn btn-secondary"
>
刷新
</button>
</form>
</form>
...
...
app/ygopro.component.ts
View file @
f010d597
...
@@ -5,13 +5,12 @@ import {Component} from '@angular/core';
...
@@ -5,13 +5,12 @@ import {Component} from '@angular/core';
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
declare
var
process
;
declare
var
System
;
declare
var
System
;
const
fs
=
System
.
_nodeRequire
(
'
fs
'
);
const
fs
=
System
.
_nodeRequire
(
'
fs
'
);
const
path
=
System
.
_nodeRequire
(
'
path
'
);
const
path
=
System
.
_nodeRequire
(
'
path
'
);
const
Promise
=
System
.
_nodeRequire
(
'
bluebird
'
);
//const Promise = System._nodeRequire('bluebird');
Promise
.
resolve
(
"
foo
"
).
then
(
function
(
msg
)
{
const
ini
=
System
.
_nodeRequire
(
'
ini
'
);
console
.
log
(
msg
)
});
@
Component
({
@
Component
({
selector
:
'
ygopro
'
,
selector
:
'
ygopro
'
,
...
@@ -21,6 +20,11 @@ Promise.resolve("foo").then(function (msg) {
...
@@ -21,6 +20,11 @@ Promise.resolve("foo").then(function (msg) {
export
class
YGOProComponent
{
export
class
YGOProComponent
{
app
=
this
.
appsService
.
searchApp
(
'
ygopro
'
);
app
=
this
.
appsService
.
searchApp
(
'
ygopro
'
);
decks
=
[];
decks
=
[];
current_deck
;
system_conf
=
path
.
join
(
this
.
app
.
local
.
path
,
'
system.conf
'
);
numfont
=
this
.
get_font
({
'
darwin
'
:
[
'
/System/Library/Fonts/PingFang.ttc
'
]});
textfont
=
this
.
get_font
({
'
darwin
'
:
[
'
/System/Library/Fonts/PingFang.ttc
'
]});
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
this
.
refresh
()
this
.
refresh
()
...
@@ -29,6 +33,21 @@ export class YGOProComponent {
...
@@ -29,6 +33,21 @@ export class YGOProComponent {
refresh
()
{
refresh
()
{
this
.
get_decks
().
then
((
decks
)
=>
{
this
.
get_decks
().
then
((
decks
)
=>
{
this
.
decks
=
decks
;
this
.
decks
=
decks
;
if
(
!
(
this
.
current_deck
in
this
.
decks
))
{
this
.
current_deck
=
decks
[
0
];
}
})
}
get_font
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
fonts
=
data
[
process
.
platform
]
})
}
fix_fonts
(
ini
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
numfont
.
then
()
})
})
}
}
...
@@ -38,10 +57,16 @@ export class YGOProComponent {
...
@@ -38,10 +57,16 @@ export class YGOProComponent {
if
(
error
)
{
if
(
error
)
{
reject
(
error
)
reject
(
error
)
}
else
{
}
else
{
let
result
:
string
[]
=
files
.
filter
(
file
=>
path
.
extname
(
file
)
==
"
.ydk
"
).
map
(
file
=>
path
.
basename
(
file
,
'
.ydk
'
));
resolve
(
files
.
filter
(
file
=>
path
.
extname
(
file
)
==
"
.ydk
"
).
map
(
file
=>
path
.
basename
(
file
,
'
.ydk
'
)));
resolve
(
result
);
}
}
})
})
})
})
}
}
edit_deck
(
deck
)
{
fs
.
readFile
(
this
.
system_conf
,
{
encoding
:
'
utf-8
'
},
(
error
,
data
)
=>
{
if
(
error
)
throw
error
;
console
.
log
(
ini
.
parse
(
data
));
});
}
}
}
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