Commit 43db8d90 authored by Ryan Herbert's avatar Ryan Herbert Committed by marc duez

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.

(replayed by @magiraud from 52b7ebf3)
parent b3a1b4be
......@@ -26,16 +26,17 @@
<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 rel="stylesheet" href="css/vmi/vmi.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>
<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 rel="stylesheet" href="/css/vmi/vmi.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>
</head>
......@@ -320,7 +321,11 @@
+Need to be registered or create a specific account.">bugtracker</a>
<a class="buttonSelector devel-mode" onclick="my_tips.reset()">reset tips of the day</a>
</div></div>
<div style="float: right; margin: 5px;" id='live-ajax'>
<div class="active-container">
<img src="/images/ajax-loader.gif" />
</div>
</div>
<div class="menu" id="alert"></div>
......
var DEFAULT_DB_ADDRESS="https://db.vidjil.org/vidjil/";
requirejs.config({
baseUrl: 'js/lib',
baseUrl: '/js/lib',
paths: {
app: '',
jquery: 'jquery-3.3.1.min',
......
......@@ -126,7 +126,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];
......@@ -155,11 +155,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;
try {
this.window.history.pushState('plop', 'plop', new_url);
} catch(error) {
......
......@@ -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