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
7f5b1e97
Commit
7f5b1e97
authored
Dec 03, 2018
by
Bui
Committed by
GitHub
Dec 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #88 from LoveEevee/about-descriptive-errors
About: Descriptive errors
parents
a0197e76
51f306d1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
14 deletions
+34
-14
public/src/js/canvasdraw.js
public/src/js/canvasdraw.js
+10
-3
public/src/js/loader.js
public/src/js/loader.js
+2
-1
public/src/js/loadsong.js
public/src/js/loadsong.js
+8
-6
public/src/js/main.js
public/src/js/main.js
+5
-1
public/src/js/pageevents.js
public/src/js/pageevents.js
+7
-3
public/src/js/soundbuffer.js
public/src/js/soundbuffer.js
+2
-0
No files found.
public/src/js/canvasdraw.js
View file @
7f5b1e97
...
...
@@ -295,9 +295,11 @@
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
h
:
39
,
rotate
:
true
})
}
else
if
(
symbol
===
"
↓
"
){
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
12
,
h
:
45
})
}
else
if
(
symbol
===
"
.
"
){
drawn
.
push
({
realText
:
symbol
,
text
:
"
.
"
,
x
:
13
,
y
:
-
7
,
h
:
15
,
scale
:
[
1.2
,
0.7
]})
}
else
if
(
r
.
comma
.
test
(
symbol
)){
// Comma, full stop
drawn
.
push
({
text
:
symbol
,
x
:
13
,
y
:
-
9
,
h
:
13
,
scale
:
[
1.2
,
0.7
]})
drawn
.
push
({
text
:
symbol
,
x
:
13
,
y
:
-
7
,
h
:
15
,
scale
:
[
1.2
,
0.7
]})
}
else
if
(
r
.
ideographicComma
.
test
(
symbol
)){
// Ideographic comma, full stop
drawn
.
push
({
text
:
symbol
,
x
:
16
,
y
:
-
16
,
h
:
18
})
...
...
@@ -538,7 +540,7 @@
let
symbol
=
string
[
i
]
if
(
symbol
===
"
-
"
){
drawn
.
push
({
text
:
symbol
,
x
:
-
2
,
y
:
0
,
w
:
28
,
scale
:
[
0.8
,
1
]
})
drawn
.
push
({
text
:
symbol
,
x
:
-
2
,
y
:
0
,
w
:
28
})
}
else
if
(
symbol
===
"
™
"
){
drawn
.
push
({
text
:
symbol
,
x
:
-
2
,
y
:
0
,
w
:
20
,
scale
:
[
0.6
,
0.5
]})
}
else
if
(
symbol
===
"
"
){
...
...
@@ -547,9 +549,11 @@
drawn
.
push
({
text
:
"
,
"
,
x
:
0
,
y
:
-
15
,
w
:
7
,
scale
:
[
1
,
0.7
]})
}
else
if
(
symbol
===
"
∀
"
){
drawn
.
push
({
text
:
symbol
,
x
:
-
3
,
y
:
0
,
w
:
55
})
}
else
if
(
symbol
===
"
.
"
){
drawn
.
push
({
text
:
symbol
,
x
:
-
9
,
y
:
0
,
w
:
37
})
}
else
if
(
r
.
comma
.
test
(
symbol
)){
// Comma, full stop
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
13
})
drawn
.
push
({
text
:
symbol
,
x
:
-
3
,
y
:
13
,
w
:
13
,
scale
:
[
1.2
,
0.7
]
})
}
else
if
(
r
.
en
.
test
(
symbol
)){
// n-width
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
28
})
...
...
@@ -671,6 +675,9 @@
ctx
.
save
()
ctx
.
translate
(
currentX
,
currentY
)
if
(
symbol
.
scale
){
if
(
config
.
baseline
===
"
middle
"
){
ctx
.
translate
(
0
,
-
ctx
.
lineWidth
*
(
2
/
symbol
.
scale
[
1
]))
}
ctx
.
scale
(
symbol
.
scale
[
0
],
symbol
.
scale
[
1
])
ctx
.
lineWidth
/=
symbol
.
scale
[
0
]
}
...
...
public/src/js/loader.js
View file @
7f5b1e97
...
...
@@ -151,7 +151,8 @@ class Loader{
getFilename
(
name
){
return
name
.
slice
(
0
,
name
.
lastIndexOf
(
"
.
"
))
}
errorMsg
(){
errorMsg
(
error
){
console
.
error
(
error
)
this
.
error
=
true
this
.
loaderPercentage
.
appendChild
(
document
.
createElement
(
"
br
"
))
this
.
loaderPercentage
.
appendChild
(
document
.
createTextNode
(
"
An error occurred, please refresh
"
))
...
...
public/src/js/loadsong.js
View file @
7f5b1e97
...
...
@@ -90,6 +90,10 @@ class loadSong{
this
.
setupMultiplayer
()
},
error
=>
{
console
.
error
(
error
)
if
(
Array
.
isArray
(
error
)
&&
error
[
1
]
instanceof
HTMLElement
){
error
=
error
[
0
]
+
"
:
"
+
error
[
1
].
outerHTML
}
errorMessage
(
new
Error
(
error
).
stack
)
alert
(
"
An error occurred, please refresh
"
)
})
}
...
...
@@ -194,13 +198,11 @@ class loadSong{
if
(
event
.
value
===
song
.
difficulty
){
this
.
startMultiplayer
()
}
else
{
this
.
selectedSong2
=
{
title
:
song
.
title
,
folder
:
song
.
folder
,
difficulty
:
event
.
value
,
type
:
song
.
type
,
offset
:
song
.
offset
this
.
selectedSong2
=
{}
for
(
var
i
in
this
.
selectedSong
){
this
.
selectedSong2
[
i
]
=
this
.
selectedSong
[
i
]
}
this
.
selectedSong2
.
difficulty
=
event
.
value
if
(
song
.
type
===
"
tja
"
){
this
.
startMultiplayer
()
}
else
{
...
...
public/src/js/main.js
View file @
7f5b1e97
...
...
@@ -5,11 +5,15 @@ addEventListener("error", function(err){
}
else
{
stack
=
err
.
message
+
"
\n
at
"
+
err
.
filename
+
"
:
"
+
err
.
lineno
+
"
:
"
+
err
.
colno
}
errorMessage
(
stack
)
})
function
errorMessage
(
stack
){
localStorage
[
"
lastError
"
]
=
JSON
.
stringify
({
timestamp
:
+
new
Date
,
stack
:
stack
})
}
)
}
function
toggleFullscreen
(){
if
(
"
requestFullscreen
"
in
root
){
...
...
public/src/js/pageevents.js
View file @
7f5b1e97
...
...
@@ -68,10 +68,14 @@ class PageEvents{
load
(
target
){
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
race
(
target
,
"
load
"
,
"
error
"
,
"
abort
"
).
then
(
response
=>
{
if
(
response
.
type
===
"
load
"
){
switch
(
response
.
type
){
case
"
load
"
:
return
resolve
(
response
.
event
)
case
"
error
"
:
return
reject
([
"
Loading error
"
,
target
])
case
"
abort
"
:
return
reject
(
"
Loading aborted
"
)
}
return
reject
()
})
})
}
...
...
public/src/js/soundbuffer.js
View file @
7f5b1e97
...
...
@@ -10,6 +10,8 @@
}).
then
(
response
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
this
.
context
.
decodeAudioData
(
response
,
resolve
,
reject
)
}).
catch
(
error
=>
{
throw
[
error
,
url
]
})
}).
then
(
buffer
=>
{
return
new
Sound
(
gain
||
{
soundBuffer
:
this
},
buffer
)
...
...
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