-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (90 loc) · 1.78 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
<!DOCTYPE html>
<html>
<head>
<title>Tripcards</title>
</head>
<body>
<p>Trip instructions</p>
<script type="text/javascript" src="tripCardsSorter.js"></script>
<script type="text/javascript">
// Формат входных данных:
// point - пункт отправления
// destination - пункт назначения
// transport - транспорт с указанием деталей:
// type - тип
// route - рейс
// gate - выход на посадку
// seat - место
// baggageDrop номер багажной карусели
var cards = [
{
point: {
name: 'Barcelona'
},
destination: {
name: 'Gerona Airport'
},
transport: {
type: 'airportBus',
route: '',
gate: '',
seat: '',
baggageDrop: ''
}
},
{
point: {
name: 'Gerona Airport'
},
destination: {
name: 'Stockholm'
},
transport: {
type: 'plane',
route: 'SK455',
gate: '45B',
seat: '3A',
baggageDrop: '344'
}
},
{
point: {
name: 'Madrid'
},
destination: {
name: 'Barcelona'
},
transport: {
type: 'train',
route: '78A',
gate: '',
seat: '45B',
baggageDrop: '344'
}
},
{
point: {
name: 'Stockholm'
},
destination: {
name: 'New York JFK'
},
transport: {
type: 'plane',
route: 'SK22',
gate: '22',
seat: '7B',
baggageDrop: ''
}
}
];
var main = function () {
var sorter = new TripCardsSorter();
sorter.importCards(cards);
sorter.sortCards();
sorter.printItinerary();
}
document.addEventListener("DOMContentLoaded", main);
</script>
</body>
</html>