Commit 52b7ebf3 authored by Ryan Herbert's avatar Ryan Herbert Committed by Mathieu Giraud

slash-separated url params

force all link and images to work from URI root, and replace the dash in
the sample_set-config parameters with a slash. Also force url.js
pushState to work from URI root.
parent 9ce2fef5
......@@ -26,15 +26,15 @@
<link rel="shortcut icon" href="./images/favicon-v.ico" type="image/x-icon">
<link rel="icon" href="./images/favicon-v.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/fonts/ubuntu/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/fonts/ubuntu-mono/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/icons/fontello/css/fontello.css" />
<link rel="stylesheet" type="text/css" href="css/icons/fontello/css/animation.css" />
<link id="palette" rel="stylesheet" type="text/css" href="css/light.css" />
<link id="seg_highlight" rel="stylesheet" type="text/css" href="css/segmenter_highlight.css" />
<link rel="stylesheet" href="css/jstree_themes/default/style.min.css" />
<link rel="stylesheet" type="text/css" href="/css/fonts/ubuntu/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="/css/fonts/ubuntu-mono/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="/css/icons/fontello/css/fontello.css" />
<link rel="stylesheet" type="text/css" href="/css/icons/fontello/css/animation.css" />
<link id="palette" rel="stylesheet" type="text/css" href="/css/light.css" />
<link id="seg_highlight" rel="stylesheet" type="text/css" href="/css/segmenter_highlight.css" />
<link rel="stylesheet" href="/css/jstree_themes/default/style.min.css" />
<script data-main="js/app.js" src="js/lib/require.js"></script>
<script data-main="/js/app.js" src="/js/lib/require.js"></script>
</head>
......@@ -296,7 +296,7 @@
</div>
<div style="float: right; margin: 5px;" id='live-ajax'>
<div class="active-container">
<img src="images/ajax-loader.gif" />
<img src="/images/ajax-loader.gif" />
</div>
</div>
......
requirejs.config({
baseUrl: 'js/lib',
baseUrl: '/js/lib',
paths: {
app: '',
jquery: 'jquery-2.1.1.min'
......
......@@ -147,7 +147,7 @@ Url.prototype= {
}
}
var positionnal_params = url.pathname.substr(1).split('-');
var positionnal_params = url.pathname.substr(1).split('/');
var pos_param_keys = this.getPositionnalParams();
for (var j = 0; j < positionnal_params.length; j++) {
params[pos_param_keys[j]] = positionnal_params[j];
......@@ -176,11 +176,11 @@ Url.prototype= {
}
}
}
return positionnal_params.join('-') + '?' + params_list.join("&");
return positionnal_params.join('/') + '?' + params_list.join("&");
},
pushUrl: function(params) {
var new_url = params;
var new_url = "/" + params;
this.window.history.pushState('plop', 'plop', new_url);
},
......
......@@ -26,7 +26,7 @@ server {
uwsgi_max_temp_file_size 20480m;
location / {
rewrite /([0-9]+)-([0-9]+) /?set=$1&conf=$2 break;
rewrite /([0-9]+)/([0-9]+)(/+) /?set=$1&conf=$2 break;
root /usr/share/vidjil;
expires 1h;
add_header Cache-Control must-revalidate;
......
......@@ -96,7 +96,7 @@ server {
uwsgi_temp_path /mnt/data/tmp;
location / {
rewrite /([0-9]+)/([0-9]+) /?set=$1&conf=$2 break;
rewrite /([0-9]+)/([0-9]+)(/+) /?set=$1&conf=$2 break;
root $CWD/../browser;
expires 1h;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment