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
edbcb343
Commit
edbcb343
authored
Jan 30, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refresh and fix
parent
cea656ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
apps.js
apps.js
+11
-8
index.html
index.html
+1
-1
js/app.js
js/app.js
+9
-0
No files found.
apps.js
View file @
edbcb343
...
@@ -178,7 +178,10 @@ function start_server() {
...
@@ -178,7 +178,10 @@ function start_server() {
message
=
JSON
.
stringify
({
event
:
'
login
'
,
data
:
[
user
]});
message
=
JSON
.
stringify
({
event
:
'
login
'
,
data
:
[
user
]});
for
(
let
client
of
server
.
clients
)
{
for
(
let
client
of
server
.
clients
)
{
if
(
client
!=
connection
)
{
if
(
client
!=
connection
)
{
client
.
send
(
message
);
try
{
client
.
send
(
message
);
}
catch
(
error
)
{
}
}
}
}
}
}
else
{
}
else
{
...
@@ -187,14 +190,14 @@ function start_server() {
...
@@ -187,14 +190,14 @@ function start_server() {
});
});
});
});
eventemitter
.
on
(
'
update
'
,
(
app
,
local
,
resson
)
=>
{
let
message
=
JSON
.
stringify
({
event
:
'
update
'
,
data
:
[
app
,
local
,
resson
]});
for
(
let
connection
of
server
.
clients
)
{
connection
.
send
(
message
);
}
save_db
();
});
}
}
eventemitter
.
on
(
'
update
'
,
(
app
,
local
,
resson
)
=>
{
let
message
=
JSON
.
stringify
({
event
:
'
update
'
,
data
:
[
app
,
local
,
resson
]});
for
(
let
connection
of
server
.
clients
)
{
connection
.
send
(
message
);
}
save_db
();
});
function
load
(
app
,
local
,
callback
)
{
function
load
(
app
,
local
,
callback
)
{
let
pending
=
1
;
let
pending
=
1
;
...
...
index.html
View file @
edbcb343
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<a
href=
"#forum"
class=
"profile"
><img
id=
"avatar"
></a>
<a
href=
"#forum"
class=
"profile"
><img
id=
"avatar"
></a>
<a
href=
"#forum"
class=
"profile item"
id=
"username"
></a>
<a
href=
"#forum"
class=
"profile item"
id=
"username"
></a>
<a
href=
"#ygopro"
id=
"logout"
class=
"item"
>
切换
</a>
<a
href=
"#ygopro"
id=
"logout"
class=
"item"
>
切换
</a>
<a
href=
"#ygopro"
id=
"refresh"
class=
"item"
>
刷新
</a>
</div>
</div>
<div
id=
"window-buttons"
hidden
>
<div
id=
"window-buttons"
hidden
>
<i
id=
"minimize"
class=
"icon-minimize"
></i>
<i
id=
"minimize"
class=
"icon-minimize"
></i>
...
@@ -33,7 +34,6 @@
...
@@ -33,7 +34,6 @@
<i
id=
"close"
class=
"icon-close"
></i>
<i
id=
"close"
class=
"icon-close"
></i>
</div>
</div>
</div>
</div>
</nav>
</nav>
<webview
id=
"store"
src=
"http://mycard.moe/"
></webview>
<webview
id=
"store"
src=
"http://mycard.moe/"
></webview>
<webview
id=
"ygopro"
src=
"http://mycard.moe/lobby/"
></webview>
<webview
id=
"ygopro"
src=
"http://mycard.moe/lobby/"
></webview>
...
...
js/app.js
View file @
edbcb343
...
@@ -45,6 +45,10 @@ for (let i = 0; i < webviews.length; i++) {
...
@@ -45,6 +45,10 @@ for (let i = 0; i < webviews.length; i++) {
webviews
.
item
(
i
).
addEventListener
(
'
new-window
'
,
(
event
)
=>
{
webviews
.
item
(
i
).
addEventListener
(
'
new-window
'
,
(
event
)
=>
{
require
(
'
electron
'
).
shell
.
openExternal
(
event
.
url
);
require
(
'
electron
'
).
shell
.
openExternal
(
event
.
url
);
});
});
/*webviews.item(i).addEventListener('will-navigate', (event) => {
event.preventDefault()
});*/
}
}
document
.
getElementById
(
"
logout
"
).
onclick
=
()
=>
{
document
.
getElementById
(
"
logout
"
).
onclick
=
()
=>
{
...
@@ -52,6 +56,11 @@ document.getElementById("logout").onclick = ()=> {
...
@@ -52,6 +56,11 @@ document.getElementById("logout").onclick = ()=> {
location
.
reload
();
location
.
reload
();
})
})
};
};
document
.
getElementById
(
"
refresh
"
).
onclick
=
()
=>
{
current_window
.
webContents
.
session
.
clearCache
(()
=>
{
location
.
reload
();
})
};
let
elements
=
document
.
getElementsByClassName
(
'
profile
'
);
let
elements
=
document
.
getElementsByClassName
(
'
profile
'
);
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
...
...
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