View mycode.js
// Execute function body when the HTML document is ready | |
$(document).ready(function() { | |
// javascript code to send data to shiny server | |
document.getElementById("mydiv").onclick = function() { | |
var number = Math.random(); | |
Shiny.onInputChange("mydata", number); | |
}; | |
View .block
license: mit |
View html2tagList.R
#'@title html2tagList | |
#'@description convert raw html to htmltools tagList | |
#'@param x character vector of html | |
#'@examples | |
#' | |
#'x<-'<h1>Title</h1> | |
#' <h2>Header text</h2> | |
#' <p>Text here</p> | |
#' <h1>Title</h1> | |
#' <h2>Header text</h2> |
View .block
license: mit |
View .block
license: mit |
View .block
license: mit |
View example_jstree_widget.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> |
View jstree_icon2.html
<div id="htmlwidget-9f0eb65ab1d8850629a1" style="width:960px;height:500px;" class="jsTree html-widget"></div> | |
<script type="application/json" data-for="htmlwidget-9f0eb65ab1d8850629a1">{"x":{"data":[{"text":"root","children":[{"text":".","children":[{"text":".git","children":[{"text":"branches","icon":"fa fa-file-o","state":[]},{"text":"hooks","icon":"fa fa-file-o","state":[]},{"text":"info","icon":"fa fa-file-o","state":[]},{"text":"logs","children":[{"text":"refs","children":[{"text":"heads","icon":"fa fa-file-o","state":[]},{"text":"remotes","children":[{"text":null,"icon":"fa fa-file-o","state":[]},{"text":"origin","icon":"fa fa-file-o","state":[]}]}]}]},{"text":"objects","children":[{"text":null,"icon":"fa fa-file-o","state":[]},{"text":"01","icon":"fa fa-file-o","state":[]},{"text":"04","icon":"fa fa-file-o","state":[]},{"text":"05","icon":"fa fa-file-o","state":[]},{"text":"06","icon":"fa fa-file-o","state":[]},{"text":"09","icon":"fa fa-file-o","state":[]},{"text":"0c","icon":"fa fa-file-o","state":[] |
View XMLHttpRequest.R
library(htmltools) | |
browsable( | |
tagList( | |
tags$pre(id="myPreview"), | |
tags$script( | |
' | |
var uri="https://raw.githubusercontent.com/yonicd/jsTree/master/README.md?raw=true"; | |
loadXMLDoc(uri); | |
View console_in_widget.R
library(htmltools) | |
browsable( | |
tagList( | |
tags$pre(id="myPreview"), | |
tags$script(" | |
var log = document.querySelector('#myPreview'); | |
['log','debug','info','warn','error'].forEach(function (verb) { | |
console[verb] = (function (method, verb, log) { | |
return function () { | |
method.apply(console, arguments); |
OlderNewer