Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
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
nanahira
Taiko Web
Commits
ad62ac80
Commit
ad62ac80
authored
Mar 13, 2020
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some bug fixes
parent
92947169
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
41 deletions
+86
-41
app.py
app.py
+1
-1
public/src/js/account.js
public/src/js/account.js
+15
-11
public/src/js/scorestorage.js
public/src/js/scorestorage.js
+8
-1
public/src/js/strings.js
public/src/js/strings.js
+40
-4
public/src/js/view.js
public/src/js/view.js
+22
-24
No files found.
app.py
View file @
ad62ac80
...
...
@@ -205,7 +205,7 @@ def route_api_register():
return
api_error
(
'username_in_use'
)
password
=
data
.
get
(
'password'
,
''
)
.
encode
(
'utf-8'
)
if
not
8
<=
len
(
password
)
<=
5000
:
if
not
6
<=
len
(
password
)
<=
5000
:
return
api_error
(
'invalid_password'
)
salt
=
bcrypt
.
gensalt
()
...
...
public/src/js/account.js
View file @
ad62ac80
...
...
@@ -256,7 +256,7 @@ class Account{
account
.
displayName
=
response
.
display_name
var
loadScores
=
scores
=>
{
scoreStorage
.
load
(
scores
)
this
.
onEnd
(
false
,
true
)
this
.
onEnd
(
false
,
true
,
true
)
pageEvents
.
send
(
"
login
"
,
account
.
username
)
}
if
(
this
.
mode
===
"
login
"
){
...
...
@@ -267,7 +267,7 @@ class Account{
})
}
else
{
scoreStorage
.
save
().
catch
(()
=>
{}).
finally
(()
=>
{
this
.
onEnd
(
false
,
true
)
this
.
onEnd
(
false
,
true
,
true
)
pageEvents
.
send
(
"
login
"
,
account
.
username
)
})
}
...
...
@@ -294,7 +294,7 @@ class Account{
delete
account
.
username
delete
account
.
displayName
var
loadScores
=
scores
=>
{
Cookies
.
remove
(
"
toke
n
"
)
Cookies
.
remove
(
"
sessio
n
"
)
scoreStorage
.
load
()
this
.
onEnd
(
false
,
true
)
pageEvents
.
send
(
"
logout
"
)
...
...
@@ -341,7 +341,7 @@ class Account{
account
.
loggedIn
=
false
delete
account
.
username
delete
account
.
displayName
Cookies
.
remove
(
"
toke
n
"
)
Cookies
.
remove
(
"
sessio
n
"
)
scoreStorage
.
load
()
pageEvents
.
send
(
"
logout
"
)
return
Promise
.
resolve
...
...
@@ -351,6 +351,8 @@ class Account{
if
(
!
noNameChange
&&
newName
!==
account
.
displayName
){
promises
.
push
(
this
.
request
(
"
account/display_name
"
,
{
display_name
:
newName
}).
then
(()
=>
{
account
.
displayName
=
newName
}))
}
var
error
=
false
...
...
@@ -368,7 +370,7 @@ class Account{
this
.
onEnd
(
false
,
true
)
},
errorFunc
).
catch
(
errorFunc
)
}
onEnd
(
event
,
noSound
){
onEnd
(
event
,
noSound
,
noReset
){
var
touched
=
false
if
(
event
){
if
(
event
.
type
===
"
touchstart
"
){
...
...
@@ -381,7 +383,7 @@ class Account{
if
(
this
.
locked
){
return
}
this
.
clean
()
this
.
clean
(
false
,
noReset
)
assets
.
sounds
[
"
se_don
"
].
play
()
setTimeout
(()
=>
{
new
SongSelect
(
false
,
false
,
touched
)
...
...
@@ -391,7 +393,7 @@ class Account{
this
.
lock
(
true
)
return
new
Promise
((
resolve
,
reject
)
=>
{
var
request
=
new
XMLHttpRequest
()
request
.
open
(
obj
?
"
POST
"
:
"
GE
T
"
,
"
api/
"
+
url
)
request
.
open
(
"
POS
T
"
,
"
api/
"
+
url
)
pageEvents
.
load
(
request
).
then
(()
=>
{
this
.
lock
(
false
)
if
(
request
.
status
!==
200
){
...
...
@@ -433,7 +435,7 @@ class Account{
}
}
}
clean
(
eventsOnly
){
clean
(
eventsOnly
,
noReset
){
if
(
!
eventsOnly
){
cancelTouch
=
true
this
.
keyboard
.
clean
()
...
...
@@ -447,8 +449,10 @@ class Account{
for
(
var
i
=
0
;
i
<
this
.
inputForms
.
length
;
i
++
){
pageEvents
.
remove
(
this
.
inputForms
[
i
],
[
"
keydown
"
,
"
keyup
"
,
"
keypress
"
])
}
this
.
accountPass
.
reset
()
this
.
accountDel
.
reset
()
if
(
!
noReset
){
this
.
accountPass
.
reset
()
this
.
accountDel
.
reset
()
}
delete
this
.
displayname
delete
this
.
accountPassButton
delete
this
.
accountPass
...
...
@@ -460,7 +464,7 @@ class Account{
delete
this
.
saveButton
delete
this
.
inputForms
}
else
if
(
this
.
mode
===
"
login
"
||
this
.
mode
===
"
register
"
){
if
(
!
eventsOnly
){
if
(
!
eventsOnly
&&
!
noReset
){
this
.
form
.
reset
()
}
pageEvents
.
remove
(
this
.
form
,
"
submit
"
)
...
...
public/src/js/scorestorage.js
View file @
ad62ac80
...
...
@@ -9,7 +9,7 @@ class ScoreStorage{
load
(
strings
){
this
.
scores
=
{}
if
(
strings
){
this
.
scoreStrings
=
strings
this
.
scoreStrings
=
this
.
prepareStrings
(
strings
)
}
else
if
(
account
.
loggedIn
){
return
}
else
{
...
...
@@ -58,6 +58,13 @@ class ScoreStorage{
}
return
output
}
prepareStrings
(
scores
){
var
output
=
{}
for
(
var
k
in
scores
){
output
[
scores
[
k
].
hash
]
=
scores
[
k
].
score
}
return
output
}
save
(
localOnly
){
for
(
var
hash
in
this
.
scores
){
this
.
writeString
(
hash
)
...
...
public/src/js/strings.js
View file @
ad62ac80
...
...
@@ -202,7 +202,16 @@
logout
:
"
ログアウト
"
,
back
:
"
もどる
"
,
cancel
:
"
Cancel
"
,
save
:
"
Save
"
save
:
"
Save
"
,
displayName
:
"
Displayed Name
"
,
changePassword
:
"
Change Password
"
,
currentNewRepeat
:
[
"
Current Password
"
,
"
New Password
"
,
"
Repeat New Password
"
],
deleteAccount
:
"
Delete Account
"
,
verifyPassword
:
"
Verify password to delete this account
"
}
this
.
browserSupport
=
{
browserWarning
:
"
サポートされていないブラウザを実行しています (%s)
"
,
...
...
@@ -645,7 +654,16 @@ function StringsCn(){
logout
:
"
登出
"
,
back
:
"
返回
"
,
cancel
:
"
Cancel
"
,
save
:
"
Save
"
save
:
"
Save
"
,
displayName
:
"
Displayed Name
"
,
changePassword
:
"
Change Password
"
,
currentNewRepeat
:
[
"
Current Password
"
,
"
New Password
"
,
"
Repeat New Password
"
],
deleteAccount
:
"
Delete Account
"
,
verifyPassword
:
"
Verify password to delete this account
"
}
this
.
browserSupport
=
{
browserWarning
:
"
You are running an unsupported browser (%s)
"
,
...
...
@@ -862,7 +880,16 @@ function StringsTw(){
logout
:
"
登出
"
,
back
:
"
返回
"
,
cancel
:
"
Cancel
"
,
save
:
"
Save
"
save
:
"
Save
"
,
displayName
:
"
Displayed Name
"
,
changePassword
:
"
Change Password
"
,
currentNewRepeat
:
[
"
Current Password
"
,
"
New Password
"
,
"
Repeat New Password
"
],
deleteAccount
:
"
Delete Account
"
,
verifyPassword
:
"
Verify password to delete this account
"
}
this
.
browserSupport
=
{
browserWarning
:
"
You are running an unsupported browser (%s)
"
,
...
...
@@ -1079,7 +1106,16 @@ function StringsKo(){
logout
:
"
로그 아웃
"
,
back
:
"
돌아간다
"
,
cancel
:
"
Cancel
"
,
save
:
"
Save
"
save
:
"
Save
"
,
displayName
:
"
Displayed Name
"
,
changePassword
:
"
Change Password
"
,
currentNewRepeat
:
[
"
Current Password
"
,
"
New Password
"
,
"
Repeat New Password
"
],
deleteAccount
:
"
Delete Account
"
,
verifyPassword
:
"
Verify password to delete this account
"
}
this
.
browserSupport
=
{
browserWarning
:
"
You are running an unsupported browser (%s)
"
,
...
...
public/src/js/view.js
View file @
ad62ac80
...
...
@@ -394,31 +394,29 @@
h
:
130
}
if
(
this
.
multiplayer
!==
2
){
this
.
nameplateCache
.
get
({
this
.
nameplateCache
.
get
({
ctx
:
ctx
,
x
:
167
,
y
:
this
.
multiplayer
===
2
?
565
:
160
,
w
:
219
,
h
:
53
,
id
:
"
1p
"
,
},
ctx
=>
{
if
(
this
.
multiplayer
===
2
){
var
name
=
p2
.
name
||
strings
.
defaultName
}
else
{
var
name
=
account
.
loggedIn
?
account
.
displayName
:
strings
.
defaultName
}
this
.
draw
.
nameplate
({
ctx
:
ctx
,
x
:
167
,
y
:
160
,
w
:
219
,
h
:
53
,
id
:
"
1p
"
,
},
ctx
=>
{
if
(
this
.
multiplayer
===
2
){
var
name
=
p2
.
name
||
strings
.
defaultName
}
else
{
var
name
=
account
.
loggedIn
?
account
.
displayName
:
strings
.
defaultName
}
this
.
draw
.
nameplate
({
ctx
:
ctx
,
x
:
3
,
y
:
3
,
scale
:
0.8
,
name
:
name
,
font
:
this
.
font
,
blue
:
this
.
multiplayer
===
2
})
x
:
3
,
y
:
3
,
scale
:
0.8
,
name
:
name
,
font
:
this
.
font
,
blue
:
this
.
multiplayer
===
2
})
}
}
)
ctx
.
fillStyle
=
"
#000
"
ctx
.
fillRect
(
...
...
@@ -582,7 +580,7 @@
this
.
nameplateCache
.
get
({
ctx
:
ctx
,
x
:
320
,
y
:
this
.
multiplayer
===
2
?
frameTop
+
305
:
frameTop
+
20
,
y
:
this
.
multiplayer
===
2
?
460
:
20
,
w
:
273
,
h
:
66
,
id
:
"
1p
"
,
...
...
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