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
a0635812
Commit
a0635812
authored
Oct 14, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add body to button links, add performance to diagnostic
parent
68d69d4a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
27 deletions
+63
-27
public/src/css/main.css
public/src/css/main.css
+2
-1
public/src/js/about.js
public/src/js/about.js
+47
-23
public/src/js/canvastest.js
public/src/js/canvastest.js
+2
-1
public/src/js/loader.js
public/src/js/loader.js
+6
-1
public/src/js/main.js
public/src/js/main.js
+5
-0
public/src/views/about.html
public/src/views/about.html
+1
-1
No files found.
public/src/css/main.css
View file @
a0635812
...
@@ -209,7 +209,8 @@ kbd{
...
@@ -209,7 +209,8 @@ kbd{
#about-link-btns
.taibtn
{
#about-link-btns
.taibtn
{
margin-right
:
0.4em
;
margin-right
:
0.4em
;
}
}
#diag-txt
{
#diag-txt
textarea
,
#diag-txt
iframe
{
width
:
100%
;
width
:
100%
;
height
:
5em
;
height
:
5em
;
font-size
:
inherit
;
font-size
:
inherit
;
...
...
public/src/js/about.js
View file @
a0635812
class
About
{
class
About
{
constructor
(
touchEnabled
){
constructor
(
touchEnabled
){
this
.
issueTemplate
=
"
###### Describe the problem you are having below. Please include a screenshot and the diagnostic information.
"
this
.
touchEnabled
=
touchEnabled
this
.
touchEnabled
=
touchEnabled
loader
.
changePage
(
"
about
"
)
loader
.
changePage
(
"
about
"
)
cancelTouch
=
false
cancelTouch
=
false
...
@@ -14,8 +16,8 @@ class About{
...
@@ -14,8 +16,8 @@ class About{
this
.
linkGithub
=
document
.
getElementById
(
"
link-github
"
)
this
.
linkGithub
=
document
.
getElementById
(
"
link-github
"
)
this
.
linkEmail
=
document
.
getElementById
(
"
link-email
"
)
this
.
linkEmail
=
document
.
getElementById
(
"
link-email
"
)
pageEvents
.
add
(
this
.
linkGithub
,
[
"
click
"
,
"
touchend
"
],
this
.
linkButton
)
pageEvents
.
add
(
this
.
linkGithub
,
[
"
click
"
,
"
touchend
"
],
this
.
linkButton
.
bind
(
this
)
)
pageEvents
.
add
(
this
.
linkEmail
,
[
"
click
"
,
"
touchend
"
],
this
.
linkButton
)
pageEvents
.
add
(
this
.
linkEmail
,
[
"
click
"
,
"
touchend
"
],
this
.
linkButton
.
bind
(
this
)
)
pageEvents
.
once
(
this
.
endButton
,
[
"
mousedown
"
,
"
touchstart
"
]).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
once
(
this
.
endButton
,
[
"
mousedown
"
,
"
touchstart
"
]).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
keyOnce
(
this
,
13
,
"
down
"
).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
keyOnce
(
this
,
13
,
"
down
"
).
then
(
this
.
onEnd
.
bind
(
this
))
...
@@ -51,6 +53,8 @@ class About{
...
@@ -51,6 +53,8 @@ class About{
if
(
!
fullScreenSupported
){
if
(
!
fullScreenSupported
){
diag
.
push
(
"
Full screen supported: false
"
)
diag
.
push
(
"
Full screen supported: false
"
)
}
}
diag
.
push
(
"
Blur performance:
"
+
perf
.
blur
+
"
ms, all images:
"
+
perf
.
allImg
+
"
ms
"
)
diag
.
push
(
"
Page load:
"
+
(
perf
.
load
/
1000
).
toFixed
(
1
)
+
"
s
"
)
if
(
"
getGamepads
"
in
navigator
){
if
(
"
getGamepads
"
in
navigator
){
var
gamepads
=
navigator
.
getGamepads
()
var
gamepads
=
navigator
.
getGamepads
()
for
(
var
i
=
0
;
i
<
gamepads
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
gamepads
.
length
;
i
++
){
...
@@ -78,32 +82,48 @@ class About{
...
@@ -78,32 +82,48 @@ class About{
}
}
}
}
diag
.
push
(
"
```
"
)
diag
.
push
(
"
```
"
)
var
diag
=
diag
.
join
(
"
\n
"
)
var
body
=
this
.
diagTxt
.
contentWindow
.
document
.
body
if
(
navigator
.
userAgent
.
indexOf
(
"
Android
"
)
>=
0
){
body
.
innerText
=
diag
.
join
(
"
\n
"
)
var
iframe
=
document
.
createElement
(
"
iframe
"
)
this
.
diagTxt
.
appendChild
(
iframe
)
body
.
setAttribute
(
"
style
"
,
`
var
body
=
iframe
.
contentWindow
.
document
.
body
font-family: monospace;
body
.
innerText
=
diag
margin: 2px 0 0 2px;
white-space: pre-wrap;
body
.
setAttribute
(
"
style
"
,
`
word-break: break-all;
font-family: monospace;
cursor: text;
margin: 2px 0 0 2px;
`
)
white-space: pre-wrap;
body
.
setAttribute
(
"
onblur
"
,
`
word-break: break-all;
getSelection().removeAllRanges()
cursor: text;
`
)
if
(
!
this
.
touchEnabled
){
body
.
setAttribute
(
"
onfocus
"
,
`
var selection = getSelection()
selection.removeAllRanges()
var range = document.createRange()
range.selectNodeContents(document.body)
selection.addRange(range)
`
)
`
)
body
.
setAttribute
(
"
onblur
"
,
`
getSelection().removeAllRanges()
`
)
}
else
{
this
.
textarea
=
document
.
createElement
(
"
textarea
"
)
this
.
textarea
.
readOnly
=
true
this
.
textarea
.
value
=
diag
this
.
diagTxt
.
appendChild
(
this
.
textarea
)
if
(
!
this
.
touchEnabled
){
pageEvents
.
add
(
this
.
textarea
,
"
focus
"
,
()
=>
{
this
.
textarea
.
select
()
})
pageEvents
.
add
(
this
.
textarea
,
"
blur
"
,
()
=>
{
getSelection
().
removeAllRanges
()
})
}
}
}
var
issueBody
=
this
.
issueTemplate
+
"
\n\n\n\n
"
+
diag
this
.
getLink
(
this
.
linkGithub
).
href
+=
"
?body=
"
+
encodeURIComponent
(
issueBody
)
this
.
getLink
(
this
.
linkEmail
).
href
+=
"
?body=
"
+
encodeURIComponent
(
issueBody
.
replace
(
/
\n
/g
,
"
\r\n
"
))
}
getLink
(
target
){
return
target
.
getElementsByTagName
(
"
a
"
)[
0
]
}
}
linkButton
(
event
){
linkButton
(
event
){
event
.
currentTarget
.
getElementsByTagName
(
"
a
"
)[
0
]
.
click
()
this
.
getLink
(
event
.
currentTarget
)
.
click
()
}
}
clean
(){
clean
(){
cancelTouch
=
true
cancelTouch
=
true
...
@@ -111,6 +131,9 @@ class About{
...
@@ -111,6 +131,9 @@ class About{
pageEvents
.
remove
(
this
.
linkGithub
,
[
"
click
"
,
"
touchend
"
])
pageEvents
.
remove
(
this
.
linkGithub
,
[
"
click
"
,
"
touchend
"
])
pageEvents
.
remove
(
this
.
linkEmail
,
[
"
click
"
,
"
touchend
"
])
pageEvents
.
remove
(
this
.
linkEmail
,
[
"
click
"
,
"
touchend
"
])
pageEvents
.
remove
(
this
.
endButton
,
[
"
mousedown
"
,
"
touchstart
"
])
pageEvents
.
remove
(
this
.
endButton
,
[
"
mousedown
"
,
"
touchstart
"
])
if
(
this
.
textarea
){
pageEvents
.
remove
(
this
.
textarea
,
[
"
focus
"
,
"
blur
"
])
}
pageEvents
.
keyRemove
(
this
,
13
)
pageEvents
.
keyRemove
(
this
,
13
)
delete
this
.
endButton
delete
this
.
endButton
delete
this
.
diagTxt
delete
this
.
diagTxt
...
@@ -118,5 +141,6 @@ class About{
...
@@ -118,5 +141,6 @@ class About{
delete
this
.
tutorialOuter
delete
this
.
tutorialOuter
delete
this
.
linkGithub
delete
this
.
linkGithub
delete
this
.
linkEmail
delete
this
.
linkEmail
delete
this
.
textarea
}
}
}
}
public/src/js/canvastest.js
View file @
a0635812
...
@@ -91,6 +91,7 @@ class CanvasTest{
...
@@ -91,6 +91,7 @@ class CanvasTest{
drawAllImages
(){
drawAllImages
(){
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
requestAnimationFrame
(()
=>
{
requestAnimationFrame
(()
=>
{
var
startTime
=
+
new
Date
var
ctx
=
this
.
ctx
var
ctx
=
this
.
ctx
ctx
.
save
()
ctx
.
save
()
ctx
.
clearRect
(
0
,
0
,
this
.
canvas
.
width
,
this
.
canvas
.
height
)
ctx
.
clearRect
(
0
,
0
,
this
.
canvas
.
width
,
this
.
canvas
.
height
)
...
@@ -131,7 +132,7 @@ class CanvasTest{
...
@@ -131,7 +132,7 @@ class CanvasTest{
}
}
ctx
.
restore
()
ctx
.
restore
()
resolve
()
resolve
(
(
+
new
Date
)
-
startTime
)
})
})
})
})
}
}
...
...
public/src/js/loader.js
View file @
a0635812
...
@@ -5,6 +5,8 @@ class Loader{
...
@@ -5,6 +5,8 @@ class Loader{
this
.
assetsDiv
=
document
.
getElementById
(
"
assets
"
)
this
.
assetsDiv
=
document
.
getElementById
(
"
assets
"
)
this
.
canvasTest
=
new
CanvasTest
()
this
.
canvasTest
=
new
CanvasTest
()
p2
=
new
P2Connection
()
p2
=
new
P2Connection
()
this
.
startTime
=
+
new
Date
this
.
ajax
(
"
src/views/loader.html
"
).
then
(
this
.
run
.
bind
(
this
))
this
.
ajax
(
"
src/views/loader.html
"
).
then
(
this
.
run
.
bind
(
this
))
}
}
run
(
page
){
run
(
page
){
...
@@ -85,6 +87,7 @@ class Loader{
...
@@ -85,6 +87,7 @@ class Loader{
})
})
this
.
promises
.
push
(
this
.
canvasTest
.
blurPerformance
().
then
(
result
=>
{
this
.
promises
.
push
(
this
.
canvasTest
.
blurPerformance
().
then
(
result
=>
{
perf
.
blur
=
result
if
(
result
>
1000
/
50
){
if
(
result
>
1000
/
50
){
// Less than 50 fps with blur enabled
// Less than 50 fps with blur enabled
disableBlur
=
true
disableBlur
=
true
...
@@ -96,7 +99,9 @@ class Loader{
...
@@ -96,7 +99,9 @@ class Loader{
})
})
Promise
.
all
(
this
.
promises
).
then
(()
=>
{
Promise
.
all
(
this
.
promises
).
then
(()
=>
{
this
.
canvasTest
.
drawAllImages
().
then
(()
=>
{
this
.
canvasTest
.
drawAllImages
().
then
(
result
=>
{
perf
.
allImg
=
result
perf
.
load
=
(
+
new
Date
)
-
this
.
startTime
this
.
canvasTest
.
clean
()
this
.
canvasTest
.
clean
()
this
.
clean
()
this
.
clean
()
this
.
callback
()
this
.
callback
()
...
...
public/src/js/main.js
View file @
a0635812
...
@@ -49,6 +49,11 @@ var p2
...
@@ -49,6 +49,11 @@ var p2
var
disableBlur
=
false
var
disableBlur
=
false
var
cancelTouch
=
true
var
cancelTouch
=
true
var
lastHeight
var
lastHeight
var
perf
=
{
blur
:
0
,
allImg
:
0
,
load
:
0
}
pageEvents
.
add
(
root
,
[
"
touchstart
"
,
"
touchmove
"
,
"
touchend
"
],
event
=>
{
pageEvents
.
add
(
root
,
[
"
touchstart
"
,
"
touchmove
"
,
"
touchend
"
],
event
=>
{
if
(
event
.
cancelable
&&
cancelTouch
){
if
(
event
.
cancelable
&&
cancelTouch
){
...
...
public/src/views/about.html
View file @
a0635812
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<span
class=
"text-warn"
>
Be sure to include the following diagnostic data!
</span>
<span
class=
"text-warn"
>
Be sure to include the following diagnostic data!
</span>
</div>
</div>
<
iframe
id=
"diag-txt"
></iframe
>
<
div
id=
"diag-txt"
></div
>
<div
id=
"about-link-btns"
>
<div
id=
"about-link-btns"
>
<div
id=
"link-github"
class=
"taibtn stroke-sub link-btn"
alt=
"GitHub"
>
<div
id=
"link-github"
class=
"taibtn stroke-sub link-btn"
alt=
"GitHub"
>
<a
href=
"https://github.com/bui/taiko-web/issues/new"
target=
"_blank"
>
GitHub
</a>
<a
href=
"https://github.com/bui/taiko-web/issues/new"
target=
"_blank"
>
GitHub
</a>
...
...
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