Fix resources path when not running on a dedicated vhost

master
Daniel Berteaud 11 years ago
parent 5d6fd83712
commit 45a418b9c6
  1. 2
      public/vroom.pl
  2. 4
      templates/default/header.html.ep
  3. 14
      templates/default/index.html.ep
  4. 10
      templates/default/join.html.ep
  5. 2
      templates/default/js_common.html.ep
  6. 2
      templates/default/js_room.html.ep
  7. 4
      templates/default/public_toolbar.html.ep

@ -541,7 +541,7 @@ post '/create' => sub {
# and redirect him on it. # and redirect him on it.
else{ else{
$self->session($name => {role => 'owner'}); $self->session($name => {role => 'owner'});
$self->redirect_to($self->get_url('/') . $name); $self->redirect_to($name);
} }
}; };

@ -6,9 +6,9 @@
<% <%
foreach my $css (qw(bootstrap.min.css vroom.css)){ foreach my $css (qw(bootstrap.min.css vroom.css)){
%> %>
<link href="/<%= $self->get_mtime("css/$css") %>/css/<%= $css %>" rel="stylesheet" type="text/css"> <link href="<%= $self->get_url('/') %><%= $self->get_mtime("css/$css") %>/css/<%= $css %>" rel="stylesheet" type="text/css">
<% } %> <% } %>
<link rel="icon" type="image/png" href="/img/favicon.png" /> <link rel="icon" type="image/png" href="<%= $self->get_url('/') %>img/favicon.png" />
</head> </head>
<body> <body>
<div id="wrap"> <div id="wrap">

@ -47,7 +47,7 @@
</ol> </ol>
<div id="carouselIndexContent" class="carousel-inner"> <div id="carouselIndexContent" class="carousel-inner">
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/lock.png" alt="<%=l 'SECURE' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/lock.png" alt="<%=l 'SECURE' %>">
<p> <p>
<%=l 'P2P_COMMUNICATION' %> <%=l 'P2P_COMMUNICATION' %>
</p> </p>
@ -58,7 +58,7 @@
</div> </div>
</div> </div>
<div class="item active carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item active carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/universal.png" alt="<%=l 'WORKS_EVERYWHERE' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/universal.png" alt="<%=l 'WORKS_EVERYWHERE' %>">
<p> <p>
<%=l 'MODERN_BROWSERS' %> <%=l 'MODERN_BROWSERS' %>
</p> </p>
@ -69,7 +69,7 @@
</div> </div>
</div> </div>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/share.png" alt="<%=l 'MULTI_USER' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/share.png" alt="<%=l 'MULTI_USER' %>">
<p> <p>
<%=l 'THE_LIMIT_IS_YOUR_PIPE' %> <%=l 'THE_LIMIT_IS_YOUR_PIPE' %>
</p> </p>
@ -80,7 +80,7 @@
</div> </div>
</div> </div>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/signin.png" alt="<%=l 'NO_SIGNIN' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/signin.png" alt="<%=l 'NO_SIGNIN' %>">
<p> <p>
<%=l 'YOU_DONT_HAVE_TO_REGISTER' %> <%=l 'YOU_DONT_HAVE_TO_REGISTER' %>
</p> </p>
@ -91,7 +91,7 @@
</div> </div>
</div> </div>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/clock.png" alt="<%=l 'QUICK' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/clock.png" alt="<%=l 'QUICK' %>">
<p> <p>
<%=l 'STOP_WASTING_TIME' %> <%=l 'STOP_WASTING_TIME' %>
</p> </p>
@ -102,7 +102,7 @@
</div> </div>
</div> </div>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/screen.png" alt="<%=l 'SCREEN_SHARING' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/screen.png" alt="<%=l 'SCREEN_SHARING' %>">
<p> <p>
<%=l 'SHARE_DESKTOP_OR_WINDOW' %> <%=l 'SHARE_DESKTOP_OR_WINDOW' %>
</p> </p>
@ -113,7 +113,7 @@
</div> </div>
</div> </div>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
<img class="img-responsive carouselLogo" src="/img/chat.png" alt="<%=l 'TEXT_CHAT' %>"> <img class="img-responsive carouselLogo" src="<%= $self->get_url('/') %>img/chat.png" alt="<%=l 'TEXT_CHAT' %>">
<p> <p>
<%=l 'SECURED_TEXT_CHAT' %> <%=l 'SECURED_TEXT_CHAT' %>
</p> </p>

