Commit 9a31568d authored by Leo Iannacone's avatar Leo Iannacone

use PATHS instead of single path variables

parent f9cab02a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
socket.on('distributions', function(distributions) { socket.on('distributions', function(distributions) {
$('#distributions ul').html(''); $('#distributions ul').html('');
distributions.forEach(function (name){ distributions.forEach(function (name){
$('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ DISTRIBUTION_PAGE + '#'+ name + '">' + name + '</li>'); $('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ PATHS.distribution + '#'+ name + '">' + name + '</li>');
}); });
}); });
...@@ -18,7 +18,7 @@ socket.on('status-update', function(data) { ...@@ -18,7 +18,7 @@ socket.on('status-update', function(data) {
console.log(data) console.log(data)
}) })
if (window.location.pathname == DISTRIBUTION_PAGE) { if (window.location.pathname == PATHS.distribution) {
function __check_hash_makes_sense() { function __check_hash_makes_sense() {
if (! window.location.hash) if (! window.location.hash)
......
...@@ -8,7 +8,7 @@ var Page_Distrubion = { ...@@ -8,7 +8,7 @@ var Page_Distrubion = {
if (Utils.check_data_file(data)) { if (Utils.check_data_file(data)) {
complete_name = data.package.orig_name + '.' + data.file.name complete_name = data.package.orig_name + '.' + data.file.name
if (! data.file.path) if (! data.file.path)
data.file.path = DEBOMATIC_STATIC + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name data.file.path = PATHS.debomatic + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name
label = complete_name + ' \ label = complete_name + ' \
<a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\ <a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\
<span class="glyphicon glyphicon-download-alt"></span>\ <span class="glyphicon glyphicon-download-alt"></span>\
......
...@@ -44,9 +44,8 @@ ...@@ -44,9 +44,8 @@
<script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script> <script>
var DEBOMATIC_STATIC = '<%= paths.debomatic %>' var PATHS = <%- JSON.stringify(paths) %>
var AUTOSCROLL = <%= autoscroll %> var AUTOSCROLL = <%= autoscroll %>
var DISTRIBUTION_PAGE = '<%= paths.distribution %>'
var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>' var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>'
var socket = io.connect('//' + HOSTNAME); var socket = io.connect('//' + HOSTNAME);
</script> </script>
......
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