Skip to content

Commit

Permalink
1.0.8.22
Browse files Browse the repository at this point in the history
  • Loading branch information
“rafal.urn” committed Aug 24, 2024
1 parent 8d8424e commit 1b378a2
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ShinyWizard/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ShinyWizard
Title: An Interactive Presentation of any R Package
Version: 1.0.4.89
Version: 1.0.8.22
Authors@R:
person("Rafal", "Urniaz", , "rafal.urniaz@cantab.net", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0192-2165"))
Expand Down
4 changes: 2 additions & 2 deletions ShinyWizard/R/ShinyWizzardTheme.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ShinyWizzardThemeSelector <- function() {
selected = "flatly", # starting theme
),

shiny::tags$script(
shiny::tags$script( # ---- TO-DO: rewrite
"$('#tab2-shinytheme-selector')
.on('change', function(el) {
var allThemes = $(this).find('option').map(function() {
Expand All @@ -64,7 +64,7 @@ ShinyWizzardThemeSelector <- function() {
// Set it to the correct path
$link.attr('href', curThemePath);
});"
)
),
)

}
Expand Down
2 changes: 1 addition & 1 deletion ShinyWizard/inst/source/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# --- App Titles ---
AppTitle: Shiny Wizard # when "" is not displayed !!!
AppSubTitle: 'NULL' # when "" is not displayed !!!
AppSubTitle: Design, build, deploy! # when "" is not displayed !!!
# --- CSS style ---
ShinyWizzardTheme: flatly
# --- Logo ---
Expand Down
1 change: 1 addition & 0 deletions ShinyWizard/inst/source/core/server/SaveAllTabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SaveAllTabs <- function(input, output, session, currentTabIndexes){
dir.create(tabs_dir_n, showWarnings = FALSE)
write_file(isolate(input[[paste0("ui",i)]]), paste0(tabs_dir_n, "/ui.R"))
write_file(isolate(input[[paste0("server",i)]]),paste0(tabs_dir_n, "/server.R"))
write_file(isolate(input[[paste0("config",i)]]),paste0(tabs_dir_n, "/config.yaml"))
})
}
}
16 changes: 13 additions & 3 deletions ShinyWizard/inst/source/core/server/load_config.yaml.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ load_config.yaml <- function(input, output, session){
temp_config <- yaml::yaml.load_file(paste0(config$TempProjPath,'config.yaml'))

# - Update original variables

shinyjs::alert(paste0(temp_config))


# Assign values to input
shinyjs::runjs(paste0("document.getElementById('tab2-AppTitleInput').value = '",temp_config$AppTitle,"'"))
shinyjs::runjs(paste0("document.getElementById('tab2-AppSubTitleInput').value = '",temp_config$AppSubTitle,"'"))
shinyjs::runjs(paste0("document.getElementById('tab2-LogoFilePathInput').value = '",temp_config$LogoFilePath,"'"))
shinyjs::runjs(paste0("document.getElementById('tab2-FooterTextInput').value = '",temp_config$FooterText,"'"))
shinyjs::runjs(paste0("document.getElementById('tab2-shinytheme-selector').value = '",temp_config$ShinyWizzardTheme,"'"))

# Assign values to text
shinyjs::runjs(paste0("document.getElementById('AppTitle').textContent = '",temp_config$AppTitle,"'"))
shinyjs::runjs(paste0("document.getElementById('AppSubTitle').textContent = '",temp_config$AppSubTitle,"'"))
shinyjs::runjs(paste0("document.getElementById('LogoFilePath').textContent = '",temp_config$LogoFilePath,"'"))
shinyjs::runjs(paste0("document.getElementById('FooterText').textContent = '",temp_config$FooterText,"'"))
shinyjs::runjs(paste0("document.getElementById('FooterText').textContent = '",temp_config$FooterText,"'"))

# Assign Theme
shinyjs::runjs(paste0("document.getElementById('tab2-shinytheme-selector').dispatchEvent(new Event('change'));"))


}


