From 5b9a1426b88d40f7640b21eed58d3b5da824478d Mon Sep 17 00:00:00 2001 From: Ogan Mancarci Date: Sat, 24 Feb 2018 17:29:32 -0800 Subject: [PATCH] spellSource works properly --- R/functions.R | 5 ++++- inst/app/global.R | 6 ++++-- inst/app/modules.R | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) 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()