diff --git a/R/functions.R b/R/functions.R index cf88359..5dc77d9 100644 --- a/R/functions.R +++ b/R/functions.R @@ -10,7 +10,10 @@ shinySheet = function(char =getOption('defaultCharacter'),...,autoClose = FALSE, char = char %>% parse(text = .) %>% eval(envir = parent.frame()) } } - spellSource = spellSource + + .GlobalEnv$.sheetApp.spellSource <- spellSource + on.exit(rm(.sheetApp.spellSource, envir=.GlobalEnv)) + shinyDir = system.file('app',package = 'import5eChar') shiny::runApp(shinyDir,...) diff --git a/inst/app/global.R b/inst/app/global.R index 56aba9e..c52d175 100644 --- a/inst/app/global.R +++ b/inst/app/global.R @@ -22,12 +22,14 @@ if(!exists('char')){ helpLink = '' +options(ImTheWebClient= TRUE) + iconCredits = c('Lorc', 'Delapouite', 'Carl Olsen', 'Skoll') -if(!exists('spellSource')){ - spellSource = 'https://www.dndbeyond.com/spells/' +if(!exists('.sheetApp.spellSource')){ + .sheetApp.spellSource = 'https://www.dndbeyond.com/spells/' # spellSource = 'https://thebombzen.com/grimoire/spells/' } diff --git a/inst/app/modules.R b/inst/app/modules.R index b1f284e..50c3074 100644 --- a/inst/app/modules.R +++ b/inst/app/modules.R @@ -674,7 +674,7 @@ spells = function(input,output,session,char){ nameButtons = char$spells$name %>% sapply(function(x){ - a(href = paste0(spellSource, + a(href = paste0(.sheetApp.spellSource, x %>% tolower() %>% gsub(' |/','-',.) %>% gsub("'",'',.)), target= '_blank',x ) %>% as.character()