Homework 3 Review Goal: Recreate Twitter UI to Post a tweet HTML: - - PowerPoint PPT Presentation

homework 3 review goal recreate twitter ui to post a
SMART_READER_LITE
LIVE PREVIEW

Homework 3 Review Goal: Recreate Twitter UI to Post a tweet HTML: - - PowerPoint PPT Presentation

Homework 3 Review Goal: Recreate Twitter UI to Post a tweet HTML: Why do I have the tweet_length_feedback div? JS: What does this do? Line 97 attaches a keypress event listener to the textarea What does this do? Why is this a good next


slide-1
SLIDE 1

Homework 3 Review

slide-2
SLIDE 2

Goal: Recreate Twitter UI to Post a tweet

slide-3
SLIDE 3

HTML: Why do I have the tweet_length_feedback div?

slide-4
SLIDE 4

JS: What does this do?

Line 97 attaches a “keypress” event listener to the textarea

slide-5
SLIDE 5

What does this do? Why is this a good next step?

It allows us to check if line 98 does what we expect. Does it?

slide-6
SLIDE 6

Not quite. What might be the problem?

What should we try to fix?

slide-7
SLIDE 7

Keyup event seems better. Does it work?

Now what?

slide-8
SLIDE 8

Display the characters left

Now what?

slide-9
SLIDE 9

Turn negative characters red. Like this?

Now what?

slide-10
SLIDE 10

Add a class

Now what?

slide-11
SLIDE 11

Next - remove the class. When?

slide-12
SLIDE 12

What next? DO THIS

slide-13
SLIDE 13

How do we start?

Add a click event listener (handler) to the post_tweet button

slide-14
SLIDE 14

What does create_post do?

slide-15
SLIDE 15

What else does it need to do?

  • a. When the user presses the “post tweet” button the

following things must happen:

  • i. The post must appear with the poster’s username

(not an image). The username can be hard coded in JavaScript (but not in HTML). The post text cannot be hard coded (obviously).

  • ii. New posts must appear at the top of the list of

posts, so that users see the latest tweets at the top

  • f the list.

iii.The text in the box where users write tweets must disappear. iv.The number that counts the number of characters remaining must return to the maximum number.

  • v. The cursor must return to the box where the user

writes tweets (so that they can immediately start writing another tweet!)

slide-16
SLIDE 16

After the text clears, then what?

  • a. When the user presses the “post tweet” button the

following things must happen:

  • i. The post must appear with the poster’s username

(not an image). The username can be hard coded in JavaScript (but not in HTML). The post text cannot be hard coded (obviously).

  • ii. New posts must appear at the top of the list of

posts, so that users see the latest tweets at the top

  • f the list.

iii.The text in the box where users write tweets must disappear. iv.The number that counts the number of characters remaining must return to the maximum number.

  • v. The cursor must return to the box where the user

writes tweets (so that they can immediately start writing another tweet!)

slide-17
SLIDE 17

After the tweet length = 30m then what?

  • a. When the user presses the “post tweet” button the

following things must happen:

  • i. The post must appear with the poster’s username

(not an image). The username can be hard coded in JavaScript (but not in HTML). The post text cannot be hard coded (obviously).

  • ii. New posts must appear at the top of the list of

posts, so that users see the latest tweets at the top

  • f the list.

iii.The text in the box where users write tweets must disappear. iv.The number that counts the number of characters remaining must return to the maximum number.

  • v. The cursor must return to the box where the user

writes tweets (so that they can immediately start writing another tweet!)

slide-18
SLIDE 18

There’s one more thing I do. Why?