mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-09 15:08:04 -05:00
Slight tweaks to demo app
This commit is contained in:
3
shiny.rb
3
shiny.rb
@@ -61,6 +61,8 @@ class WebServer < EM::Connection
|
||||
'text/html'
|
||||
when /\.js$/
|
||||
'text/javascript'
|
||||
when /\.css$/
|
||||
'text/css'
|
||||
when /\.png$/
|
||||
'image/png'
|
||||
when /\.jpg$/
|
||||
@@ -77,6 +79,7 @@ end
|
||||
def run_shiny_app(shinyapp)
|
||||
EventMachine.run do
|
||||
EventMachine.start_server '0.0.0.0', 8100, WebServer
|
||||
puts "Listening on port 8100"
|
||||
|
||||
EventMachine::WebSocket.start(:host => '0.0.0.0', :port => 8101) do |ws|
|
||||
shinyapp.websocket = ws
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
<head>
|
||||
<script src="jquery-1.7.2.js" type="text/javascript"></script>
|
||||
<script src="shiny.js" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
body.disconnected {
|
||||
background-color: #999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="shiny.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Example 1: Echo</h1>
|
||||
<h1>Example 1: Hash Calculation</h1>
|
||||
|
||||
<p>
|
||||
<label>Input:</label><br />
|
||||
|
||||
4
www/shiny.css
Normal file
4
www/shiny.css
Normal file
@@ -0,0 +1,4 @@
|
||||
body.disconnected {
|
||||
background-color: #999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
var socket = new WebSocket('ws://' + window.location.hostname + ':8101/events');
|
||||
socket.onopen = function() {
|
||||
console.log('connected to websocket');
|
||||
|
||||
socket.send(JSON.stringify({
|
||||
method: 'init',
|
||||
data: self.$initialInput
|
||||
|
||||
Reference in New Issue
Block a user