Commit 545fc36d authored by Leo Iannacone's avatar Leo Iannacone

start moving index to /distribution

parent c783290d
var socket = io.connect('//localhost:3000'); var socket = io.connect('//localhost:3000');
var old_data = Utils.from_hash_to_data()
socket.on('distributions', function(distributions) {
if (window.location.pathname == '/') {
var old_data = Utils.from_hash_to_data()
socket.on('distributions', function(distributions) {
Page_Distrubion.navbar.update(distributions) Page_Distrubion.navbar.update(distributions)
}); });
socket.on('distribution_packages', function(data){ socket.on('distribution_packages', function(data){
Page_Distrubion.packages.set(data) Page_Distrubion.packages.set(data)
}) })
socket.on('package_file_list', function(data){ socket.on('package_file_list', function(data){
Page_Distrubion.files.set(data) Page_Distrubion.files.set(data)
}) })
socket.on('file', function (data) { socket.on('file', function (data) {
Page_Distrubion.file.set(data) Page_Distrubion.file.set(data)
}) })
socket.on('file_newcontent', function(data) { socket.on('file_newcontent', function(data) {
Page_Distrubion.file.append(data) Page_Distrubion.file.append(data)
}) })
socket.on('error', function() { console.error(arguments) });
$(window).on('hashchange', function() { $(window).on('hashchange', function() {
data = Utils.from_hash_to_data() data = Utils.from_hash_to_data()
Page_Distrubion.update(data, old_data) Page_Distrubion.update(data, old_data)
old_data = data old_data = data
}); });
$(window).on('load', function (){ $(window).on('load', function (){
Page_Distrubion.update(old_data) Page_Distrubion.update(old_data)
$(window).scroll(function() { $(window).scroll(function() {
var offset = $("#file").offset(); var offset = $("#file").offset();
...@@ -40,4 +42,7 @@ $(window).on('load', function (){ ...@@ -40,4 +42,7 @@ $(window).on('load', function (){
$("#sticky").stop().removeClass('fixed'); $("#sticky").stop().removeClass('fixed');
} }
}); });
}); });
}
socket.on('error', function() { console.error(arguments) });
<div class="container-fluid"> <nav>
<header >
<h1><%= title %></h1>
<p class="lead"><%= description %></p>
</header>
<nav id="distributions" class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<span class="navbar-brand" href="#">Distrbutions</span>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav"></ul>
</div>
</nav>
<nav>
<ol class="breadcrumb"> <ol class="breadcrumb">
</ol> </ol>
</nav> </nav>
<article class="row">
<article class="row">
<aside class="col-md-3"> <aside class="col-md-3">
<nav id="packages"> <nav id="packages">
<h2>Packages</h2> <h2>Packages</h2>
...@@ -50,6 +37,5 @@ ...@@ -50,6 +37,5 @@
<pre></pre> <pre></pre>
</div> </div>
</section> </section>
</article> </article>
<footer><%= footer %></footer>
</div>
...@@ -16,6 +16,29 @@ ...@@ -16,6 +16,29 @@
<script src='/javascripts/main.js'></script> <script src='/javascripts/main.js'></script>
</head> </head>
<body> <body>
<div class="container-fluid">
<header >
<h1><%= title %></h1>
<p class="lead"><%= description %></p>
</header>
<nav id="distributions" class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<span class="navbar-brand" href="#">Distrbutions</span>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav"></ul>
</div>
</nav>
<%- body %> <%- body %>
<footer>
<%= footer %>
</footer>
</div> <!-- .container-fluild -->
</body> </body>
</html> </html>
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