Lines 134-147
Link Here
|
134 |
for(var i=0; i<aaData.length; i++) { |
134 |
for(var i=0; i<aaData.length; i++) { |
135 |
aaData[i].push('Delete'); //this is hackish FIXME |
135 |
aaData[i].push('Delete'); //this is hackish FIXME |
136 |
} |
136 |
} |
137 |
document.getElementById('quotes_editor').style.visibility="visible"; |
137 |
document.getElementById('save_quotes').style.visibility="visible"; |
138 |
document.getElementById('file_uploader').style.visibility="hidden"; |
138 |
document.getElementById('file_uploader').style.visibility="hidden"; |
|
|
139 |
document.getElementById('quotes_editor').style.visibility="visible"; |
139 |
oTable = $('#quotes_editor').dataTable( { |
140 |
oTable = $('#quotes_editor').dataTable( { |
140 |
"bAutoWidth" : false, |
141 |
"bAutoWidth" : false, |
141 |
"bPaginate" : true, |
142 |
"bPaginate" : true, |
142 |
"bSort" : false, |
143 |
"bSort" : false, |
143 |
"sPaginationType" : "full_numbers", |
144 |
"sPaginationType" : "full_numbers", |
144 |
"sDom" : '<"save_quotes">frtip', |
|
|
145 |
"aaData" : aaData, |
145 |
"aaData" : aaData, |
146 |
"aoColumns" : [ |
146 |
"aoColumns" : [ |
147 |
{ |
147 |
{ |
Lines 162-168
Link Here
|
162 |
}, |
162 |
}, |
163 |
"fnRowCallback": function( nRow, aData, iDisplayIndex ) { |
163 |
"fnRowCallback": function( nRow, aData, iDisplayIndex ) { |
164 |
noEditFields = [2]; /* action */ |
164 |
noEditFields = [2]; /* action */ |
165 |
/* console.log('Quote ID: '+quoteID); */ |
|
|
166 |
/* do foo on various cells in the current row */ |
165 |
/* do foo on various cells in the current row */ |
167 |
$('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />'); |
166 |
$('td:eq(2)', nRow).html('<input type="button" class="delete" value="Delete" onclick="fnClickDeleteRow(this.parentNode);" />'); |
168 |
/* apply no_edit id to noEditFields */ |
167 |
/* apply no_edit id to noEditFields */ |
Lines 184-192
Link Here
|
184 |
}, |
183 |
}, |
185 |
"height" : "14px", |
184 |
"height" : "14px", |
186 |
}); |
185 |
}); |
187 |
$("div.save_quotes").html('<input type="button" class="add_quote_button" value="Save Quotes" style="float: right;" onclick="fnGetData(document.getElementById(\'quotes_editor\'));"/>'); |
|
|
188 |
}, |
186 |
}, |
189 |
}); |
187 |
}); |
|
|
188 |
document.getElementById('footer').style.visibility="visible"; |
190 |
} |
189 |
} |
191 |
|
190 |
|
192 |
function fnHandleFileSelect(evt) { |
191 |
function fnHandleFileSelect(evt) { |
Lines 202-214
Link Here
|
202 |
parent.location='quotes-upload.pl'; |
201 |
parent.location='quotes-upload.pl'; |
203 |
}; |
202 |
}; |
204 |
reader.onloadstart = function(e) { |
203 |
reader.onloadstart = function(e) { |
|
|
204 |
document.getElementById('cancel_upload').style.visibility="visible"; |
205 |
document.getElementById('progress_bar').className = 'loading'; |
205 |
document.getElementById('progress_bar').className = 'loading'; |
206 |
}; |
206 |
}; |
207 |
reader.onload = function(e) { |
207 |
reader.onload = function(e) { |
208 |
// Ensure that the progress bar displays 100% at the end. |
208 |
// Ensure that the progress bar displays 100% at the end. |
209 |
progress.style.width = '100%'; |
209 |
progress.style.width = '100%'; |
210 |
progress.textContent = '100%'; |
210 |
progress.textContent = '100%'; |
211 |
setTimeout("document.getElementById('progress_bar').className='';", 2000); |
211 |
document.getElementById('cancel_upload').style.visibility="hidden"; |
212 |
quotes = fnCSVToArray(e.target.result, ','); |
212 |
quotes = fnCSVToArray(e.target.result, ','); |
213 |
fnDataTable(quotes); |
213 |
fnDataTable(quotes); |
214 |
} |
214 |
} |
Lines 232-238
Link Here
|
232 |
reader.readAsText(evt.target.files[0]); |
232 |
reader.readAsText(evt.target.files[0]); |
233 |
} |
233 |
} |
234 |
|
234 |
|
235 |
document.getElementById('files').addEventListener('change', fnHandleFileSelect, false); |
235 |
//document.getElementById('file_upload').addEventListener('change', fnHandleFileSelect, false); |
|
|
236 |
$('#file_upload').one('change', fnHandleFileSelect); |
236 |
|
237 |
|
237 |
}); |
238 |
}); |
238 |
|
239 |
|
Lines 281-291
Link Here
|
281 |
<div id="bd"> |
282 |
<div id="bd"> |
282 |
<div id="yui-main"> |
283 |
<div id="yui-main"> |
283 |
<div class="yui-b"> |
284 |
<div class="yui-b"> |
284 |
|
285 |
<div id="toolbar" style="height:61px;"> |
285 |
<div id="file_uploader" style="float: left; width: 100%; visibility:visible;"> |
286 |
<div id="save_quotes" style="visibility:hidden;"> |
286 |
<input type="file" id="files" name="file" /> |
287 |
<input type="button" class="add_quote_button" value="Save Quotes" style="border-radius: 5px;" onclick="fnGetData(document.getElementById('quotes_editor'));"/> |
287 |
<button onclick="fnAbortRead();">Cancel Upload</button> |
288 |
<span class="hint">Click on any field to edit contents</span> |
288 |
<div id="progress_bar"><div class="percent">0%</div></div> |
289 |
</div> |
|
|
290 |
<div id="file_uploader" class="file_uploader" style="visibility:visible;"> |
291 |
<input id="file_upload" type="file" name="file" /> |
292 |
<button id="cancel_upload" style="visibility:hidden;" onclick="fnAbortRead();">Cancel Upload</button> |
293 |
<div id="progress_bar"><div class="percent">0%</div></div> |
294 |
</div> |
289 |
</div> |
295 |
</div> |
290 |
<div id="server_response" onclick='fnResetUpload()'>Server Response</div> |
296 |
<div id="server_response" onclick='fnResetUpload()'>Server Response</div> |
291 |
<table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;"> |
297 |
<table id="quotes_editor" style="float: left; width: 100%; visibility:hidden;"> |
Lines 305-313
Link Here
|
305 |
</tr> |
311 |
</tr> |
306 |
</tbody> |
312 |
</tbody> |
307 |
</table> |
313 |
</table> |
308 |
|
314 |
<fieldset id="footer" class="action" style="visibility:hidden; height:25px"> |
309 |
|
315 |
</fieldset> |
310 |
|
|
|
311 |
</div> |
316 |
</div> |
312 |
</div> |
317 |
</div> |
313 |
<div class="yui-b noprint"> |
318 |
<div class="yui-b noprint"> |