This commit is contained in:
Neil Matatall 2013-06-17 14:19:22 -07:00
parent 81fb8384cb
commit 3404a3340e
3 changed files with 12 additions and 9 deletions

1
js/live_reload_port.js Normal file
View File

@ -0,0 +1 @@
RACK_LIVERELOAD_PORT = document.getElementById('live_reload_options').getAttribute('data-live-reload-port');

6
js/swfoptions.js Normal file
View File

@ -0,0 +1,6 @@
WEB_SOCKET_SWF_LOCATION = document.getElementById('swf_options').getAttribute('data-web-socket-swf-location');
var forceSwf = document.getElementById('swf_options').getAttribute('data-force-swf');
if(forceSwf === 'true') {
WEB_SOCKET_FORCE_FLASH = true;
}

View File

@ -1,15 +1,11 @@
<% if with_swf? %> <% if with_swf? %>
<script type="text/javascript"> <span style="display: none" data-web-socket-swf-location="/__rack/WebSocketMain.swf" data-force-swf="<%=force_swf?%>" id="swf_options"></span>
WEB_SOCKET_SWF_LOCATION = "/__rack/WebSocketMain.swf"; <script type="text/javascript" src="<%= app_root %>/__rack/swfoptions.js"></script>
<% if force_swf? %>
WEB_SOCKET_FORCE_FLASH = true;
<% end %>
</script>
<script type="text/javascript" src="<%= app_root %>/__rack/swfobject.js"></script> <script type="text/javascript" src="<%= app_root %>/__rack/swfobject.js"></script>
<script type="text/javascript" src="<%= app_root %>/__rack/web_socket.js"></script> <script type="text/javascript" src="<%= app_root %>/__rack/web_socket.js"></script>
<% end %> <% end %>
<script type="text/javascript">
RACK_LIVERELOAD_PORT = <%= @options[:live_reload_port] %>; <span style="display: none" data-live-reload-port="<%= @options[:live_reload_port] %>" id="live_reload_options"></span>
</script> <script type="text/javascript" src="<%= app_root %>/__rack/live_reload_port.js"></script>
<script type="text/javascript" src="<%= livereload_source %>"></script> <script type="text/javascript" src="<%= livereload_source %>"></script>