Browse Source

Display fullname in clipboard icon

master
Maxime Wack 3 years ago
parent
commit
62ed05c165
2 changed files with 11 additions and 25 deletions
  1. +8
    -18
      server.R
  2. +3
    -7
      ui.R

+ 8
- 18
server.R View File

@@ -66,17 +66,13 @@ server <- shinyServer(function(input, output, session)
}
})

# Display node info
output$c_basecode <- renderText(v$c_basecode)

output$c_name <- renderText(v$c_name)

output$c_fullname <- renderText(v$c_fullname)

output$clip <- renderUI(rclipButton("clipbtn",
"",
str_replace_all(v$c_fullname, fixed("\\"), fixed("\\\\")), # with the button, escape chars are intrepeted so \\ have to be doubled
icon("clipboard"))
)
v$c_fullname,
str_replace_all(v$c_fullname, fixed("\\"), fixed("\\\\")), # with the button, escape chars are interpreted so \\ have to be doubled
icon("clipboard")))

# render a table with all node whose C_BASECODE match the one of the currently selected node
output$codes <- renderTable(
@@ -189,17 +185,11 @@ server <- shinyServer(function(input, output, session)
})

output$s_basecode <- renderText(v$s_basecode)

output$s_name <- renderText(v$s_name)

output$s_fullname <- renderText(v$s_fullname)

output$s_clip <- renderUI(
rclipButton("clipbtn",
"",
str_replace_all(v$s_fullname, fixed("\\"), fixed("\\\\")),
icon("clipboard"))
)
output$s_clip <- renderUI(rclipButton("clipbtn",
v$s_fullname,
str_replace_all(v$s_fullname, fixed("\\"), fixed("\\\\")),
icon("clipboard")))

observeEvent(input$perform_search,
{


+ 3
- 7
ui.R View File

@@ -18,9 +18,7 @@ ui <- shinyUI(navbarPage("Page",
h3("Selected"),
h4("C_NAME :"), textOutput('c_name'),
h4("C_BASECODE :"), textOutput('c_basecode'),
h4("C_FULLNAME : "),
div(style="display: inline-block;width:45px;", uiOutput("clip")),
div(style="display: inline-block;width: 80%;margin: 0 auto;", verbatimTextOutput('c_fullname')),
h4("C_FULLNAME : "), div(style="display: inline-block;width:45px;", uiOutput("clip")),
h4("Matching Codes : "), tableOutput("codes"))),
mainPanel(style = "top:70px;",
tabsetPanel(tabPanel("Tree",
@@ -34,7 +32,7 @@ ui <- shinyUI(navbarPage("Page",
animation=F,
types = cssTypes)))))),
tabPanel("Search",
sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;",
sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;overflow-y:scroll;max-height: 600px;margin-right:20px",
textInput(inputId = "text_to_search",
label = "Search Text",
value = "hyp(o|er)gly"),
@@ -53,9 +51,7 @@ ui <- shinyUI(navbarPage("Page",
h3("Selected :"),
h4("C_NAME :"), textOutput('s_name'),
h4("C_BASECODE :"), textOutput('s_basecode'),
h4("C_FULLNAME :"),
div(style="display: inline-block;width:45px;", uiOutput("s_clip")),
div(style="display: inline-block;width: 80%;margin: 0 auto;", verbatimTextOutput('s_fullname')))),
h4("C_FULLNAME :"), div(style="display: inline-block;width:45px;", uiOutput("s_clip")))),
mainPanel(style = "top:70px;",
useShinyjs(),
rclipboardSetup(),


Loading…
Cancel
Save