Skip to content

Commit

Permalink
Minor updates to keep the code base up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
RLumSK committed Jan 18, 2022
1 parent ac2d7a3 commit bbeaf19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
24 changes: 11 additions & 13 deletions chooser.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## 'chooser.R' taken from the shiny-examples repository (https://github.com/rstudio/shiny-examples) under the MIT License
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


chooserInput <- function(inputId, leftLabel, rightLabel, leftChoices, rightChoices,
size = 5, multiple = FALSE) {

Expand All @@ -16,22 +14,22 @@ chooserInput <- function(inputId, leftLabel, rightLabel, leftChoices, rightChoic

tagList(
singleton(tags$head(
tags$script(src="chooser-binding.js"),
tags$style(type="text/css",
tags$script(src = "chooser-binding.js"),
tags$style(type = "text/css",
HTML(".chooser-container { display: inline-block; }")
)
)),
div(id=inputId, class="chooser",
div(class="chooser-container chooser-left-container",
tags$select(class="left", size=size, multiple=multiple, leftChoices)
div(id = inputId, class = "chooser",
div(class = "chooser-container chooser-left-container",
tags$select(class = "left", size = size, multiple = multiple, leftChoices)
),
div(class="chooser-container chooser-center-container",
icon("arrow-circle-o-right", "right-arrow fa-3x"),
div(class = "chooser-container chooser-center-container",
icon("fas fa-arrow-alt-circle-right", "right-arrow fa-3x"),
tags$br(),
icon("arrow-circle-o-left", "left-arrow fa-3x")
icon("fas fa-arrow-alt-circle-left", "left-arrow fa-3x")
),
div(class="chooser-container chooser-right-container",
tags$select(class="right", size=size, multiple=multiple, rightChoices)
div(class = "chooser-container chooser-right-container",
tags$select(class = "right", size = size, multiple = multiple, rightChoices)
)
)
)
Expand All @@ -41,5 +39,5 @@ registerInputHandler("shinyjsexamples.chooser", function(data, ...) {
if (is.null(data))
NULL
else
list(left=as.character(data$left), right=as.character(data$right))
list(left = as.character(data$left), right = as.character(data$right))
}, force = TRUE)
4 changes: 2 additions & 2 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ require(readxl)
source("chooser.R")

##check whether a real database exists or the template should be loaded
if(dir.exists("Data")){
if (dir.exists("Data")) {
##set to first file
database_path <- list.files("Data/", full.names = TRUE)[1]

##check whether this is a real XLSX file
if(rev(strsplit(database_path, split = ".", fixed = TRUE)[[1]])[1] != "xlsx"){
if (rev(strsplit(database_path, split = ".", fixed = TRUE)[[1]])[1] != "xlsx") {
stop("The filter database file needs to be of type 'xlsx'!")

}
Expand Down
1 change: 0 additions & 1 deletion server.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ shinyServer(function(input, output, session) {
output$filters <- renderUI({

if(!is.null(input$own_file)){

##rename file in path
file.rename(
from = input$own_file$datapath,
Expand Down

0 comments on commit bbeaf19

Please sign in to comment.