display:inline-block;
margin:5px;
}
+#filter {
+ position:fixed;
+ top:5px;
+ right:5px;
+}
--- /dev/null
+../../prelinger_extended-search.json
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html>
-
-<head>
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
-
- <script>
-
- $(document).ready(function() {
-
- $.getJSON('perlinger_identifiers.json', function(data) {
-
- var items = [];
- var count = 10;
-
- $.each(data.identifiers, function(key, val) {
- count--;
- if (count < 0) return;
- items.push([
- '<li id="' + val + '">',
- '<a href="http://archive.org/movies/thumbnails.php?identifier=' + val + '">' + val + '</a>',
- '</li>'
- ].join(""));
- });
-
- $('<ul/>', {
- 'class': 'thumbs',
- html : items.join('')
- }).appendTo('body');
- });
-
- });
-
- </script>
-
-</head>
-
-<body>
-</body>
-
-</html>
+var extended_json = {};
$(document).ready(function() {
+ $('#filter').hide();
+ $('#filter').keyup(function() {
+ var query = this.value.toLowerCase();
+ var d = jQuery.grep(extended_json.clips, function(clip, i) {
+ if (clip.id.toLowerCase().indexOf(query) >= 0 ||
+ (clip.description && clip.description.toLowerCase().indexOf(query) >= 0))
+ return true;
+ if (clip.subject)
+ for (var j = 0; j < clip.subject.length; j++)
+ if (clip.subject[j].toLowerCase().indexOf(query) >= 0)
+ return true;
+ return false;
+ });
+ $('.thumbs li').hide();
+ for (var i = 0; i < d.length; i++) {
+ $('.thumbs li#' + d[i].id).show();
+ }
+ });
+ $.getJSON('data/prelinger_extended-search.json', function(data) {
+ $('#filter').show();
+ extended_json = data;
+ });
$('#scrim').click(function() {
$('#subcontent').fadeOut(100, function() {
var fs = require("fs")
-, prelinger = require('../prelinger_extended-search.json');
+, prelinger = require('../prelinger.json');
var LIMIT = false;
clips.push(clip);
}
}
- res.render('index', { title: 'Archive.org/Prelinger Explorer', clips : clips });
+ res.render('index', { title: 'Visual Archive', clips : clips });
};
done: function (errors, window) {
var $ = window.$;
var thumbs = [];
- var as =$("div.box div a");
+ var as = $("div.box div a");
for (var i = 0; i < as.length; i++) {
thumbs.push({
"url" : "http://archive.org" + $(as[i]).attr('href'),
<script src="js/script.js"></script>
</head>
<body>
+ <input type="text" id="filter" />
<ul class="thumbs">
<% for(var i = 0; i < clips.length; i++) { %>
<li id="<%= clips[i].id %>" data-thumbs-url="<%= clips[i].thumbnails_url %>">