-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f7558d
commit 8d4f29f
Showing
6 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ color_annotate <- function(gloss){ | |
} | ||
} | ||
|
||
#' Create audio play objects for html viewer | ||
#' Add audio objects for html viewer | ||
#' | ||
#' @author George Moroz <[email protected]> | ||
#' | ||
|
@@ -86,11 +86,28 @@ color_annotate <- function(gloss){ | |
#' @importFrom htmltools tags | ||
#' @return a string or vector of strings | ||
|
||
create_sound_play <- function(snd_src, text = "\u266A") { | ||
add_sound <- function(snd_src, text = "\u266A") { | ||
htmltools::tagList(htmltools::a( | ||
onmouseover = "lingglosses_resize(this, '150%')", | ||
onmouseout = "lingglosses_resize(this, '100%')", | ||
onclick = paste0("lingglosses_sound_play('", snd_src, "')"), | ||
text), | ||
htmltools::tags$script("function lingglosses_sound_play(x) {var audio = new Audio(); audio.src = x; audio.play();} function lingglosses_resize(elem, percent) {elem.style.fontSize = percent;}")) | ||
} | ||
|
||
#' Add video objects for html viewer | ||
#' | ||
#' @author George Moroz <[email protected]> | ||
#' | ||
#' @param vid_src string or vector of strings with a image(s) path(s). | ||
#' @noRd | ||
#' @importFrom htmltools tagList | ||
#' @importFrom htmltools tags | ||
#' @return a string or vector of strings | ||
|
||
add_video <- function(vid_src, width, height) { | ||
htmltools::tagList(htmltools::tags$video(src = vid_src, | ||
controls = TRUE, | ||
width=width, | ||
height=height)) | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.