Slight tweaks to demo app

This commit is contained in:
Joe Cheng
2012-06-21 18:27:32 -07:00
parent 586a67b025
commit 2990504c8b
4 changed files with 9 additions and 9 deletions

View File

@@ -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

View File

@@ -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
View File

@@ -0,0 +1,4 @@
body.disconnected {
background-color: #999;
opacity: 0.5;
}

View File

@@ -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