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
44f23d56
Commit
44f23d56
authored
Dec 05, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正聊天室
parent
78adf928
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
app/lobby.component.ts
app/lobby.component.ts
+4
-8
candy/index.html
candy/index.html
+7
-4
No files found.
app/lobby.component.ts
View file @
44f23d56
...
...
@@ -8,9 +8,6 @@ import {App, Category} from "./app";
import
{
DownloadService
}
from
"
./download.service
"
;
import
{
InstallService
}
from
"
./install.service
"
;
import
{
Http
,
URLSearchParams
}
from
"
@angular/http
"
;
import
*
as
path
from
"
path
"
;
import
{
InstallOption
}
from
"
./install-option
"
;
import
{
AppLocal
}
from
"
./app-local
"
;
import
WebViewElement
=
Electron
.
WebViewElement
;
@
Component
({
...
...
@@ -33,7 +30,7 @@ export class LobbyComponent implements OnInit {
async
ngOnInit
()
{
this
.
apps
=
await
this
.
appsService
.
loadApps
();
this
.
chooseApp
(
Array
.
from
(
this
.
apps
.
values
()).
find
(
app
=>
app
.
isInstalled
())
||
<
App
>
this
.
apps
.
get
(
"
ygopro
"
)
);
this
.
chooseApp
(
Array
.
from
(
this
.
apps
.
values
()).
find
(
app
=>
app
.
isInstalled
())
||
this
.
apps
.
get
(
"
ygopro
"
)
!
);
// 初始化聊天室
let
url
=
new
URL
(
'
candy/index.html
'
,
location
.
href
);
...
...
@@ -41,7 +38,9 @@ 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
);
params
.
set
(
'
autojoin
'
,
this
.
currentApp
.
conference
+
'
@conference.mycard.moe
'
);
if
(
this
.
currentApp
.
conference
)
{
params
.
set
(
'
autojoin
'
,
this
.
currentApp
.
conference
+
'
@conference.mycard.moe
'
);
}
this
.
candy_url
=
url
;
}
...
...
@@ -52,9 +51,6 @@ export class LobbyComponent implements OnInit {
}
}
get
grouped_apps
()
{
let
contains
=
[
"
game
"
,
"
music
"
,
"
book
"
].
map
((
value
)
=>
Category
[
value
]);
let
result
=
{
runtime
:
[]};
...
...
candy/index.html
View file @
44f23d56
...
...
@@ -26,8 +26,11 @@
require
(
'
electron-cookies
'
);
// https://github.com/hstove/electron-cookies
ipcRenderer
.
on
(
'
join
'
,
(
event
,
message
)
=>
{
Candy
.
Core
.
Action
.
Jabber
.
Room
.
Join
(
message
);
Candy
.
View
.
Pane
.
Chat
.
setActiveTab
(
message
);
if
(
Candy
.
View
.
Pane
.
Chat
.
rooms
[
message
])
{
Candy
.
View
.
Pane
.
Room
.
show
(
message
);
}
else
{
Candy
.
Core
.
Action
.
Jabber
.
Room
.
Join
(
message
);
}
});
// fix
...
...
@@ -37,13 +40,13 @@
// 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
'
,
{
core
:
{
debug
:
false
,
autojoin
:
[
params
.
get
(
'
autojoin
'
)],
autojoin
:
params
.
get
(
'
autojoin
'
)
&&
[
params
.
get
(
'
autojoin
'
)],
resource
:
'
mycard-
'
+
Math
.
random
().
toString
().
split
(
'
.
'
)[
1
]
},
view
:
{
assets
:
'
res/
'
,
language
:
'
cn
'
}
...
...
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