-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (84 loc) · 3.7 KB
/
index.html
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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>priceCompare</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script>
$(function () {
$("#searchForm").submit(function (e) {
e.preventDefault();
});
String.prototype.isEmpty = function () {
return (this.length === 0 || !this.trim());
};
function getStoreList(query) {
query = encodeURI(query.trim());
return '' +
'<a target="_blank" onclick=window.open(\'https://www.continente.pt/pt-pt/public/Pages/searchresults.aspx?k=' + query + '\')' + ' class="btn btn-danger reslink">Continente</a>' + ' ' +
'<a target="_blank" onclick=window.open(\'https://www.auchan.pt/Frontoffice/search/' + query + '\')' + ' class="btn btn-warning reslink">Auchan</a>' + ' ' +
'<a target="_blank" onclick=window.open(\'https://mercadao.pt/store/pingo-doce/search?queries=' + query + '\')' + ' class="btn btn-success reslink">Pingo Doce</a>' + ' ' +
'<a target="_blank" onclick=window.open(\'https://www.celeiro.pt/catalogsearch/result/?q=' + query + '\')' + ' class="btn btn-success reslink">Celeiro</a>' + ' ' +
'<a target="_blank" onclick=window.open(\'https://www.prozis.com/pt/pt/search/q/text/' + query + '\')' + ' class="btn btn-danger reslink">Prozis</a>';
}
$("#searchBtn").click(function (e) {
var query = $("#searchText").val();
if (query.isEmpty()) { } else {
$("#results").prepend(
'<div class="panel panel-default">' +
'<div class="panel-heading">' +
'<div class="pull-left text-uppercase"><p><a id="lool" href="#" onclick="$(this).closest(\'.panel\').find(\'.reslink\').click();" class="btn btn-default">' + query + '</a></p></div>' +
'<div class="pull-right"><p class="font-weight-light small text-muted">' + (new Date()).toLocaleTimeString() + '</p></div>' +
'<div class="clearfix"></div>' +
'</div>' +
'<div class="panel-body">' + getStoreList(query) + '</div>' +
'</div>');
$(".well").first().hide().slideDown(70);
// empty out the search field
$("#searchText").val('');
}
});
});
</script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<script src="" async defer></script>
<div class="container-fluid">
<h2>priceCompare</h2>
<form id="searchForm" class="form" autocomplete="on">
<div class="form-group form-group-lg">
<div class="col-sm-10">
<input id="searchText" name="searchText" class="form-control" type="text" value="" />
</div>
<div class="col-sm-2">
<button id="searchBtn" class="form-control btn btn-default">Pesquisar</button>
</div>
</div>
</form>
<div class="clearfix"></div>
<hr>
<br>
<div class="col-md-6">
<div id="results">
</div>
</div>
</div>
</body>
</html>