-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdict.php
More file actions
84 lines (78 loc) · 2.48 KB
/
dict.php
File metadata and controls
84 lines (78 loc) · 2.48 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Dictionary - Search word</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/jQuery/3.2.1/jQuery-3.2.1.js"></script>
<style>
ul{
background-color:#eee;
cursor:pointer;
}
li{
padding:12px;
}
div#dwrapper {
text-align: center;
}
h1 {
font-size: 50vmin;
position: absolute;
top: 50%;
margin-top: -25vmin;
width: 100%;
}
</style>
<script>
$(document).ready(function() {
var startHeight = $('.content').outerHeight() - $('.content').height();
var newHeight = $(window).height() - $('.header').outerHeight() - $('.menu').outerHeight() - $('.footer').outerHeight() - startHeight;
$('.content').css('height',newHeight);
});
</script>
</head>
<body>
<div class="container" style="width:500px;"><br>
<input type="text" name="country" id="country" class="form-control" placeholder="Enter Word" />
<div id="countryList"></div>
</div>
<div id="dwrapper"><h1 id="def"></h1></div>
</body>
</html>
<script>
$(document).ready(function(){
$('#country').keyup(function(){
var query = $(this).val();
if(query != '')
{
$.ajax({
url:"search.php",
method:"POST",
data:{query:query},
success:function(data)
{
$('#countryList').fadeIn();
$('#countryList').html(data);
}
});
}
else{
$('#countryList').html('');
}
});
$(document).on('click', 'li', function(){
var proceed = true;
$('#country').val($(this).text());
$('#countryList').fadeOut();
var word_id = $(this).attr('data-wid');
var word_num = $(this).attr('data-wnum');
window.location = 'definition.php?wid='+word_id+'&wnum='+word_num;
});
$("body").keypress(function(e){
if(e.shiftKey && (e.which == 100 || e.which == 68)){
window.location = '/dictionary';
}
})
});
</script>