-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.html
93 lines (58 loc) · 2.54 KB
/
settings.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>settings</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link href="css/ratchet.min.css" rel="stylesheet">
<script src="js/ratchet.min.js"></script>
<script src="js/menu-bottom.js"></script>
<script src="js/moment.min.js"></script>
</head>
<body>
<header class="bar bar-nav">
<h1 class="title">Настройки приложения</h1>
</header>
<div class="content">
<div class="card">
<form name="fset" class="input-group">
Начальное время (час:мин):<input type="text" name="start_time">
Длительность встречи (мин):<input type="text" name="meetingtime">
Скорость передвижения (км/ч):<input type="text" name="speed">
Стоимость проезда за км (руб):<input type="text" name="cost">
Cтоимость подачи машины (руб):<input type="text" name="filingcost">
</form>
<button id="btnset" class="btn btn-positive btn-block" onclick="set();">Принять</button>
</div>
</div>
<div id="menu-bottom"></div>
<script type="text/javascript">
if (localStorage.getItem('start_time')) {
document.fset.start_time.value = localStorage['start_time'];
}
if (localStorage.getItem('meetingtime')) {
document.fset.meetingtime.value = Number(localStorage['meetingtime']);
}
if (localStorage.getItem('speed')) {
document.fset.speed.value = Number(localStorage['speed']);
}
if (localStorage.getItem('cost')) {
document.fset.cost.value = Number(localStorage['cost']);
}
if (localStorage.getItem('filingcost')) {
document.fset.filingcost.value = Number(localStorage['filingcost']);
}
function set() {
var t_diff = document.fset.start_time.value.split(':');
var start_time = moment(new Date(0, 0, 0, 0, 0, 0)).add(t_diff[0], 'h').add(t_diff[1], 'm').format('HH:mm');
localStorage['start_time'] = start_time;
localStorage['meetingtime'] = parseInt(document.fset.meetingtime.value);
localStorage['speed'] = parseInt(document.fset.speed.value);
localStorage['cost'] = parseInt(document.fset.cost.value);
localStorage['filingcost'] = parseInt(document.fset.filingcost.value);
document.getElementById('btnset').disabled = true;
}
</script>
</body>
</html>