|
|
|
|
|
|
|
|
if (is.null(context)) { |
|
|
if (is.null(context)) { |
|
|
context <- rstudioapi::getActiveDocumentContext() |
|
|
context <- rstudioapi::getActiveDocumentContext() |
|
|
} |
|
|
} |
|
|
|
|
|
initial_search <- if (nzchar(context$selection[[1]]$text)) { |
|
|
|
|
|
context$selection[[1]]$text |
|
|
|
|
|
} |
|
|
function(input, output, session) { |
|
|
function(input, output, session) { |
|
|
shiny::observeEvent(input$close, { |
|
|
shiny::observeEvent(input$close, { |
|
|
shiny::stopApp(invisible(input$emoji)) |
|
|
shiny::stopApp(invisible(input$emoji)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shiny::observe({ |
|
|
shiny::observe({ |
|
|
session$sendCustomMessage('update_picker_type', get_picker_type()) |
|
|
session$sendCustomMessage('update_picker_type', get_picker_type()) |
|
|
|
|
|
session$sendCustomMessage("search_emoji", initial_search) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
shiny::observeEvent(input$picker_type, { |
|
|
shiny::observeEvent(input$picker_type, { |