Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Behira Younes
Commits
eecc7278
Commit
eecc7278
authored
4 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
added example calculation
parent
f1b29809
Pipeline
#1083
passed with stages
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.js
+11
-2
public/index.js
with
11 additions
and
2 deletions
+11
-2
public/index.js
+
11
-
2
View file @
eecc7278
...
...
@@ -101,13 +101,13 @@ function showFeedbackForm() {
// function readerLevelChangeEvent: listens for change in reader level dropdown
// and sets selected value to property readerLevel on inputObj
function
readerLevelChangeEvent
(
event
)
{
inputObj
.
readerLevel
=
event
.
target
.
value
;
inputObj
.
readerLevel
=
parseInt
(
event
.
target
.
value
)
;
}
// function readerCategoryChangeEvent: listens for change in reader category dropdown
// and sets selected value to property readerCategory on inputObj
function
readerCategoryChangeEvent
(
event
)
{
inputObj
.
readerCategory
=
event
.
target
.
value
;
inputObj
.
readerCategory
=
parseInt
(
event
.
target
.
value
)
;
}
...
...
@@ -127,6 +127,15 @@ function calculateReadingTime() {
// inputObj.readerLevel has level of reader (string data type)
// inputObj.readerCategory has category of reader (string data type)
// example calculation
x
=
(
inputObj
.
textLength
*
inputObj
.
readerLevel
*
inputObj
.
readerCategory
);
// set value to html element
var
s
=
document
.
getElementById
(
'
reading-time-element
'
);
s
.
innerHTML
=
x
;
// display html element which shows time
let
element
=
document
.
getElementById
(
'
calculate-time-element
'
);
element
.
style
.
display
=
"
block
"
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets