Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

34 lines
781B

  1. library(shiny)
  2. options(scipen = 1e3)
  3. typingSpeedInput <- function(inputId, label, placeholder = NULL) {
  4. .label <- label
  5. htmltools::withTags(
  6. div(
  7. class = "form-group typing-speed",
  8. label(class = "control-label", `for` = inputId, .label),
  9. textarea(id = inputId, class = "form-control", placeholder = placeholder),
  10. htmltools::htmlDependency(
  11. name = "typingSpeed",
  12. version = "0.0.1",
  13. src = ".",
  14. script = "typing.js",
  15. all_files = FALSE
  16. )
  17. )
  18. )
  19. }
  20. ui <- fluidPage(
  21. # textAreaInput("typing", "Type here..."),
  22. typingSpeedInput("typing", "Type here..."),
  23. verbatimTextOutput("debug")
  24. )
  25. server <- function(input, output, session) {
  26. output$debug <- renderPrint(input$typing)
  27. }
  28. shinyApp(ui, server)