mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-18 12:52:47 +00:00
86 lines
3 KiB
HTML
86 lines
3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<%= render '_head' %>
|
|
<script src="/js/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="/js/jquery.ba-bbq.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="/js/jquery.quicksand.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="/js/mojo.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="/js/liquidmetal.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="/js/application.js" type="text/javascript" charset="utf-8"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
|
jQuery(function() {
|
|
WezM.showJavascriptWidgets();
|
|
$('#search input').keypress(function(e) {
|
|
var input = $(this);
|
|
var q = (input.val() + String.fromCharCode(e.which)).toLowerCase();
|
|
|
|
var filtered_articles = $('#articles li').filter(function(i) {
|
|
var article = $(this);
|
|
var text = article.text().toLowerCase();
|
|
// var score = LiquidMetal.score(text, q);
|
|
// article.attr("data-score", score);
|
|
// return score > 0;
|
|
return text.indexOf(q) >= 0;
|
|
})
|
|
|
|
// Sort results
|
|
// var sorted_articles = filtered_articles.get().sort(function(a, b) {
|
|
// var valA = parseFloat($(a).attr("data-score"));
|
|
// var valB = parseFloat($(b).attr("data-score"));
|
|
// return (valA < valB) ? 1 : (valA > valB) ? -1 : 0;
|
|
// });
|
|
|
|
$("#articles").quicksand($(filtered_articles));
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body class="articles">
|
|
<%= render '_header' %>
|
|
<div id="content">
|
|
<h1>Archives</h1>
|
|
|
|
<%
|
|
menu = [
|
|
['All', sorted_articles.size],
|
|
['Technical', technical_articles.size],
|
|
['Personal', personal_articles.size],
|
|
]
|
|
%>
|
|
<ul class="inline menu">
|
|
<% menu.each do |menu_item|
|
|
label, count = menu_item
|
|
path = (label != "All" ? '/' + label.downcase : '') + "/articles/"
|
|
feed = 'http://feeds.feedburner.com/wezm'
|
|
feed += "-#{label.downcase}" if label != "All"
|
|
active = (@item.identifier.sub(%r{page/$}, '') == path)
|
|
%>
|
|
<li>
|
|
<a href="<%= feed %>"><img class="feed-icon" src="/images/black-feed-icon.png" width="12" height="12" alt="Black Feed Icon" /></a>
|
|
<a href="<%= path %>"<%= %Q{class="active"} if active %>><%= label %></a> (<%= count %>)
|
|
</li>
|
|
<% end %>
|
|
<li id="search">
|
|
<fieldset>
|
|
<label for="query">Search</label>
|
|
<input type="text" name="q" id="query" value="" />
|
|
<span class="clear"></span>
|
|
</fieldset>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul id="articles" class="articles">
|
|
<%= yield %>
|
|
</ul>
|
|
|
|
<div class="pagination">
|
|
<% pagepath = @item.identifier; pagepath += 'page/' if pagepath !~ %r{/page/$} %>
|
|
<a href="<%= pagepath %>" class="newer">« Newer</a>
|
|
|
|
|
<a href="<%= pagepath %>#2" class="older">Older »</a>
|
|
</div>
|
|
</div>
|
|
<%= render '_footer' %>
|
|
</body>
|
|
</html>
|