|
|
|
|
|
|
|
|
#' @param ... Ignored at this time |
|
|
#' @param ... Ignored at this time |
|
|
#' @name ermoji |
|
|
#' @name ermoji |
|
|
#' @return nothing |
|
|
#' @return nothing |
|
|
|
|
|
#' @import shiny |
|
|
|
|
|
#' @import miniUI |
|
|
#' @export |
|
|
#' @export |
|
|
ermoji_gadget <- function(clipout = clipr::clipr_available(), ...) { |
|
|
ermoji_gadget <- function(clipout = clipr::clipr_available(), ...) { |
|
|
require(shiny) |
|
|
|
|
|
require(miniUI) |
|
|
|
|
|
runGadget(ermoji_ui, ermoji_server(clipout, ...), viewer = paneViewer(500), stopOnCancel = FALSE) |
|
|
runGadget(ermoji_ui, ermoji_server(clipout, ...), viewer = paneViewer(500), stopOnCancel = FALSE) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#' @rdname ermoji |
|
|
#' @rdname ermoji |
|
|
#' @export |
|
|
#' @export |
|
|
ermoji_shiny <- function(clipout = clipr::clipr_available(), ...) { |
|
|
ermoji_shiny <- function(clipout = clipr::clipr_available(), ...) { |
|
|
require(shiny) |
|
|
|
|
|
require(miniUI) |
|
|
|
|
|
shinyApp(ui = ermoji_ui, server = ermoji_server(clipout, ...)) |
|
|
shinyApp(ui = ermoji_ui, server = ermoji_server(clipout, ...)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output$emojis <- DT::renderDataTable({ |
|
|
output$emojis <- DT::renderDataTable({ |
|
|
emojis <- emo::jis |
|
|
emojis <- emo::jis |
|
|
emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")] |
|
|
emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")] |
|
|
emojis$keywords <- purrr::map_chr(emojis$keywords, ~ paste(., collapse = ", ")) |
|
|
|
|
|
emojis$aliases <- purrr::map_chr(emojis$aliases, ~ paste(., collapse = ", ")) |
|
|
|
|
|
|
|
|
emojis$keywords <- vapply(emojis$keywords, function(x) paste(x, collapse = ", "), character(1)) |
|
|
|
|
|
emojis$aliases <- vapply(emojis$aliases, function(x) paste(x, collapse = ", "), character(1)) |
|
|
DT::datatable( |
|
|
DT::datatable( |
|
|
emojis, |
|
|
emojis, |
|
|
rownames = FALSE, |
|
|
rownames = FALSE, |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this_emoji_html <- reactive({ |
|
|
this_emoji_html <- reactive({ |
|
|
gsub("([0-9A-F]{4,8}) ?", "&#x\\1;", this_emoji()$runes) |
|
|
|
|
|
|
|
|
rune2html(this_emoji()$runes) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
truncate <- function(x, n = 10) { |
|
|
truncate <- function(x, n = 10) { |
|
|
|
|
|
|
|
|
x = gsub('"', '"', x) |
|
|
x = gsub('"', '"', x) |
|
|
x |
|
|
x |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rune2html <- function(runes) { |
|
|
|
|
|
gsub("([0-9A-F]{4,8}) ?", "&#x\\1;", runes) |
|
|
|
|
|
} |