Commit aaabe195 authored by Leo Iannacone's avatar Leo Iannacone

use config.web properly for web interface

parent 25c5caec
......@@ -2,7 +2,7 @@
socket.on('distributions', function(distributions) {
$('#distributions ul').html('');
distributions.forEach(function (name){
$('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ PATHS.distribution + '#'+ name + '">' + name + '</li>');
$('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ config.paths.distribution + '#'+ name + '">' + name + '</li>');
});
});
......@@ -18,6 +18,6 @@ socket.on('status-update', function(data) {
console.log(data)
})
if (window.location.pathname == PATHS.distribution) {
if (window.location.pathname == config.paths.distribution) {
new Page_Distrubion().init(socket)
}
......@@ -17,7 +17,7 @@ function Page_Distrubion()
if (Utils.check_data_file(data)) {
var complete_name = data.package.orig_name + '.' + data.file.name
if (! data.file.path)
data.file.path = PATHS.debomatic + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name
data.file.path = config.paths.debomatic + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name
label = complete_name + ' \
<a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\
<span class="glyphicon glyphicon-download-alt"></span>\
......@@ -142,7 +142,7 @@ function Page_Distrubion()
var new_html = $("#file pre").html() + data.file.new_content
$("#file pre").html(new_html)
if (AUTOSCROLL) // scroll down
if (config.autoscroll) // scroll down
$('body,html').animate({ scrollTop: $('#file pre').height() }, 500);
},
get: function() {
......
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= title %></title>
<title><%= web.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css">
......@@ -12,8 +12,8 @@
<div id="wrapper" class="container-fluid">
<header id="header" onclick="window.location.href='/'">
<h1><%= title %></h1>
<p class="lead"><%= description %></p>
<h1><%= web.title %></h1>
<p class="lead"><%= web.description %></p>
</header>
<nav id="distributions" class="navbar navbar-inverse" role="navigation">
......@@ -31,7 +31,7 @@
<footer class="container-fluid">
<small class="copyright pull-right text-muted">
<%= footer %>
<%= web.footer %>
</small>
<div id="status" class="clearfix">
<span>status:</span> <span class="idle text-muted">Idle</span>
......@@ -44,10 +44,8 @@
<script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script>
var PATHS = <%- JSON.stringify(paths) %>
var AUTOSCROLL = <%= autoscroll %>
var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>'
var socket = io.connect('//' + HOSTNAME);
var config = <%- JSON.stringify(web) %>
var socket = io.connect('//' + config.hostname );
</script>
<script src='/javascripts/utils.js'></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