Переглянути джерело

Update .getValue() - number of words entered

shiny-input
Garrick Aden-Buie 6 роки тому
джерело
коміт
e3fa485bb6
2 змінених файлів з 4 додано та 2 видалено
  1. +3
    -1
      inst/shiny-input-app/dev-shiny-input.Rmd
  2. +1
    -1
      inst/shiny-input-app/typing.js

+ 3
- 1
inst/shiny-input-app/dev-shiny-input.Rmd Переглянути файл



Update `.getValue()` to Update `.getValue()` to


1. Return the number of characters the user has typed
1. Return the number of characters the user has typed (`r github_sha_link("b3958d5e3f60fbac3a0100673696bd413a276fb4")`)

1. Return the number of words the user has entered

+ 1
- 1
inst/shiny-input-app/typing.js Переглянути файл

// your input. In this function, find or construct the value that will be // your input. In this function, find or construct the value that will be
// returned to Shiny. The ID of `el` is used for the inputId. // returned to Shiny. The ID of `el` is used for the inputId.


return el.value.length;
return el.value.split(' ').length;
}, },
setValue: function(el, value) { setValue: function(el, value) {
// This method is used for restoring the bookmarked state of your input // This method is used for restoring the bookmarked state of your input

Завантаження…
Відмінити
Зберегти