Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyTimer
Title: Customizable Timer for 'shiny' Applications
Version: 0.1.0.9001
Version: 0.1.0.9002
Authors@R:
person("Maciej", "Banas", email = "banasmaciek@gmail.com", role = c("aut", "cre"))
Description: Provides a customizable timer widget for 'shiny' applications. Key
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# shinyTimer (development version)

* Renamed `background` parameter to `frame` to better reflect its purpose. Added `fill` parameter to pass colors to the background of the `shinyTimer` ([#60](https://github.com/maciekbanas/shinyTimer/issues/60)).
* Added new feedback value (text content of the timer) returned after pausing `shinyTimer` (#63). It can be accessed via `input$shinytimer_content`.
* Renamed `background` parameter to `frame` to better reflect its purpose. Added `fill` parameter to pass colors to the background of the `shinyTimer` (#60).

# shinyTimer 0.1.0

Expand Down
6 changes: 5 additions & 1 deletion inst/examples/shinymobile_timer_up.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ui <- shinyMobile::f7Page(
) |>
htmltools::tagAppendAttributes(
style="font-size:20px;"
)
),
shiny::textOutput("shinytimer_content_output")
)

)
Expand All @@ -55,6 +56,9 @@ server <- function(input, output, session) {
shiny::observeEvent(input$resume_timer, {
resetTimer("shiny_timer")
})
output$shinytimer_content_output <- shiny::renderText({
input$shinytimer_content
})
}

shinyApp(ui, server)
3 changes: 3 additions & 0 deletions inst/www/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ Shiny.addCustomMessageHandler('countUp', function(message) {
});

Shiny.addCustomMessageHandler('pauseTimer', function(message) {
const { inputId, start } = message;
clearInterval(timerInterval);
const timerElement = document.getElementById(inputId);
Shiny.setInputValue("shinytimer_content", timerElement.textContent)
});

Shiny.addCustomMessageHandler('resetTimer', function(message) {
Expand Down
Loading