-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickcheck.html
288 lines (247 loc) · 11.8 KB
/
quickcheck.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<!--
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<<<<<<< HEAD
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 >
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" />
=======
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
>>>>>>> origin/master
<link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css">
<title>Quick Check</title>
</head>
<body>
<<<<<<< HEAD
<div class="app">
<div class="center">
<a href="index.html" data-ajax="false"> <img width="30px" src="img/home.png" /></a>
<a href="index.html" data-ajax="false"> <img style="min-width:242px;min-height:107px" src="img/logo.png" /></a>
<a href="quickcheck.html" data-ajax="false"> <img width="30px" src="img/accept.png" /></a> <div class="help">
=======
<div class="app">
<div class="center"> <a href="index.html" data-ajax="false"> <img src="img/logo.png" /></a><div class="help">
>>>>>>> origin/master
<h5>Quick Check: Select Model to search its Recalls</h5>
</div>
</div>
<div id="deviceready" class="blink hidden">
<p class="event listening">Connecting to Device</p>
<p class="event received hidden"></p>
</div>
<div data-bind="visible: isloading || mans().length ==0" >Loading..</div>
<div data-bind="visible: mans().length > 0">
<select data-bind="options: mans(), optionsText: 'Make', visible: mans().length > 0, value: selectedmake, optionsCaption: 'Select Manufacturer'"></select>
</div>
<div data-bind="visible: (selectedmake() && selectedmake().Models().length > 0)"><select data-bind=" options: (selectedmake() && selectedmake().Models()) ? selectedmake().Models() : [], visible: (selectedmake() && selectedmake().Models().length > 0), value: selectedmodel, optionsCaption: 'Select Model'"></select>
</div>
<div data-bind="visible: selectedmodel()">
<button data-bind="click: $root.performsearch()">Search</button>
</div>
<div>
<div data-role="collapsible-set" data-theme="b" data-bind="foreach: searchresult" data-content-theme="d" >
<div class="collapsible" >
<<<<<<< HEAD
<h4 ><span style="font-size:small;" data-bind="text: Concern +' #'+ RecallsNumber +' '+ LaunchDate"></span></h4>
<p >
<span data-bind="visible: VINStart.length > 0 ,text: 'VIN Start: ' + VINStart + ' VIN End: ' + VINEnd "><br />
</span>
<span data-bind="visible: VINStart.length > 0"><br /></span>
<span data-bind="text: Defect "></span><br /><br />
<span data-bind="visible: Remedy.length > 0 ,text: 'Remedy: ' + Remedy"></span>
</p>
=======
<h3 data-bind="text: Concern"></h3>
<p data-bind="text: Defect"></p>
>>>>>>> origin/master
</div>
</div>
</div>
</div>
<<<<<<< HEAD
=======
>>>>>>> origin/master
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/FileTransfer.js"></script>
<script type="text/javascript" src="js/FileTransferError.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/knockout.js"></script>
<script type="text/javascript" src="js/knockout.mapping.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.5.js"></script>
<script type="text/javascript" src="js/papaparse.min.js"></script>
<<<<<<< HEAD
<script src="js/moment.min.js" type="text/javascript"></script>
=======
>>>>>>> origin/master
<script type="text/javascript">
var data;
app.initialize();
$(document).on('pageinit', function () {
setup();
});
var Recall = function Recall() {
self = this;
self.LaunchDate = ko.observable();
self.RecallsNumber = ko.observable();
self.Make = ko.observable();
self.RecallsModelInformation = ko.observable();
self.Concern = ko.observable();
self.Defect = ko.observable();
self.Remedy = ko.observable();
self.VehicleNumbers = ko.observable();
self.Manufacturer = ko.observable();
self.Model = ko.observable();
self.VINStart = ko.observable();
self.VINEnd = ko.observable();
self.BuildStart = ko.observable();
self.BuildEnd = ko.observable();
}
var make = function () {
self = this;
self.Make = ko.observable('ggg');
self.Models = ko.observableArray([]);
self.getmodels = function getmodels() {
try {
var flags = [], output = [], l = vm.recalls().length, i;
for (i = 0; i < l; i++) {
if (vm.recalls()[i].Make == self.Make()) {
//alert('getting models for ' + self.Make() + '' + vm.recalls()[i].Model + '<<' + vm.recalls()[i].Model);
var found = false;
for (var j = 0; j < output.length; j++) {
if (output[j] === vm.recalls()[i].Model) {
found = true;
}
}
if (!found) output.push(vm.recalls()[i].Model);
//alert(JSON.stringify(output));
//output.push('hello');
}
}
//ko.mapping.fromJS(output,this.mans());
//alert(output + '<<');
<<<<<<< HEAD
output.sort();
=======
>>>>>>> origin/master
self.Models(output);
// alert(this.mans().length);
//alert(JSON.stringify(output));
} catch (e) { alert('103' + e); }
}
}
var viewModel = function () {
var self = this;
this.active = ko.observable(0);
this.selected = ko.computed({
read: function () { return this.active().toString(); },
write: function (newValue) { this.active(parseInt(newValue, 10)); },
owner: this
});
self.SearchQuery = ko.observable('ggg');
self.recalls = ko.observableArray([]);
self.isloading = ko.observable(false);
self.mans = ko.observableArray([]);
self.selectedmake = ko.observable(make);
self.selectedmodel = ko.observable();
self.searchresult = ko.observableArray([Recall]);
self.getmans = function getmans(array) {
try {
<<<<<<< HEAD
=======
//alert(array.length);
>>>>>>> origin/master
var flags = [], output = [], l = array.length, i;
for (i = 0; i < l; i++) {
if (flags[array[i].Make]) continue;
flags[array[i].Make] = true;
//alert(array[i].Make);
var mymake = new make();
mymake.Make(array[i].Make);
<<<<<<< HEAD
mymake.getmodels(array[i].Make);
//mymake.Models(models);
if (array[i].Make && array[i].Make.toString().trim().length > 0)
output.push(mymake);
=======
//alert('get models of ' + array[i].Make);
mymake.getmodels(array[i].Make);
//mymake.Models(models);
output.push(mymake);
>>>>>>> origin/master
// alert()
}
//alert(output);
//ko.mapping.fromJS(output,this.mans());
this.mans(output);
<<<<<<< HEAD
=======
// alert(this.mans().length);
//alert(JSON.stringify(output));
>>>>>>> origin/master
} catch (e) { alert('145' + e); }
};
self.performsearch = function performsearch() {
var i;
if (self.selectedmodel())
i = self.selectedmodel();
//alert(i);
var array;
array = ko.utils.arrayFilter(self.recalls(), function (item) {
return item.Model == self.selectedmodel();
});
//alert(JSON.stringify(array));
array.sort(function (l, r) {
return (Date.parse(l.LaunchDate) == Date.parse(r.LaunchDate) ? 0 : (Date.parse(l.LaunchDate) > Date.parse(r.LaunchDate) ? -1 : 1))
});
self.searchresult(array);
$('.collapsible').collapsible();
}
}
var vm = new viewModel();
function setup() {
<<<<<<< HEAD
try{
ko.applyBindings(vm);
vm.isloading(true);
//alert(JSON.stringify(vm.SearchQuery()));
//alert(vm.recalls().length);
//vm.isloading(false);
//alert(data.length);
//getfile();
// alert(JSON.stringify(vm.mans())) ;
} catch (e) { alert(e);}
=======
ko.applyBindings(vm);
vm.isloading(true);
//alert(JSON.stringify(vm.SearchQuery()));
//alert(vm.recalls().length);
//vm.isloading(false);
//alert(data.length);
//getfile();
// alert(JSON.stringify(vm.mans())) ;
>>>>>>> origin/master
}
</script>
<style>
.center {
text-align:center;
}
.hidden {
display:none;
}
<<<<<<< HEAD
.collapsible-set,.collapsible {
font-size: smaller;
}
=======
>>>>>>> origin/master
</style> </body>
</html>