Lines 11-16
Link Here
|
11 |
var oTable; //DataTable object |
11 |
var oTable; //DataTable object |
12 |
$(document).ready(function() { |
12 |
$(document).ready(function() { |
13 |
|
13 |
|
|
|
14 |
$("#cancel_upload").on("click",function(e){ |
15 |
e.preventDefault(); |
16 |
fnAbortRead(); |
17 |
}); |
18 |
$("#cancel_quotes").on("click",function(){ |
19 |
return confirm( _("Are you sure you want to cancel this import?") ); |
20 |
}); |
21 |
|
14 |
// Credits: |
22 |
// Credits: |
15 |
// FileReader() code copied and hacked from: |
23 |
// FileReader() code copied and hacked from: |
16 |
// http://www.html5rocks.com/en/tutorials/file/dndfiles/ |
24 |
// http://www.html5rocks.com/en/tutorials/file/dndfiles/ |
Lines 222-235
Link Here
|
222 |
parent.location='quotes-upload.pl'; |
230 |
parent.location='quotes-upload.pl'; |
223 |
}; |
231 |
}; |
224 |
reader.onloadstart = function(e) { |
232 |
reader.onloadstart = function(e) { |
225 |
$('#cancel_upload').css("visibility","visible"); |
233 |
$('#cancel_upload').show(); |
226 |
$('#progress_bar').addClass("loading"); |
234 |
$('#progress_bar').addClass("loading"); |
227 |
}; |
235 |
}; |
228 |
reader.onload = function(e) { |
236 |
reader.onload = function(e) { |
229 |
// Ensure that the progress bar displays 100% at the end. |
237 |
// Ensure that the progress bar displays 100% at the end. |
230 |
progress.style.width = '100%'; |
238 |
progress.style.width = '100%'; |
231 |
progress.textContent = '100%'; |
239 |
progress.textContent = '100%'; |
232 |
$('#cancel_upload').css("visibility","hidden"); |
240 |
$('#cancel_upload').hide(); |
233 |
quotes = fnCSVToArray(e.target.result, ','); |
241 |
quotes = fnCSVToArray(e.target.result, ','); |
234 |
fnDataTable(quotes); |
242 |
fnDataTable(quotes); |
235 |
} |
243 |
} |
Lines 333-339
Link Here
|
333 |
<legend>Upload quotes</legend> |
341 |
<legend>Upload quotes</legend> |
334 |
<div id="file_upload"> |
342 |
<div id="file_upload"> |
335 |
<input type="file" name="file" /> |
343 |
<input type="file" name="file" /> |
336 |
<button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button> |
344 |
<button id="cancel_upload" style="display:none">Cancel upload</button> |
337 |
<div id="progress_bar"><div class="percent">0%</div></div> |
345 |
<div id="progress_bar"><div class="percent">0%</div></div> |
338 |
</div> |
346 |
</div> |
339 |
</fieldset> |
347 |
</fieldset> |