-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage.R
65 lines (61 loc) · 1.17 KB
/
page.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# INTERNAL
#' @importFrom htmltools htmlDependency HTML
w3_dependency <- function() {
htmlDependency(
"w3CSS",
"4.13",
src = system.file(package = "w3css"),
stylesheet = c(
"w3.css"
),
script = "srcjs/handlers.js",
meta = list(
charset = "UTF-8"
),
head = HTML(
'<meta name="viewport" content="width=device-width, initial-scale=1">'
)
)
}
#' @importFrom htmltools htmlDependency
jquery_dependency <- function() {
htmlDependency(
"jquery",
"3.5.1",
src = system.file(package = "w3css"),
script = "jquery-3.5.1.min.js"
)
}
#' @importFrom htmltools htmlDependency
input_binding <- function() {
htmlDependency(
"w3js",
"0.1.0",
src = system.file("srcjs", package = "w3css"),
script = list.files(
pattern = "input-",
system.file("srcjs", package = "w3css")
)
)
}
#' W3 CSS Page
#'
#' @param ... Content of the page
#'
#' @return A shiny UI using W3.CSS
#' @export
#'
#' @importFrom htmltools tagList
#'
#' @examples
#' w3_page("hey there")
w3_page <- function(...) {
tagList(
w3_dependency(),
jquery_dependency(),
input_binding(),
tagList(
...
)
)
}