1
0
mirror of https://github.com/dani/vroom.git synced 2024-06-02 05:21:39 +02:00

Define rootUrl in js_include

So /localize is working not matter which alias we use, even on the front page
This commit is contained in:
Daniel Berteaud 2014-05-07 12:48:50 +02:00
parent 1e2e524900
commit 4815e4cb83
3 changed files with 8 additions and 6 deletions

View File

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

View File

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

View File

@ -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/simplewebrtc.bundle.js"></script>
<script type="text/javascript" src="/js/jquery-1.11.1.min.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> <script type="text/javascript" src="/js/bootstrap.min.js"></script>