Add character count as you type

Text messages have a maximum length, which we tell the users. We
shouldn’t expect people to count the characters in the message
themselves.

This commit borrows [the word counter from the Digital Marketplace
frontend toolkit](9d17690de5/toolkit/javascripts/word-counter.js)
and adapts it to count characters instead.

Things I’m still not sure about with this:

- what should it say when the message goes over the length of one text
  message
- what’s the interaction with placeholders, which will change the length
  of the message

This commit also adds a line to the pricing page which explains that
service name counts towards the length of the message.
This commit is contained in:
Chris Hill-Scott
2016-06-16 17:04:53 +01:00
parent 3fa0e3aa66
commit fbc4abf85d
7 changed files with 79 additions and 12 deletions

View File

@@ -61,6 +61,7 @@ gulp.task('javascripts', () => gulp
paths.src + 'javascripts/updateContent.js',
paths.src + 'javascripts/expandCollapse.js',
paths.src + 'javascripts/placeholderHint.js',
paths.src + 'javascripts/characterCount.js',
paths.src + 'javascripts/main.js'
])
.pipe(plugins.babel({