Define rootUrl in js_include

So /localize is working not matter which alias we use, even on the front page
master
Daniel Berteaud 11 years ago
parent 1e2e524900
commit 4815e4cb83
  1. 2
      public/js/vroom.js
  2. 5
      templates/default/join.html.ep
  3. 7
      templates/default/js_include.html.ep

@ -35,7 +35,7 @@ var locale = {
// Localize the strings we need
$.ajax({
url: '/localize',
url: rootUrl + 'localize',
type: 'POST',
dataType: 'json',
data: {

@ -162,11 +162,6 @@
</div>
%= include 'js_include'
<script>
<%
my $url = $self->url_for('/');
$url .= ($url =~ m/\/$/) ? '' : '/';
%>
var rootUrl = '<%= $url %>';
var roomName = '<%= $room %>';
$( document ).ready(function() {
webrtc = new SimpleWebRTC({

@ -1,3 +1,10 @@
<script type="text/javascript">
<%
my $url = $self->url_for('/');
$url .= ($url =~ m/\/$/) ? '' : '/';
%>
var rootUrl = '<%= $url %>';
</script>
<script type="text/javascript" src="/js/simplewebrtc.bundle.js"></script>
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>

Loading…
Cancel
Save