rstudio/shiny — pull request #660 by wch (2014-11-24 22:08:25+00:00)
Title: Allow running apps that have a body tag

This PR allows using UI's with a `body` tag. This is useful for some CSS templates that require having a class on the body tag. (Without this, CSS classes must be added via Javascript code.)

This PR also restructures the showcase mode code to be a bit more contained.

The following test apps result in the correct structure in and out of showcase mode.

```R
# UI without body tag
testapp <- shinyApp(
ui = bootstrapPage(
numericInput('n', 'Number of obs', 200),
plotOutput('plot')
),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
}
)

# UI with body tag
testapp_body <- shinyApp(
ui = tags$body(class = "foo", bootstrapPage(
numericInput('n', 'Number of obs', 200),
plotOutput('plot')
)),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
}
)

# Running the apps in normal and showcase mode
runApp(testapp)
runApp(testapp, display.mode = 'showcase')
runApp(testapp_body)
runApp(testapp_body, display.mode = 'showcase')
```