-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.php
130 lines (101 loc) · 4.36 KB
/
index.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE bobhtml>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A minimalistic search engine for searching locally saved websites.">
<title>localGoogoo</title>
<link rel="icon" href="./assets/images/favicon.ico">
<link href="./assets/css/bootstrap.min.css" rel="stylesheet">
<link href="./assets/css/styles.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<!-- update alert -->
<div style="width: 40%; position: absolute; display: none;" class="pc-only alert alert-info alert-dismissible version" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
New version available!
<ul class='update-list'> </ul>
<a href="http://github.com/kodejuice/localGoogoo"> [Go to Repo] </a>
</div>
<div class="container-center">
<div class="m">
<div class="home-header">
<div id="title"> <!--BG IMAGE ELM--> </div>
<div id="title-mobile">
<img style="border:none;margin:8px 0" height="56" src="assets/images/localGoogoo.png" width="220" alt="localGoogoo"/>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<form action="./search.php">
<div class="form-group">
<input name="q" type="search" class="form-control input-lg home-search" id="search_box">
</div>
<div id="search_buttons">
<button type="submit" class="btn btn-primary btn-lg home-btn">Search</button>
<button type="submit" class="btn btn-primary btn-lg home-btn" name="lucky" title="Use Ctrl+Enter" value="true">I'm Feeling Lucky</button>
</div>
</form>
<a href="./sites.php" class="btn btn-outline-primary"> Manage Indexed Websites </a>
</div><!-- /.col-md-6 col-md-offset-3 -->
</div> <!-- /.row -->
</div>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75709223-2', 'auto');
ga('send', 'pageview');
</script>
<script src="./assets/js/libs/jquery.min.js"></script>
<script src="./assets/js/libs/bootstrap.min.js"></script>
<script src="./assets/js/libs/jquery.hotkeys.js"></script>
<script src="./version/version-tracker.js"></script>
<script>
$(function(){
var input = $("input"),
$form = $("form");
input.focus();
// prevent whitespace search and empty input
$form.on("submit", function(e) {
var $input = input,
query = $input.val();
if (!query || query.match(/^\s+$/)) {
e.preventDefault();
$input.focus();
}
// trim query string
$input.val(query.replace(/\s+/g, ' '));
});
/* KEYPRESS */
// Ctrl+return - 'Feelink Lucky?' Shortcut
$("input, html").bind('keydown', "Ctrl+return", function (){
var query = input.val();
input.val(query = query.replace(/\s+/g, ' '));
if (query && !query.match(/^\s+$/)){
window.location = "search.php?q="+query+"&lucky=1";
}
});
// focus input `onkeypress`
$(document).keypress(function(e) {
if (!input.is(":focus")) {
var v = String.fromCharCode(e.which);
if (v.match(/[a-z0-9]/i)) {
input.focus();
}
}
});
});
</script>
</body>
</html>