2 changes: 1 addition & 1 deletion ShinyWizard/inst/source/core/ui/GenFooter.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
GenFooter <- function(){

# Changing this part without written permission is a violation of the license.
HTML(paste0("<div style='position: fixed; padding: 10px 30px 10px 10px; bottom: 0; height: 30; width: 100%; background: inherited; text-align: right'>Created with <a href='https://github.com/urniaz/ShinyWizard' target='_blank'>ShinyWizard</a> © <div id ='FooterText'>", config$FooterText, "</div></div>"))
HTML(paste0("<div style='position: fixed; padding: 10px 30px 10px 10px; bottom: 0; height: 30; width: 100%; background: inherited; text-align: right'>Created with <a href='https://github.com/urniaz/ShinyWizard' target='_blank'>ShinyWizard</a> © ver.",packageVersion('ShinyWizard'),"<div id ='FooterText'>", config$FooterText, "</div></div>"))

}
2 changes: 1 addition & 1 deletion ShinyWizard/inst/source/core/ui/GenTitlePanel.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GenTitlePanel <- function(){
fluidRow(
column(11,
tags$div(id = "AppTitle", config$AppTitle),
tags$h5(id = "AppSubTitle", if (config$AppSubTitle == 'NULL'){paste("Ver.", packageVersion('ShinyWizard'))}else{config$AppSubTitl}) ),
tags$h5(id = "AppSubTitle", config$AppSubTitle)),
column(1,
img(id ="LogoFilePath", style="height: 60px; wigth:60px; float:right; vertical-align:middle", src = config$LogoFilePath))
))
Expand Down
7 changes: 5 additions & 2 deletions ShinyWizard/inst/source/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source("global.R")

# Define server logic required to draw a histogram
shinyServer(function(input, output, session) {

# Load server functions directory
sapply(paste0("core/server/",list.files("core/server")), source)

Expand All @@ -18,8 +18,11 @@ shinyServer(function(input, output, session) {

# Observe Events on Next Prev Buttons
observe_event_next_prev_buttons(input, output, session)




# Prevent reload page, reload destroys session
shinyjs::runjs("window.onbeforeunload = function() {return false; }") # 'For security reason page reload will destroy shiny session and kill the app. Continue?';}")

# onSessionEnded
session$onSessionEnded(function() { stopApp() })
Expand Down
1 change: 1 addition & 0 deletions ShinyWizard/inst/source/tabs/tab2/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ observeEvent(input$`shinytheme-selector`, { save_config.yaml(input, output, sess
print(input)



4 changes: 0 additions & 4 deletions ShinyWizard/inst/source/tabs/tab2/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
# ShowButtons: TRUE
# ButtonsAlignment: center

HTML('<h1>Welcome!</h1>
<p>If youre seeing this page, that means lncRna is installed and running. <strong>Congratulations!</strong> </p>
')

fluidPage(
fluidRow(align="center",

Expand Down
16 changes: 7 additions & 9 deletions ShinyWizard/inst/source/tabs/tab3/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ observeEvent(input$newTab, {
textAreaInput(inputId = paste0("tab3-config",tabIndex()),
label = paste("Tab ",tabIndex(), "config.yml"),
value = ' # --- Navigation ---
# TabName: Welcome
# TabIcon: home
# --- Next/Prev buttons
# ShowButtons: FALSE
# --- Info ---
# InfoTitle: tir
# InfoMessage: mes',
# TabName: Tab Name
# TabIcon: paper
# --- Next/Prev buttons
# ShowButtons: TRUE
# --- Info ---
# InfoTitle: Information
# InfoMessage: Some info text',
width = "100%",
height = "18vw",
resize = "both"),
Expand Down
2 changes: 1 addition & 1 deletion ShinyWizard/inst/source/tabs/tab4/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ fluidPage(
)
)

# ,verbatimTextOutput(outputId = ns("result")),
,verbatimTextOutput(outputId = ns("result")),

)
2 changes: 1 addition & 1 deletion ShinyWizard/inst/source/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shinyUI(fluidPage(
tags$script(src = "https://unpkg.com/sweetalert/dist/sweetalert.min.js"),

# Bootstrap??
# tags$script(src = 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"'),
# tags$script(src = 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js'),

# Use JS
useShinyjs(),
Expand Down

0 comments on commit 1b378a2

Please sign in to comment.