This is Part 1 of creating Real Time Commenting System Element.
Real Time Threaded comments allow readers to reply to other comments inline/nested which encourages better discussion and responses. View the Element
Before moving forward, go through the Code and Comment down all the 10 steps discussed in How to Read the Code.
This Forum Post will cover Step 5 onwards.
Step 5
WiX Elements:
1 Text (#heading)
1 Repeater (#commentsRepeater)
1 Input Box (#commentInput)
1 Button (#sendBtn)
1 Container Box (#inputBox)
Note: The id of Elements is mentioned in brackets with #
Step 6
Global Variables:
toCommentOn
Step 7
Functions:
onReady
heading_click
sendBtn_click
commentInput
fillRepeater
Step 8
onReady
When #heading is clicked heading_click() is called
When #sendBtn is clicked sendBtn_click() is called
When #comment is clicked commentInput is clicked
fillRepeater() is called

fillRepeater()
fills the data in the #repeater

heading_click()
updates toCommentOn variable
expands #inputBox
update the placeholder text of #commentInput

sendBtn_click()
gets the #repeater data in commentData variable
create new object for new comment entered
update repeater data

commentInput
get the id of clicked item from repeater
get the comment of clicked item
update placeholder of #commentInput

- Priyanka Verma