Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
85932844
Commit
85932844
authored
Sep 14, 2022
by
Daniel Bawag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WG-30 - Added pause function for kph timer
parent
a65a8e7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
index.html
Web-GDE/index.html
+4
-0
captureMetrics.js
Web-GDE/src/captureMetrics/captureMetrics.js
+21
-2
style.css
Web-GDE/style.css
+10
-0
No files found.
Web-GDE/index.html
View file @
85932844
...
...
@@ -46,6 +46,10 @@
</aside> -->
<!-- Space for the fields -->
<!-- <div class="sidebar" id="fields"> </div> -->
<div
id=
'pauseBtn'
>
<button
id=
'pause'
>
Pause
</button>
</div>
<form
id=
'fields'
style=
"display: flex; flex-direction:column;"
onsubmit=
"return submitForm(event);"
></form>
</aside>
<!-- Embed viewer -->
...
...
Web-GDE/src/captureMetrics/captureMetrics.js
View file @
85932844
let
key_strokes
=
0
let
time_spent
=
0
let
time_start
=
0
let
time_pause
=
0
let
time_pause_spent
=
0
const
conflicts
=
[
'F'
,
'f'
,
'alphabet'
,
'alphanumeric'
]
const
shift_shortcuts
=
[
'+'
,
'_'
,
'ArrowLeft'
,
'ArrowRight'
,
'f'
,
'F'
]
...
...
@@ -13,7 +15,8 @@ const startMetricCapture = () => {
// reset key strokes
key_strokes
=
0
time_start
=
Date
.
now
()
time_pause_spent
=
0
console
.
log
(
`Metric Capture Started
Key strokes:
${
key_strokes
}
Start of encoding time:
${
time_start
}
...
...
@@ -47,7 +50,13 @@ const startMetricCapture = () => {
key_strokes
++
console
.
log
(
`key:
${
key
.
key
}
; key_strokes:
${
key_strokes
}
; time_spent:
${(
Date
.
now
()
-
time_start
)
/
1000
}
`
)
// for demonstration purposes
console
.
log
(
`key:
${
key
.
key
}
; key_strokes:
${
key_strokes
}
; time_spent:
${((
Date
.
now
()
-
time_start
)
/
1000
)
-
time_pause_spent
}
`
)
// for demonstration purposes
}
window
.
onclick
=
(
event
)
=>
{
if
(
event
.
path
[
0
].
id
==
'pause'
)
{
pauseMetricCapture
();
}
}
}
...
...
@@ -61,4 +70,13 @@ const stopMetricCapture = () => {
time_spent
,
rate
}
const
pauseMetricCapture
=
()
=>
{
time_pause
=
Date
.
now
();
alert
(
"PAUSED"
);
unpauseMetricCapture
();
}
const
unpauseMetricCapture
=
()
=>
{
time_pause_spent
+=
(
Date
.
now
()
-
time_pause
)
/
1000
;
time_pause
=
0
;
}
\ No newline at end of file
Web-GDE/style.css
View file @
85932844
...
...
@@ -112,6 +112,16 @@ main#viewer {
align-items
:
center
;
}
#pauseBtn
{
background-color
:
peachpuff
;
}
#pause
{
width
:
calc
(
100%
-
40px
);
margin
:
20px
;
padding
:
10px
;
}
/* ADDED: added to adjust button container when window is resized */
@media
only
screen
and
(
max-width
:
1150px
)
{
#TiffViewer_ButtonContainer
{
...
...
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