-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·260 lines (203 loc) · 8.23 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
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
<html>
<head>
<style type="text/css">
#wrap {
width:600px;
margin:0 auto;
padding-top:28px;
}
#left_col {
float:left;
width:300px;
padding-right:16px;
}
#right_col {
float:right;
width:300px;
}
</style>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('#orderModal').modal({
keyboard: true,
backdrop: "static",
show: false,
}).on('show', function () {
});
$( document ).delegate( "#records_table tr", "click", function() {
$('.modal-body').html($('<b> Foo: ' + $(this).find( ".dt" ).html() + '</b>'));
$('#largeModal').modal('show');
});//button
$("#button").click(function(){
var subdir= $('#letter').val();
var s_str= "Process.php?file=" + $(this).attr('id')+"&subdir="+ subdir;
$.getJSON(s_str, function (data) {
var trHTML = '';
$.each(data, function (i, item) {
trHTML += '<tr data-id="'+ item.content + '" id= \'' + item.content + '\' data-text="'+ item.html+ '" ><td>Log</td><td>' + item.rank + '</td><td id= \'r_' + item.content + '\'>' + item.content + '</td><td id= \'s_' + item.content + '\'>' + '' + '</td><td id= \'t_' + item.content + '\'>' + item.UID + '</td> <td class="dt" style="display:none">' + 'aaa' + '</td> <td><a target="_blank" href="./Preview/' + item.content + '.png"> Line File </a></td></a></td><td><a target="_blank" href="./Origs/' + item.content + '.mvg"> Data File </a></td></tr>';
});
$('#records_table').append(trHTML);
//$('#blist').append("<li><a href=\"#\" id=\"run\" class=\"btn btn-lg btn-primary\">Run</a></li>" );
});
});//button
$( document ).delegate( "#run", "click", function() {
$('#status').text("Processing");
x=0;
var subdir= $('#letter').val();
$('#records_table tr').each(function() {
var s_str= "Chop.php?file=" + $(this).attr('id')+".JPG"+"&page="+x +"&subdir="+ subdir+"&chop=1";
var sel ="#r_" + $(this).attr('id');
var sel2 ="#s_" + $(this).attr('id');
var sel3 ="#" + $(this).attr('id');
x++;
var row= $(this);
$.getJSON(s_str, function (data) {
$(sel).text("Fields="+ data.fields);
$(this).data('foo', "new value");
$(this).attr("data-text", data.html);
row.find( ".dt" ).html(data.html) ;
$(sel2).text("Records="+ data.records);
$(sel3).css("background-color", "#550055");
$(sel3).css("color", "#eeeeee");
$('#status').text("Split:" + data.records);
});
});
$('#status').text("Finished Send");
// $('#blist').append("<li><a href=\"#\" id=\"d2\" class=\"btn btn-lg btn-primary\">Make Tif</a></li>" );
});
$( document ).delegate( "#run2", "click", function() {
$('#status').text("Processing");
x=0;
var subdir= $('#letter').val();
$('#records_table tr').each(function() {
var s_str= "Chop.php?file=" + $(this).attr('id')+".JPG"+"&page="+x +"&subdir="+ subdir+"&chop=0";
var sel ="#r_" + $(this).attr('id');
var sel2 ="#s_" + $(this).attr('id');
var sel3 ="#" + $(this).attr('id');
x++;
var row= $(this);
$.getJSON(s_str, function (data) {
$(sel).text("Fields="+ data.fields);
$(this).data('foo', "new value");
$(this).attr("data-text", data.html);
row.find( ".dt" ).html(data.html) ;
$(sel2).text("Records="+ data.records);
$(sel3).css("background-color", "#550055");
$(sel3).css("color", "#eeeeee");
$('#status').text("Split:" + data.records);
});
});
$('#status').text("Finished Send");
// $('#blist').append("<li><a href=\"#\" id=\"d2\" class=\"btn btn-lg btn-primary\">Make Tif</a></li>" );
});
$( document ).delegate( "#lines", "click", function() {
$('#status').text("Line Removal Start");
x=0;
var s_str= "RemoveLines.php?file=" + $(this).attr('id')+"&page="+x;
$.getJSON(s_str, function (data) {
$('#status').text("Removed Lines:" +data.count);
});
//$('#blist').append("<li><a href=\"#\" id=\"d2\" class=\"btn btn-lg btn-primary\">Make Tif for OCR</a></li>" );
});
$( document ).delegate( "#d2", "click", function() {
$('#status').text("Loading Tif Dir");
x=0;
var s_str= "MakeTif.php?file=" + $(this).attr('id')+"&page="+x;
$.getJSON(s_str, function (data) {
$('#status').text("Tiffs:" +data.count);
});
//$('#blist').append("<li><a href=\"#\" id=\"ocr\" class=\"btn btn-lg btn-primary\">OCR</a></li>" );
});
$( document ).delegate( "#ocr", "click", function() {
var subdir= $('#letter').val();
$('#status').text("OCR Start");
x=0;
$('#records_table tr').each(function() {
var s_str= "Ocr2.php?file=" + $(this).attr('id')+"&page="+x+"&subdir="+ subdir;
var sel ="#r_" + $(this).attr('id');
var sel2 ="#s_" + $(this).attr('id');
var sel3 ="#" + $(this).attr('id');
x++;
var row= $(this);
$.getJSON(s_str, function (data) {
$(sel3).css("background-color", "brown");
$(sel3).css("color", "#eeeeee");
row.find( ".dt" ).html(data.html) ;
$('#status').text("OCR:" +data.count);
});
});
$('#status').text("Finished OCR");
//$('#blist').append("<li><a href=\"#\" id=\"todb\" class=\"btn btn-lg btn-primary\">Send OCR To DB</a></li>" );
});
$( document ).delegate( "#todb", "click", function() {
$('#status').text("OCR Start");
x=0;
$('#records_table tr').each(function() {
var subdir= $('#letter').val();
var s_str= "ToDB.php?file=" + $(this).attr('id')+"&page="+x+"&subdir="+ subdir;
var sel ="#r_" + $(this).attr('id');
var sel2 ="#s_" + $(this).attr('id');
var sel3 ="#" + $(this).attr('id');
x++;
var row= $(this);
$.getJSON(s_str, function (data) {
$(sel).text("Fields="+ data.fields);
$(sel3).css("background-color", "yellow");
$(sel3).css("color", "#eeeeee");
row.find( ".dt" ).html(data.html) ;
$('#status').text("DB:" + data.count);
});
});
$('#status').text("Finished DB");
});
});//ready
</script>
</head>
<body>
<div id="wrap">
<div id="left_col">
<div class="alert alert-warning fade in" id="status">Ready</div><BR>
<input type="text" id="letter" placeholder="letter " size="8">
<BR>
<BR>
<ul id="blist">
<li >
<a href="#" id="button" class="btn btn-lg btn-primary">Load</a>
</li>
<li><a href="#" id="run" class="btn btn-lg btn-primary">Chop Up File </a></li>
<li><a href="#" id="run2" class="btn btn-lg btn-primary">Chop without file creation </a></li>
<li><a href="#" id="d2" class="btn btn-lg btn-primary">Make Tif for OCR use Bash</a></li>
<li><a href="#" id="ocr" class="btn btn-lg btn-primary">OCR and Make Text Files</a></li>
<li><a href="#" id="todb" class="btn btn-lg btn-primary">Send OCR To DB</a></li>
</ul>
</div>
<div id="right_col">
<table class="table table-striped" id="records_table" border='1'>
</table>
</div>
</div>
<div class="modal fade" id="largeModal" tabindex="-1" role="dialog" aria-labelledby="largeModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Large Modal</h4>
</div>
<div class="modal-body">
<h3>Modal Body</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</body>
</html>