iodine 0.7.56 → 0.7.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +10 -10
- data/examples/bates/README.md +3 -0
- data/examples/bates/config.ru +342 -0
- data/examples/bates/david+bold.pdf +0 -0
- data/examples/bates/public/drop-pdf.png +0 -0
- data/examples/bates/public/index.html +600 -0
- data/ext/iodine/extconf.rb +1 -1
- data/ext/iodine/fio_tls_openssl.c +140 -90
- data/ext/iodine/iodine.c +1 -1
- data/ext/iodine/iodine_caller.c +25 -13
- data/lib/iodine/version.rb +1 -1
- data/lib/iodine.rb +1 -1
- metadata +8 -3
@@ -0,0 +1,600 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en"><head>
|
3
|
+
<title>Bates Numbering for Court</title>
|
4
|
+
<meta charset='utf-8'>
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no, minimal-ui=yes">
|
6
|
+
<style>
|
7
|
+
html, body {
|
8
|
+
height: 100%; width: 100%;
|
9
|
+
padding: 0; margin: 0;
|
10
|
+
color: #111;
|
11
|
+
background-color: #99A3CE;
|
12
|
+
}
|
13
|
+
|
14
|
+
h2, h3 {
|
15
|
+
font-size: 1.2em;
|
16
|
+
background-color: #44518E;
|
17
|
+
color: #C6CCE7;
|
18
|
+
}
|
19
|
+
h2 a, h3 a
|
20
|
+
{
|
21
|
+
color: inherit;
|
22
|
+
text-decoration: none;
|
23
|
+
}
|
24
|
+
h2 a:hover, h3 a:hover
|
25
|
+
{
|
26
|
+
color: #00f;
|
27
|
+
}
|
28
|
+
|
29
|
+
h1 {
|
30
|
+
font-size: 1.5em;
|
31
|
+
text-align: center;
|
32
|
+
background-color: #1B2864;
|
33
|
+
color: #99A3CE;
|
34
|
+
margin:0; padding: 0.5em;
|
35
|
+
}
|
36
|
+
h2 {
|
37
|
+
border-radius: 0.5em;
|
38
|
+
text-align: center;
|
39
|
+
}
|
40
|
+
h3 {
|
41
|
+
text-align: left;
|
42
|
+
}
|
43
|
+
.hide {
|
44
|
+
display: none !important;
|
45
|
+
}
|
46
|
+
span.en {
|
47
|
+
direction: ltr;
|
48
|
+
display: inline-block;
|
49
|
+
text-align: left;
|
50
|
+
width: auto;
|
51
|
+
}
|
52
|
+
#notice
|
53
|
+
{
|
54
|
+
z-index: 99999;
|
55
|
+
position: absolute;
|
56
|
+
top: 0; left: 0;
|
57
|
+
background-color: rgba(0, 0, 0, 0.75);
|
58
|
+
box-sizing: border-box;
|
59
|
+
padding: 1em 0;
|
60
|
+
text-align: center;
|
61
|
+
height: 100px;
|
62
|
+
width: 100%;
|
63
|
+
overflow-y: auto;
|
64
|
+
color: #fff; font-weight: bold;
|
65
|
+
transition:All 0.25s ease;
|
66
|
+
-webkit-transition:All 0.25s ease;
|
67
|
+
-moz-transition:All 0.25s ease;
|
68
|
+
-o-transition:All 0.25s ease;
|
69
|
+
-ms-transition:All 0.25s ease;
|
70
|
+
transform-origin: 0 50%;
|
71
|
+
-webkit-transform-origin: 50% 0; /* Chrome, Safari, Opera */
|
72
|
+
-ms-transform-origin: 50% 0; /* IE 9 */
|
73
|
+
-moz-transform-origin: 50% 0;
|
74
|
+
-o-transform-origin: 50% 0;
|
75
|
+
transform: scale(1, 1);
|
76
|
+
-webkit-transform: scale(1, 1);
|
77
|
+
-moz-transform: scale(1, 1);
|
78
|
+
-o-transform: scale(1, 1);
|
79
|
+
-ms-transform: scale(1, 1);
|
80
|
+
}
|
81
|
+
#notice.hidden
|
82
|
+
{
|
83
|
+
transform: scale(1, 0);
|
84
|
+
-webkit-transform: scale(1, 0);
|
85
|
+
-moz-transform: scale(1, 0);
|
86
|
+
-o-transform: scale(1, 0);
|
87
|
+
-ms-transform: scale(1, 0);
|
88
|
+
}
|
89
|
+
#notice .notice_close
|
90
|
+
{
|
91
|
+
display:block;
|
92
|
+
position: absolute;
|
93
|
+
top:0; left:0;
|
94
|
+
padding:0.5em;
|
95
|
+
height:100%;
|
96
|
+
width:5em;
|
97
|
+
text-align:left;
|
98
|
+
cursor: pointer;
|
99
|
+
border-right:1px solid #eee;
|
100
|
+
color: #ccc;
|
101
|
+
}
|
102
|
+
#notice .notice_close:hover
|
103
|
+
{
|
104
|
+
color: #eee;
|
105
|
+
background-color: rgba(255, 255, 255, 0.25);
|
106
|
+
}
|
107
|
+
|
108
|
+
#content {
|
109
|
+
background-color: #fff;
|
110
|
+
color: #111;
|
111
|
+
min-height: 100%;
|
112
|
+
padding: 4em 1.5em;
|
113
|
+
margin: 0 1em;
|
114
|
+
overflow-x: hidden;
|
115
|
+
box-sizing: border-box;
|
116
|
+
}
|
117
|
+
#content h1, #content h2, #content h3 {
|
118
|
+
background-color: #1B2864;
|
119
|
+
color: #99A3CE;
|
120
|
+
padding: 0.2em 1em;
|
121
|
+
margin: 0.2em 0;
|
122
|
+
}
|
123
|
+
#content h1 {
|
124
|
+
padding: 0.5em;
|
125
|
+
margin: 0;
|
126
|
+
}
|
127
|
+
#content p {
|
128
|
+
padding: 0.5em;
|
129
|
+
margin: 0;
|
130
|
+
}
|
131
|
+
#content a {
|
132
|
+
color: #0000aa;
|
133
|
+
text-decoration: none;
|
134
|
+
}
|
135
|
+
#content a:hover {
|
136
|
+
color: blue;
|
137
|
+
text-decoration: underline;
|
138
|
+
background: white;
|
139
|
+
position: relative;
|
140
|
+
top: 1px;
|
141
|
+
left: 2px;
|
142
|
+
}
|
143
|
+
#content h1 a, #content h2 a, #content h3 a, #content table th a {
|
144
|
+
color: #aaaaff;
|
145
|
+
}
|
146
|
+
#content h1 a:hover, #content h2 a:hover, #content h3 a:hover, #content table th a:hover {
|
147
|
+
background: inherit;
|
148
|
+
color: #ddddff;
|
149
|
+
}
|
150
|
+
#content #notice {
|
151
|
+
background: #ffaadd;
|
152
|
+
color: #551111;
|
153
|
+
margin: 0.3em 15%;
|
154
|
+
padding: 1em 0.5em;
|
155
|
+
text-align: center;
|
156
|
+
border-radius: 1em;
|
157
|
+
font-weight: bold;
|
158
|
+
font-size: 1.1em;
|
159
|
+
}
|
160
|
+
|
161
|
+
.desc, form {
|
162
|
+
text-align: justify;
|
163
|
+
display: block;
|
164
|
+
margin: 0.5em 15%; padding: 0 0 0.5em 0;
|
165
|
+
background: #eeeefa;
|
166
|
+
color: #111111;
|
167
|
+
border-radius: 1em;
|
168
|
+
}
|
169
|
+
.with_border
|
170
|
+
{
|
171
|
+
border: 1px solid #aab;
|
172
|
+
}
|
173
|
+
.desc p, form p {
|
174
|
+
padding: 0.2em;
|
175
|
+
margin: 0.5em 0;
|
176
|
+
}
|
177
|
+
form input[type='submit'] {
|
178
|
+
margin: 0.5em 20%;
|
179
|
+
width: 60%;
|
180
|
+
color: #000033;
|
181
|
+
background: #eeeeff;
|
182
|
+
}
|
183
|
+
form table {
|
184
|
+
width: 100%;
|
185
|
+
table-layout: fixed;
|
186
|
+
border-collapse: collapse;
|
187
|
+
}
|
188
|
+
form table th {
|
189
|
+
background: #bbb;
|
190
|
+
color: #111111;
|
191
|
+
}
|
192
|
+
form table td {
|
193
|
+
width: 2%;
|
194
|
+
border-collapse: collapse;
|
195
|
+
border-top: #bbbbcc dotted 1px;
|
196
|
+
border-bottom: #bbbbcc dotted 1px;
|
197
|
+
padding: 1px 2px;
|
198
|
+
}
|
199
|
+
form table tr {
|
200
|
+
border-collapse: collapse;
|
201
|
+
}
|
202
|
+
form table .en {
|
203
|
+
direction: ltr;
|
204
|
+
}
|
205
|
+
form table input, form table select {
|
206
|
+
width: 100%;
|
207
|
+
margin: 0.5em 0;
|
208
|
+
padding: 0;
|
209
|
+
color: #000033;
|
210
|
+
background: #eeeeff;
|
211
|
+
}
|
212
|
+
form table .no_resize input, form table .no_resize select {
|
213
|
+
width: auto;
|
214
|
+
margin: 0.5em 0;
|
215
|
+
padding: inherit;
|
216
|
+
}
|
217
|
+
form .field {
|
218
|
+
width: 100%;
|
219
|
+
display: block;
|
220
|
+
text-align: justify;
|
221
|
+
padding: 0.5em 0;
|
222
|
+
margin: 0;
|
223
|
+
margin-bottom: 0;
|
224
|
+
vertical-align: top;
|
225
|
+
border-collapse: collapse;
|
226
|
+
border-top: #bbbbcc dotted 1px;
|
227
|
+
border-bottom: #bbbbcc dotted 1px;
|
228
|
+
}
|
229
|
+
form .field label {
|
230
|
+
width: 34%;
|
231
|
+
margin: 0 2%;
|
232
|
+
padding: 0;
|
233
|
+
display: inline-block;
|
234
|
+
vertical-align: top;
|
235
|
+
}
|
236
|
+
form .field input {
|
237
|
+
width: 60%;
|
238
|
+
margin: 0;
|
239
|
+
padding: 0;
|
240
|
+
display: inline-block;
|
241
|
+
vertical-align: top;
|
242
|
+
color: #000033;
|
243
|
+
background: #eeeeff;
|
244
|
+
}
|
245
|
+
form .field select {
|
246
|
+
width: 60%;
|
247
|
+
margin: 0;
|
248
|
+
padding: 0;
|
249
|
+
}
|
250
|
+
form .field .no_resize input, form .field .no_resize select {
|
251
|
+
width: auto;
|
252
|
+
margin: inherit;
|
253
|
+
padding: inherit;
|
254
|
+
color: #000033;
|
255
|
+
background: #eeeeff;
|
256
|
+
}
|
257
|
+
form .field textarea {
|
258
|
+
width: 98%;
|
259
|
+
padding: 0;
|
260
|
+
margin: 0;
|
261
|
+
height: 5em;
|
262
|
+
display: block;
|
263
|
+
color: #000033;
|
264
|
+
background: #eeeeff;
|
265
|
+
}
|
266
|
+
form .en input, form .en textarea {
|
267
|
+
text-align: left;
|
268
|
+
direction: ltr;
|
269
|
+
}
|
270
|
+
|
271
|
+
table.one_liners {
|
272
|
+
table-layout: fixed !important;
|
273
|
+
max-width: 100% !important;
|
274
|
+
width: 100% !important;
|
275
|
+
text-overflow: ellipsis;
|
276
|
+
overflow: none;
|
277
|
+
}
|
278
|
+
table.one_liners td, table.one_liners th {
|
279
|
+
width: inherit;
|
280
|
+
max-width: 10%;
|
281
|
+
white-space: nowrap;
|
282
|
+
text-overflow: ellipsis;
|
283
|
+
}
|
284
|
+
|
285
|
+
h1#dropzone {
|
286
|
+
font-size: 2em;
|
287
|
+
text-align: center;
|
288
|
+
background-color: #44518E;
|
289
|
+
color: #C6CCE7;
|
290
|
+
padding: 0.5em 0;
|
291
|
+
background-image: url(/drop-pdf.png);
|
292
|
+
background-repeat: no-repeat;
|
293
|
+
background-position: 10% center;
|
294
|
+
background-size: auto 100%;
|
295
|
+
border-radius: 0.5em 0.5em 0 0;
|
296
|
+
}
|
297
|
+
|
298
|
+
ul.bates_file_table_list, ol.bates_file_table_list {
|
299
|
+
display: block;
|
300
|
+
margin: 0;
|
301
|
+
padding: 0;
|
302
|
+
list-style-position: inside;
|
303
|
+
width: 100%;
|
304
|
+
}
|
305
|
+
ul.bates_file_table_list li, ol.bates_file_table_list li {
|
306
|
+
border-top: 1px dotted #111111;
|
307
|
+
border-bottom: 1px dotted #111111;
|
308
|
+
border-collapse: collapse;
|
309
|
+
}
|
310
|
+
ul.bates_file_table_list li div, ol.bates_file_table_list li div {
|
311
|
+
display: inline-block;
|
312
|
+
width: 28%;
|
313
|
+
}
|
314
|
+
ul.bates_file_table_list input, ol.bates_file_table_list input {
|
315
|
+
width: 90%;
|
316
|
+
color: #000033;
|
317
|
+
background: #eeeeff;
|
318
|
+
}
|
319
|
+
ul.bates_file_table_list {
|
320
|
+
list-style-type: circle;
|
321
|
+
}
|
322
|
+
ul.bates_file_table_list li:first-child {
|
323
|
+
background: #aab;
|
324
|
+
color: #111111;
|
325
|
+
}
|
326
|
+
input[type=checkbox]:checked#bates_first_pdf_is_cover ~ ol.bates_file_table_list li:first-child {
|
327
|
+
background: #bbc;
|
328
|
+
color: #551111;
|
329
|
+
}
|
330
|
+
input[type=checkbox]
|
331
|
+
{
|
332
|
+
width: auto;
|
333
|
+
display: inline;
|
334
|
+
}
|
335
|
+
#file_remover {
|
336
|
+
float: left;
|
337
|
+
}
|
338
|
+
|
339
|
+
/* RESPONSIVE RELATED */
|
340
|
+
@media screen and (max-width: 46em) {
|
341
|
+
/* STYLING CONTENT (none at the moment)*/
|
342
|
+
/* line 800, /Users/2Be/Ruby/combine_pdf_demo/app/assets/stylesheets/welcome.css.scss */
|
343
|
+
body, html {
|
344
|
+
height: auto;
|
345
|
+
}
|
346
|
+
|
347
|
+
/* line 803, /Users/2Be/Ruby/combine_pdf_demo/app/assets/stylesheets/welcome.css.scss */
|
348
|
+
#content {
|
349
|
+
padding: 3em 0;
|
350
|
+
margin: 0;
|
351
|
+
}
|
352
|
+
#content #notice {
|
353
|
+
margin: 0.2em 1em;
|
354
|
+
}
|
355
|
+
/* line 814, /Users/2Be/Ruby/combine_pdf_demo/app/assets/stylesheets/welcome.css.scss */
|
356
|
+
#content .hide_when_small {
|
357
|
+
display: none;
|
358
|
+
}
|
359
|
+
form, .desc {
|
360
|
+
margin: 0.3em 1em;
|
361
|
+
}
|
362
|
+
}
|
363
|
+
</style>
|
364
|
+
<script>
|
365
|
+
function show_notice() { document.getElementById("notice").classList.remove('hidden'); }
|
366
|
+
function hide_notice() { document.getElementById("notice").classList.add('hidden'); }
|
367
|
+
</script>
|
368
|
+
</head><body>
|
369
|
+
<h1>Bates Numbering - PDF file merge and number</h1>
|
370
|
+
<div id="notice" class="hidden"><a class='notice_close'onclick='hide_notice()'>X</a><div id="notice_text"></div></div>
|
371
|
+
<div id="contents">
|
372
|
+
<ol class='bates_file_table_list' id='demo' style='display:none;'>
|
373
|
+
<li id='file_NUM'>
|
374
|
+
<div>
|
375
|
+
<input id="file_NUM_name" name="file[NUM][name]" readonly="readonly" type="text" value="FILE_NAME">
|
376
|
+
<input id="file_NUM_data" name="file[NUM][data]" type="hidden" value="NUM">
|
377
|
+
</div>
|
378
|
+
<div>
|
379
|
+
<input id="file_NUM_date" name="file[NUM][date]" type="text" value="DATE">
|
380
|
+
</div><div>
|
381
|
+
<input id="file_NUM_title" name="file[NUM][title]" type="text" value="TITLE">
|
382
|
+
</div>
|
383
|
+
|||
|
384
|
+
<a href="#" class="file_remover" onclick='this.parentNode.parentNode.removeChild(this.parentNode); return false;'>[x]</a>
|
385
|
+
</li>
|
386
|
+
</ol>
|
387
|
+
<form accept-charset="UTF-8" enctype="multipart/form-data" method="post" onsubmit="onSubmit()">
|
388
|
+
<h1 id='dropzone'>Drag PDF files here</h1>
|
389
|
+
<p>
|
390
|
+
<ul class='bates_file_table_list'>
|
391
|
+
<li>
|
392
|
+
<div>File Name</div>
|
393
|
+
<div>Date</div>
|
394
|
+
<div>Title</div>
|
395
|
+
</li>
|
396
|
+
</ul>
|
397
|
+
<input checked="checked" id="bates_first_pdf_is_cover" name="bates[first_pdf_is_cover]" type="checkbox" value="true">
|
398
|
+
<label for="bates_first_pdf_is_cover">Place the first PDF file before the Index page.</label>
|
399
|
+
<ol class='bates_file_table_list' id='file_list'></ol>
|
400
|
+
<input type="submit" value="Submit">
|
401
|
+
</p>
|
402
|
+
<h3>Settings</h3>
|
403
|
+
<table>
|
404
|
+
<tr><td>Output file name:</td><td><input type='text' id="output_filename" name='bates[output]' value="combined"></td></tr><tr><td>First page number:</td><td><input type='number' name='bates[first_page_number]' value="1">
|
405
|
+
</td></tr><tr><td>First index number:</td><td><input type='number' name='bates[first_index_number]' value="1">
|
406
|
+
</td></tr><tr><td>Numbering:</td><td><select id='numbering' name='bates[numbering]'>
|
407
|
+
<option value='0'>Center</option>
|
408
|
+
<option value='1'>Left</option>
|
409
|
+
<option value='2'>Right</option>
|
410
|
+
<option value='3'>None</option>
|
411
|
+
</select>
|
412
|
+
</td></tr><tr><td><input checked="checked" id="bates_should_index_files" name="bates[should_index]" type="checkbox" value="true"><label for='bates_should_index_files'>Index Files?</label></td><td><label for='bates_should_index_files'>un-check to avoid an index and title pages.</label>
|
413
|
+
</td></tr><tr><td><input id="bates_skip_cover" name="bates[skip_cover]" type="checkbox" value="true"><label for='bates_skip_cover'>Skip Cover?</label></td><td><label for='bates_skip_cover'>check to skip numbering the cover page.</label>
|
414
|
+
</td></tr><tr><td>Language:</td><td><select id='dir' name='bates[dir]'>
|
415
|
+
<option value='rtl'>עברית</option>
|
416
|
+
<option value='ltr'>English</option>
|
417
|
+
</select>
|
418
|
+
</td></tr><tr><td>Index Title:</td><td>
|
419
|
+
<input type='text' id='bates_index_title' name='bates[index_title]' value="Index">
|
420
|
+
</td></tr><tr><td>"Number" Header:</td><td>
|
421
|
+
<input type='text' id='bates_number_header' name='bates[number_header]' value="#">
|
422
|
+
</td></tr><tr><td>"Date" Header (Leave empty to ignore):</td><td>
|
423
|
+
<input type='text' id='bates_date_header' name='bates[date_header]' value="Date">
|
424
|
+
</td></tr><tr><td>"Title" Header:</td><td>
|
425
|
+
<input type='text' id='bates_title_header' name='bates[title_header]' value="Title">
|
426
|
+
</td></tr><tr><td> "Page Number" Header:</td><td>
|
427
|
+
<input type='text' id='bates_page_header' name='bates[page_header]' value="Page">
|
428
|
+
</td></tr><tr><td>Cover Page Title:</td><td>
|
429
|
+
<input type='text' id='bates_title_type' name='bates[title_type]' value="Exhibit">
|
430
|
+
<input type="submit" value="Submit">
|
431
|
+
</form>
|
432
|
+
</div>
|
433
|
+
<script>
|
434
|
+
function onSubmit()
|
435
|
+
{
|
436
|
+
return true;
|
437
|
+
}
|
438
|
+
file_i=0
|
439
|
+
files_read = 0
|
440
|
+
|
441
|
+
template = document.getElementById('demo').innerHTML
|
442
|
+
|
443
|
+
function transform_file(file)
|
444
|
+
{
|
445
|
+
// Get Time and Title if the name matches standard naming
|
446
|
+
obj_date_string = file.name.match("^[0-9\\-–]*") + ""
|
447
|
+
if(obj_date_string.length == 8) {
|
448
|
+
obj_date = obj_date_string.substr(6,2) + "." + obj_date_string.substr(4,2) + "." + obj_date_string.substr(0,4)
|
449
|
+
obj_description = file.name.substring(9, file.name.toLowerCase().search("\.pdf") )
|
450
|
+
} else if(obj_date_string.length == 10 && obj_date_string[4] == '-' && obj_date_string[7] == '-') {
|
451
|
+
obj_date = obj_date_string.substr(8,2) + "." + obj_date_string.substr(5,2) + "." + obj_date_string.substr(0,4)
|
452
|
+
obj_description = file.name.substring(11, file.name.toLowerCase().search("\.pdf") )
|
453
|
+
} else {
|
454
|
+
obj_date = ""
|
455
|
+
obj_description = file.name.substring(0, file.name.toLowerCase().search("\.pdf") )
|
456
|
+
}
|
457
|
+
|
458
|
+
// copy template and adjust details
|
459
|
+
|
460
|
+
document.getElementById('file_list').innerHTML += template.replace(RegExp("NUM", "g"), "" + file_i).replace(RegExp("FILE_NAME", "g"), file.name).replace(RegExp("DATE", "g"), obj_date).replace(RegExp("TITLE", "g"), obj_description)
|
461
|
+
|
462
|
+
// set reader for file
|
463
|
+
reader = new FileReader();
|
464
|
+
reader.futureObject = document.getElementById("file_" + file_i + "_data")
|
465
|
+
|
466
|
+
file_i += 1;
|
467
|
+
|
468
|
+
reader.onloadend = function(e)
|
469
|
+
{
|
470
|
+
//var id = this.futureObject.value
|
471
|
+
console.log("adding result to: " + this.futureObject.id )
|
472
|
+
document.getElementById(this.futureObject.id).value = e.target.result
|
473
|
+
files_read +=1
|
474
|
+
}
|
475
|
+
|
476
|
+
//reader.readAsText(file)
|
477
|
+
reader.readAsDataURL(file)
|
478
|
+
true
|
479
|
+
}
|
480
|
+
|
481
|
+
// make drop_zone droppable and set callbacks
|
482
|
+
var dropzone = document.getElementById('dropzone')
|
483
|
+
|
484
|
+
dropzone.ondragend = function (event) {event.stopPropagation();return false; };
|
485
|
+
dropzone.ondragover = function (event) {event.stopPropagation();return false; };
|
486
|
+
dropzone.ondragenter = function (event) {event.stopPropagation();return false; };
|
487
|
+
|
488
|
+
dropzone.ondrop = function(event) {
|
489
|
+
event.preventDefault()
|
490
|
+
event.stopPropagation();
|
491
|
+
var files = event.dataTransfer.files; // FileList object.
|
492
|
+
i = 0
|
493
|
+
while(files[i])
|
494
|
+
{
|
495
|
+
console.log('transforming:' + files[i] + ' name: ' + files[i].name.toLowerCase())
|
496
|
+
if( files[i].name.toLowerCase().search("\.pdf") != -1) transform_file(files[i])
|
497
|
+
i++
|
498
|
+
}
|
499
|
+
|
500
|
+
set_list_sotrable()
|
501
|
+
return false;
|
502
|
+
}
|
503
|
+
|
504
|
+
// make drag-drop and sortable list from file_list
|
505
|
+
var Dragged_id = ''
|
506
|
+
|
507
|
+
function start_drag_list_item(e) {
|
508
|
+
Dragged_id = this.id
|
509
|
+
e.dataTransfer.setData('text/plain', this.id)
|
510
|
+
this.style.opacity = '0.3'
|
511
|
+
}
|
512
|
+
function end_drag_list_item(e) {
|
513
|
+
this.style.opacity = '1'
|
514
|
+
Dragged_id = ''
|
515
|
+
}
|
516
|
+
function enter_drag_list_item(e) {
|
517
|
+
if(Dragged_id == '') return false;
|
518
|
+
if(this.id == Dragged_id) return false; //this.style.opacity = '0.7'
|
519
|
+
this.parentNode.insertBefore(this.parentNode.removeChild(document.getElementById(Dragged_id)), this);
|
520
|
+
}
|
521
|
+
function leave_drag_list_item(e) {
|
522
|
+
if(Dragged_id == '') return false;
|
523
|
+
if(this.id != Dragged_id) this.style.opacity = '1'
|
524
|
+
}
|
525
|
+
function drop_list_item(e)
|
526
|
+
{
|
527
|
+
e.stopPropagation()
|
528
|
+
e.preventDefault()
|
529
|
+
alert('move ' + Dragged_id + ' before ' + this.id)
|
530
|
+
if (this.id == Dragged_id) return false;
|
531
|
+
}
|
532
|
+
function set_list_sotrable()
|
533
|
+
{
|
534
|
+
all_list_items = document.querySelectorAll('#file_list li');
|
535
|
+
for(i=0; i < all_list_items.length; i++)
|
536
|
+
{
|
537
|
+
all_list_items[i].setAttribute("draggable","true");
|
538
|
+
all_list_items[i].ondragstart = start_drag_list_item
|
539
|
+
all_list_items[i].ondragenter = enter_drag_list_item
|
540
|
+
all_list_items[i].ondragleave = leave_drag_list_item
|
541
|
+
all_list_items[i].ondragend = end_drag_list_item
|
542
|
+
all_list_items[i].ondrop = drop_list_item
|
543
|
+
}
|
544
|
+
}
|
545
|
+
|
546
|
+
function get_today_as_str(){
|
547
|
+
const n = new Date();
|
548
|
+
return (n.getUTCFullYear().toString() + (n.getUTCMonth() < 10 ? ("0" + n.getUTCMonth().toString()) : n.getUTCMonth().toString()) + (n.getUTCMonth() < 10 ? ("0" + n.getUTCDate().toString()) : n.getUTCDate().toString()));
|
549
|
+
}
|
550
|
+
|
551
|
+
// set some initial values
|
552
|
+
function set_common_values(o){
|
553
|
+
for (let [key, value] of Object.entries(o)) {
|
554
|
+
console.log(key, value);
|
555
|
+
var tmp = document.getElementById(key);
|
556
|
+
if(tmp){
|
557
|
+
if(tmp.value)
|
558
|
+
tmp.value = value;
|
559
|
+
else
|
560
|
+
tmp.innerHTML = value;
|
561
|
+
}
|
562
|
+
}
|
563
|
+
}
|
564
|
+
function set_en_values(){
|
565
|
+
|
566
|
+
set_common_values({
|
567
|
+
output_filename: get_today_as_str() + " name",
|
568
|
+
bates_index_title: "Index",
|
569
|
+
bates_number_header: "Ex.",
|
570
|
+
bates_date_header: "Date",
|
571
|
+
bates_title_header: "Title",
|
572
|
+
bates_page_header: "Page",
|
573
|
+
bates_title_type: "Exhibit",
|
574
|
+
});
|
575
|
+
}
|
576
|
+
function set_he_values(){
|
577
|
+
set_common_values({
|
578
|
+
output_filename: get_today_as_str() + " שם",
|
579
|
+
bates_index_title: "תוכן עניינים",
|
580
|
+
bates_number_header: "נספח",
|
581
|
+
bates_date_header: "תאריך",
|
582
|
+
bates_title_header: "כותרת",
|
583
|
+
bates_page_header: "עמוד",
|
584
|
+
bates_title_type: "נספח",
|
585
|
+
});
|
586
|
+
}
|
587
|
+
|
588
|
+
function update_defaults(e) {
|
589
|
+
if(e.target.value == 'ltr') set_en_values();
|
590
|
+
else set_he_values();
|
591
|
+
}
|
592
|
+
|
593
|
+
function init_page(e){
|
594
|
+
set_he_values();
|
595
|
+
var tmp = document.getElementById("dir");
|
596
|
+
tmp.onchange = update_defaults;
|
597
|
+
}
|
598
|
+
init_page();
|
599
|
+
</script>
|
600
|
+
</body></html>
|
data/ext/iodine/extconf.rb
CHANGED