rstudio/htmltools — pull request #18 by wch (2014-11-06 14:16:46+00:00)
Title: attachDependencies: add to dependencies instead of replacing

In the current version of htmltools, it's not possible to (easily) add additional dependencies without replacing all the existing ones. For example, if we start with a `bootstrapPage` and add a new dependency, the original dependency info gets removed:

```R
library(shiny)
library(htmltools)

p <- bootstrapPage(div("foo"))
str(findDependencies(p))
# List of 1
# $ :List of 8
# ..$ name : chr "bootstrap"
# ..$ version : chr "3.3.0"
# ..$ src :List of 2
# .. ..$ href: chr "shared/bootstrap"
# .. ..$ file: chr "/Users/winston/R/3.1/shiny/www/shared/bootstrap"
# ..$ meta : NULL
# ..$ script : chr "js/bootstrap.min.js"
# ..$ stylesheet: chr "css/bootstrap.min.css"
# ..$ head : NULL
# ..$ attachment: NULL
# ..- attr(*, "class")= chr "html_dependency"

dep <- htmlDependency("dep", "1.0", "/path")
p <- attachDependencies(p, dep)
str(findDependencies(p))
# List of 1
# $ :List of 8
# ..$ name : chr "dep"
# ..$ version : chr "1.0"
# ..$ src :List of 1
# .. ..$ file: chr "/path"
# ..$ meta : NULL
# ..$ script : NULL
# ..$ stylesheet: NULL
# ..$ head : NULL
# ..$ attachment: NULL
# ..- attr(*, "class")= chr "html_dependency"
```

This PR modifiies `attachDependencies` so that it always adds dependencies. If you guys think this should be done a different way, let me know.