-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
37 lines (33 loc) · 1007 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if(window.location.host === 'github.com') {
var baseUrl = 'http://localhost/searchub/';
var a = document.getElementsByTagName('head')[0];
var b = document.createElement('script');
b.type = 'text/javascript';
b.src = baseUrl + 'lib/searchub.js';
a.appendChild(b);
var timeout = setInterval(function() {
if(typeof(Searchub) != 'undefined') {
initializeSearchub();
clearInterval(timeout);
}
}, 100);
function initializeSearchub() {
Searchub.initialize();
$('#searchub_filter').live('submit', function() {
Searchub.filter($('#searchub_filter input[type=text]').attr('value'));
return false;
});
$('#searchub_filter a.reset').live('click', function() {
Searchub.unfilter();
return false;
});
$('#searchub_filter a.close').live('click', function() {
$(this).parents('#searchub_filter').slideUp('fast');
$('.searchub_style').remove();
return false;
});
}
}
else {
alert("You're not on Github!");
}