Skip to content

Commit

Permalink
spellSource works properly
Browse files Browse the repository at this point in the history
  • Loading branch information
oganm committed Feb 25, 2018
1 parent 858122c commit 5b9a142
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,...)

Expand Down
6 changes: 4 additions & 2 deletions inst/app/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
}

2 changes: 1 addition & 1 deletion inst/app/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5b9a142

Please sign in to comment.