@ -272,21 +272,21 @@
<div class="col-sm-4"> <div class="col-sm-4">
<a href="http://www.mozilla.org/firefox/" target="_blank"> <a href="http://www.mozilla.org/firefox/" target="_blank">
<center> <center>
<img src="/img/firefox.png" alt="Mozilla Firefox"/> <img src="<%= $self->get_url('/') %>img/firefox.png" alt="Mozilla Firefox"/>
</center> </center>
</a> </a>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<a href="http://www.google.com/chrome/" target="_blank"> <a href="http://www.google.com/chrome/" target="_blank">
<center> <center>
<img src="/img/chrome.png" alt="Google Chrome"/> <img src="<%= $self->get_url('/') %>img/chrome.png" alt="Google Chrome"/>
</center> </center>
</a> </a>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<a href="http://www.opera.com" target="_blank"> <a href="http://www.opera.com" target="_blank">
<center> <center>
<img src="/img/opera.png" alt="Opera"/> <img src="<%= $self->get_url('/') %>img/opera.png" alt="Opera"/>
</center> </center>
</a> </a>
</div> </div>
@ -305,7 +305,7 @@
<div class="modal-body"> <div class="modal-body">
<p><%=l 'CANT_ACCESS_WEBCAM' %></p> <p><%=l 'CANT_ACCESS_WEBCAM' %></p>
<center> <center>
<img src="/img/webcam.png" alt="Webcam"/> <img src="<%= $self->get_url('/') %>img/webcam.png" alt="Webcam"/>
</center> </center>
</div> </div>
</div> </div>
@ -331,7 +331,7 @@
</div> </div>
</form> </form>
</div> </div>
<audio id="mohPlayer" src="/snd/moh/<%= $moh %>" loop></audio> <audio id="mohPlayer" src="<%= $self->get_url('/') %>snd/moh/<%= $moh %>" loop></audio>
<div id="view" class="view row-fluid"> <div id="view" class="view row-fluid">
<div id="webRTCVideo" class="col-xs-12 col-sm-4"> <div id="webRTCVideo" class="col-xs-12 col-sm-4">
<div class="col-xs-6 col-sm-12 col-lg-6 previewContainer" id="videoLocalContainer"> <div class="col-xs-6 col-sm-12 col-lg-6 previewContainer" id="videoLocalContainer">

@ -3,5 +3,5 @@
</script> </script>
<% foreach my $js (qw(jquery-1.11.1.min.js bootstrap.min.js notify-combined.min.js vroom.js)){ <% foreach my $js (qw(jquery-1.11.1.min.js bootstrap.min.js notify-combined.min.js vroom.js)){
%> %>
<script type="text/javascript" src="/<%= $self->get_mtime("js/$js") %>/js/<%= $js %>"></script> <script type="text/javascript" src="<%= $self->get_url('/') %><%= $self->get_mtime("js/$js") %>/js/<%= $js %>"></script>
<% } %> <% } %>

@ -1,5 +1,5 @@
<% <%
foreach my $js (qw(simplewebrtc.bundle.js jquery.browser.min.js sprintf.js FileSaver.js)){ foreach my $js (qw(simplewebrtc.bundle.js jquery.browser.min.js sprintf.js FileSaver.js)){
%> %>
<script type="text/javascript" src="/<%= $self->get_mtime("js/$js") %>/js/<%= $js %>"></script> <script type="text/javascript" src="<%= $self->get_url('/') %><%= $self->get_mtime("js/$js") %>/js/<%= $js %>"></script>
<% } %> <% } %>

@ -1,6 +1,6 @@
<nav class="navbar navbar-default" role="navigation"> <nav class="navbar navbar-default" role="navigation">
<a href="https://github.com/dani/vroom"> <a href="https://github.com/dani/vroom">
<img id="forkMeRibbon" src="/img/fork_me_on_gh.png" alt="Fork me on GitHub" class="hidden-xs"/> <img id="forkMeRibbon" src="<%= $self->get_url('/') %>img/fork_me_on_gh.png" alt="Fork me on GitHub" class="hidden-xs"/>
</a> </a>
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> <div class="navbar-header">
@ -10,7 +10,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<img id="navBarLogo" src="/img/logo_vroom_alpha.png" class="hidden-xs"/> <img id="navBarLogo" src="<%= $self->get_url('/') %>img/logo_vroom_alpha.png" class="hidden-xs"/>
</div> </div>
<div class="collapse navbar-collapse" id="toolBar"> <div class="collapse navbar-collapse" id="toolBar">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">

Loading…
Cancel
Save