Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Behira Younes
Commits
044aab40
Commit
044aab40
authored
Oct 21, 2020
by
Ratnadeep Rajendra Kharade
Browse files
moved custom javascript code to index.js file
parent
7ddce195
Pipeline
#1074
passed with stages
in 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
044aab40
...
...
@@ -122,57 +122,9 @@
</section>
</section>
<script>
let
inputObj
=
{};
function
handleTextRadioClick
()
{
let
textChoice
=
document
.
querySelector
(
'
input[name="drone"]:checked
'
).
value
;
console
.
log
(
textChoice
);
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
manual-character-input
'
);
}
function
toggleElement
(
id
)
{
let
x
=
document
.
getElementById
(
id
);
if
(
x
.
style
.
display
===
"
none
"
)
{
x
.
style
.
display
=
"
block
"
;
}
else
{
x
.
style
.
display
=
"
none
"
;
}
}
function
handleTextAreaChange
()
{
let
value
=
document
.
getElementById
(
"
manual-text-entry
"
).
value
;
value
=
value
.
trim
();
let
characters
=
value
.
split
(
'
'
).
join
(
''
).
length
;
setCharacterLength
(
characters
);
document
.
getElementById
(
"
calculatedTextCharacters
"
).
setAttribute
(
'
value
'
,
characters
)
}
function
handleCharacterInputChange
()
{
let
value
=
document
.
getElementById
(
"
inputTextCharacters
"
).
value
;
setCharacterLength
(
value
);
}
function
setCharacterLength
(
characters
)
{
inputObj
.
characters
=
characters
;
console
.
log
(
'
Character length:
'
+
inputObj
.
characters
);
}
function
calculateReadingTime
()
{
let
x
=
document
.
getElementById
(
'
calculate-time-element
'
);
x
.
style
.
display
=
"
block
"
;
}
function
showFeedbackForm
()
{
let
x
=
document
.
getElementById
(
'
feedback-form
'
);
x
.
style
.
display
=
"
block
"
;
}
</script>
<!-- KEINE ÄNDERUNGEN NACH DIESER ZEILE -->
<script
src=
"settings.js"
>
</script>
<script
src=
"index.js"
>
</script>
</body>
</html>
\ No newline at end of file
public/index.js
0 → 100644
View file @
044aab40
let
inputObj
=
{};
function
handleTextRadioClick
()
{
let
textChoice
=
document
.
querySelector
(
'
input[name="drone"]:checked
'
).
value
;
console
.
log
(
textChoice
);
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
manual-character-input
'
);
}
function
toggleElement
(
id
)
{
let
x
=
document
.
getElementById
(
id
);
if
(
x
.
style
.
display
===
"
none
"
)
{
x
.
style
.
display
=
"
block
"
;
}
else
{
x
.
style
.
display
=
"
none
"
;
}
}
function
handleTextAreaChange
()
{
let
value
=
document
.
getElementById
(
"
manual-text-entry
"
).
value
;
value
=
value
.
trim
();
let
characters
=
value
.
split
(
'
'
).
join
(
''
).
length
;
setCharacterLength
(
characters
);
document
.
getElementById
(
"
calculatedTextCharacters
"
).
setAttribute
(
'
value
'
,
characters
)
}
function
handleCharacterInputChange
()
{
let
value
=
document
.
getElementById
(
"
inputTextCharacters
"
).
value
;
setCharacterLength
(
value
);
}
function
setCharacterLength
(
characters
)
{
inputObj
.
characters
=
characters
;
console
.
log
(
'
Character length:
'
+
inputObj
.
characters
);
}
function
calculateReadingTime
()
{
let
x
=
document
.
getElementById
(
'
calculate-time-element
'
);
x
.
style
.
display
=
"
block
"
;
}
function
showFeedbackForm
()
{
let
x
=
document
.
getElementById
(
'
feedback-form
'
);
x
.
style
.
display
=
"
block
"
;
}
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