Skip to content

Commit

Permalink
🪲 fix code regression disallowing remotely hosted JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Patrick Kyle committed Mar 11, 2019
1 parent 5ae036e commit 0080ba0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ render_dependencies <- function(dependencies, local = TRUE, prefix=NULL) {
dep_path <- gsub("//+",
"/",
dep_path)
)

full_path <- system.file(dep_path,
package = dep$package)
Expand All @@ -177,13 +176,17 @@ render_dependencies <- function(dependencies, local = TRUE, prefix=NULL) {
# until we are able to provide full support for debug mode,
# as in Dash for Python
if ("script" %in% names(dep) && tools::file_ext(dep[["script"]]) != "map") {
dep[["script"]] <- paste0(prefix,
"_dash-component-suites/",
dep$name,
"/",
basename(dep[["script"]]),
sprintf("?v=%s&m=%s", dep$version, modified))
html <- sprintf("<script src=\"%s\"></script>", dep[["script"]])
if !(is.null(dep$src$href)) {
html <- sprintf("<script src=\"%s\"></script>", dep$src$href)
} else {
dep[["script"]] <- paste0(prefix,
"_dash-component-suites/",
dep$name,
"/",
basename(dep[["script"]]),
sprintf("?v=%s&m=%s", dep$version, modified))
html <- sprintf("<script src=\"%s\"></script>", dep[["script"]])
}
} else if ("stylesheet" %in% names(dep) & src == "href") {
html <- sprintf("<link href=\"%s\" rel=\"stylesheet\" />", paste(dep[["src"]][["href"]],
dep[["stylesheet"]],
Expand Down

0 comments on commit 0080ba0

Please # to comment.