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
e676ab65
Commit
e676ab65
authored
Dec 07, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
783a2327
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
412 additions
and
432 deletions
+412
-432
app/app-detail.component.html
app/app-detail.component.html
+1
-1
app/apps.service.ts
app/apps.service.ts
+3
-0
app/community.component.css
app/community.component.css
+0
-0
app/community.component.html
app/community.component.html
+0
-0
app/community.component.ts
app/community.component.ts
+0
-12
app/lobby.component.ts
app/lobby.component.ts
+9
-1
app/login.component.html
app/login.component.html
+1
-1
app/login.component.ts
app/login.component.ts
+4
-0
app/mycard.component.html
app/mycard.component.html
+1
-1
app/mycard.component.ts
app/mycard.component.ts
+5
-1
app/mycard.module.ts
app/mycard.module.ts
+1
-2
app/settings.sevices.ts
app/settings.sevices.ts
+1
-1
app/ygopro.component.html
app/ygopro.component.html
+1
-1
app/ygopro.component.ts
app/ygopro.component.ts
+6
-5
apps.json
apps.json
+2
-2
candy/index.html
candy/index.html
+2
-2
locale/messages.en-US.xlf
locale/messages.en-US.xlf
+375
-402
No files found.
app/app-detail.component.html
View file @
e676ab65
...
...
@@ -118,7 +118,7 @@
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
取消
</button>
<button
i18n
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
取消
</button>
<button
i18n
id=
"submit"
type=
"submit"
[disabled]=
"!theForm.form.valid"
class=
"btn btn-primary"
>
安装
</button>
</div>
</form>
...
...
app/apps.service.ts
View file @
e676ab65
...
...
@@ -541,6 +541,9 @@ export class AppsService {
app
.
local
=
local
;
this
.
saveAppLocal
(
app
);
app
.
status
.
status
=
"
ready
"
;
if
(
app
.
id
==
'
ygopro
'
)
{
localStorage
.
removeItem
(
'
ygopro-locale
'
)
}
}
catch
(
e
)
{
console
.
log
(
"
exception in doInstall
"
,
e
);
throw
e
;
...
...
app/community.component.css
deleted
100644 → 0
View file @
783a2327
app/community.component.html
deleted
100644 → 0
View file @
783a2327
app/community.component.ts
deleted
100644 → 0
View file @
783a2327
/**
* Created by zh99998 on 16/9/2.
*/
import
{
Component
}
from
"
@angular/core
"
;
@
Component
({
moduleId
:
module
.
id
,
selector
:
'
community
'
,
templateUrl
:
'
community.component.html
'
,
styleUrls
:
[
'
community.component.css
'
],
})
export
class
CommunityComponent
{
}
app/lobby.component.ts
View file @
e676ab65
...
...
@@ -9,6 +9,7 @@ import {DownloadService} from "./download.service";
import
{
Http
,
URLSearchParams
}
from
"
@angular/http
"
;
import
{
shell
}
from
"
electron
"
;
import
WebViewElement
=
Electron
.
WebViewElement
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -24,7 +25,7 @@ export class LobbyComponent implements OnInit {
currentApp
:
App
;
private
apps
:
Map
<
string
,
App
>
;
constructor
(
private
appsService
:
AppsService
,
private
loginService
:
LoginService
)
{
constructor
(
private
appsService
:
AppsService
,
private
loginService
:
LoginService
,
private
settingsService
:
SettingsService
)
{
}
async
ngOnInit
()
{
...
...
@@ -38,6 +39,13 @@ export class LobbyComponent implements OnInit {
params
.
set
(
'
jid
'
,
this
.
loginService
.
user
.
username
+
'
@mycard.moe
'
);
params
.
set
(
'
password
'
,
this
.
loginService
.
user
.
external_id
.
toString
());
params
.
set
(
'
nickname
'
,
this
.
loginService
.
user
.
username
);
switch
(
this
.
settingsService
.
getLocale
()){
case
'
zh-CN
'
:
params
.
set
(
'
language
'
,
'
cn
'
);
break
;
default
:
params
.
set
(
'
language
'
,
'
en
'
);
}
if
(
this
.
currentApp
.
conference
)
{
params
.
set
(
'
autojoin
'
,
this
.
currentApp
.
conference
+
'
@conference.mycard.moe
'
);
}
...
...
app/login.component.html
View file @
e676ab65
<webview
[src]=
"url"
(will-navigate)=
"return_sso($event.url)"
(did-get-redirect-request)=
"return_sso($event.newURL)"
></webview>
\ No newline at end of file
<webview
[src]=
"url"
(will-navigate)=
"return_sso($event.url)"
(did-get-redirect-request)=
"return_sso($event.newURL)"
(new-window)=
"openExternal($event.url)"
></webview>
\ No newline at end of file
app/login.component.ts
View file @
e676ab65
...
...
@@ -6,6 +6,7 @@ import {LoginService} from "./login.service";
import
*
as
crypto
from
"
crypto
"
;
import
*
as
querystring
from
"
querystring
"
;
import
*
as
url
from
"
url
"
;
import
{
shell
}
from
"
electron
"
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -46,4 +47,7 @@ export class LoginComponent {
this
.
loginService
.
login
(
user
);
}
openExternal
(
url
:
string
)
{
shell
.
openExternal
(
url
);
}
}
app/mycard.component.html
View file @
e676ab65
...
...
@@ -39,4 +39,4 @@
<login
class=
"page"
*ngIf=
"!loginService.logged_in"
></login>
<store
class=
"page"
*ngIf=
"loginService.logged_in"
[hidden]=
"currentPage != 'store'"
></store>
<lobby
class=
"page"
*ngIf=
"loginService.logged_in"
[hidden]=
"currentPage != 'lobby'"
></lobby>
<webview
class=
"page"
*ngIf=
"loginService.logged_in"
[hidden]=
"currentPage != 'community'"
src=
"https://ygobbs.com"
></webview>
<webview
class=
"page"
*ngIf=
"loginService.logged_in"
[hidden]=
"currentPage != 'community'"
src=
"https://ygobbs.com"
(new-window)=
"openExternal($event.url)"
></webview>
app/mycard.component.ts
View file @
e676ab65
import
{
Component
,
Renderer
,
ChangeDetectorRef
,
OnInit
,
ElementRef
,
ViewChild
}
from
"
@angular/core
"
;
import
{
remote
}
from
"
electron
"
;
import
{
remote
,
shell
}
from
"
electron
"
;
import
{
LoginService
}
from
"
./login.service
"
;
const
autoUpdater
:
Electron
.
AutoUpdater
=
remote
.
getGlobal
(
'
autoUpdater
'
);
declare
const
$
:
any
;
...
...
@@ -89,4 +89,8 @@ export class MyCardComponent implements OnInit {
$
(
element
.
nativeElement
).
tooltip
({
placement
:
'
bottom
'
,
container
:
'
body
'
})
}
}
openExternal
(
url
:
string
)
{
shell
.
openExternal
(
url
);
}
}
app/mycard.module.ts
View file @
e676ab65
...
...
@@ -8,7 +8,6 @@ import {StoreComponent} from "./store.component";
import
{
LobbyComponent
}
from
"
./lobby.component
"
;
import
{
AppDetailComponent
}
from
"
./app-detail.component
"
;
import
{
RosterComponent
}
from
"
./roster.component
"
;
import
{
CommunityComponent
}
from
"
./community.component
"
;
import
{
YGOProComponent
}
from
"
./ygopro.component
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
...
...
@@ -19,7 +18,7 @@ import {DownloadService} from "./download.service";
imports
:
[
BrowserModule
,
FormsModule
,
ReactiveFormsModule
,
HttpModule
],
declarations
:
[
MyCardComponent
,
LoginComponent
,
StoreComponent
,
LobbyComponent
,
CommunityComponent
,
AppDetailComponent
,
RosterComponent
,
YGOProComponent
,
AppDetailComponent
,
RosterComponent
,
YGOProComponent
,
],
bootstrap
:
[
MyCardComponent
],
providers
:
[
...
...
app/settings.sevices.ts
View file @
e676ab65
...
...
@@ -16,7 +16,7 @@ export class SettingsService {
static
defaultLibraries
=
[
{
"
default
"
:
true
,
path
:
path
.
join
(
remote
.
app
.
getPath
(
"
appData
"
),
"
l
ibrary
"
)
path
:
path
.
join
(
remote
.
app
.
getPath
(
"
appData
"
),
"
MyCardL
ibrary
"
)
},
];
libraries
:
Library
[];
...
...
app/ygopro.component.html
View file @
e676ab65
...
...
@@ -27,7 +27,7 @@
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
<h4
class=
"modal-title"
id=
"myModalLabel1"
>
单人模式
</h4>
<h4
i18n
class=
"modal-title"
id=
"myModalLabel1"
>
单人模式
</h4>
</div>
<div
class=
"modal-body"
>
<label
i18n
>
选择对手
</label>
...
...
app/ygopro.component.ts
View file @
e676ab65
...
...
@@ -121,9 +121,9 @@ export class YGOProComponent implements OnInit {
}
}
ngOnInit
()
{
async
ngOnInit
()
{
this
.
system_conf
=
path
.
join
(
this
.
app
.
local
!
.
path
,
'
system.conf
'
);
this
.
refresh
();
await
this
.
refresh
();
let
modal
=
$
(
'
#game-list-modal
'
);
...
...
@@ -262,7 +262,7 @@ export class YGOProComponent implements OnInit {
win
.
minimize
();
let
locale
=
this
.
settingsService
.
getLocale
();
if
(
localStorage
.
getItem
(
'
ygopro-locale
'
)
!=
locale
)
{
console
.
log
(
`try convert ygopro locale to
${
locale
}
`
)
console
.
log
(
`try convert ygopro locale to
${
locale
}
`
)
;
try
{
await
new
Promise
((
resolve
,
reject
)
=>
{
let
source
=
fs
.
createReadStream
(
path
.
join
(
this
.
app
.
local
!
.
path
,
'
locales
'
,
locale
,
'
strings.conf
'
));
...
...
@@ -296,7 +296,7 @@ export class YGOProComponent implements OnInit {
reject
(
error
)
});
});
localStorage
.
setItem
(
'
ygopro-locale
'
,
locale
)
localStorage
.
setItem
(
'
ygopro-locale
'
,
locale
)
;
console
.
log
(
`convert ygopro locale to
${
locale
}
success`
)
}
catch
(
error
)
{
console
.
error
(
`convert ygopro locale to
${
locale
}
failed`
,
error
)
...
...
@@ -311,8 +311,9 @@ export class YGOProComponent implements OnInit {
reject
(
error
);
win
.
restore
()
});
child
.
on
(
'
exit
'
,
(
code
,
signal
)
=>
{
child
.
on
(
'
exit
'
,
async
(
code
,
signal
)
=>
{
// error 触发之后还可能会触发exit,但是Promise只承认首次状态转移,因此这里无需重复判断是否已经error过。
await
this
.
refresh
();
resolve
();
win
.
restore
()
})
...
...
apps.json
View file @
e676ab65
...
...
@@ -2052,8 +2052,8 @@
}
},
"version"
:
{
"win32"
:
"1.033.C-
7
"
,
"darwin"
:
"1.033.C-
7
"
"win32"
:
"1.033.C-
8
"
,
"darwin"
:
"1.033.C-
8
"
},
"news"
:
{
"zh-CN"
:
[
...
...
candy/index.html
View file @
e676ab65
...
...
@@ -40,7 +40,7 @@
// candy init
const
params
=
new
URLSearchParams
(
location
.
search
);
Candy
.
View
.
Template
.
Login
.
form
=
'
<form method="post" id="login-form" class="login-form">
'
+
'
<input type="hidden" id="nickname" name="nickname" value="
'
+
params
.
nickname
+
'
"/>
'
+
'
{{#displayUsername}}<input type="hidden" id="username" name="username" value="
'
+
params
.
jid
+
'
"/>
'
+
'
{{#displayDomain}} <span class="at-symbol">@</span>
'
+
'
<select id="domain" name="domain">{{#domains}}<option value="{{domain}}">{{domain}}</option>{{/domains}}</select>
'
+
"
{{/displayDomain}}
"
+
"
{{/displayUsername}}
"
+
'
{{#presetJid}}<input type="hidden" id="username" name="username" value="{{presetJid}}"/>{{/presetJid}}
'
+
'
{{#displayPassword}}<input type="hidden" id="password" name="password" value="
'
+
params
.
password
+
'
"/>{{/displayPassword}}
'
+
'
<input type="submit" class="button" value="{{_loginSubmit}}" /></form>
'
;
;
Candy
.
View
.
Template
.
Login
.
form
=
'
<form method="post" id="login-form" class="login-form">
'
+
'
<input type="hidden" id="nickname" name="nickname" value="
'
+
params
.
nickname
+
'
"/>
'
+
'
{{#displayUsername}}<input type="hidden" id="username" name="username" value="
'
+
params
.
jid
+
'
"/>
'
+
'
{{#displayDomain}} <span class="at-symbol">@</span>
'
+
'
<select id="domain" name="domain">{{#domains}}<option value="{{domain}}">{{domain}}</option>{{/domains}}</select>
'
+
"
{{/displayDomain}}
"
+
"
{{/displayUsername}}
"
+
'
{{#presetJid}}<input type="hidden" id="username" name="username" value="{{presetJid}}"/>{{/presetJid}}
'
+
'
{{#displayPassword}}<input type="hidden" id="password" name="password" value="
'
+
params
.
password
+
'
"/>{{/displayPassword}}
'
+
'
<input type="submit" class="button" value="{{_loginSubmit}}" /></form>
'
;
Candy
.
Util
.
setCookie
(
'
candy-nostatusmessages
'
,
'
1
'
,
365
);
Candy
.
init
(
'
wss://chat.mycard.moe:5280/websocket
'
,
{
...
...
@@ -49,7 +49,7 @@
autojoin
:
params
.
get
(
'
autojoin
'
)
&&
[
params
.
get
(
'
autojoin
'
)],
resource
:
'
mycard-
'
+
Math
.
random
().
toString
().
split
(
'
.
'
)[
1
]
},
view
:
{
assets
:
'
res/
'
,
language
:
'
cn
'
}
view
:
{
assets
:
'
res/
'
,
language
:
params
.
get
(
'
language
'
)
}
});
Candy
.
Core
.
connect
(
params
.
get
(
'
jid
'
),
params
.
get
(
'
password
'
),
params
.
get
(
'
nickname
'
));
...
...
locale/messages.en-US.xlf
View file @
e676ab65
This diff is collapsed.
Click to expand it.
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