Bug 8508: Followup: Simplify the separateData js function

I think this patch does the same job as previously.
+ It replaces tabulation characters with 4 spaces

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Jonathan Druart 2012-09-13 10:20:56 +02:00 committed by Jared Camins-Esakov
parent 6376ca3a26
commit 3203e4eb4c
1 changed files with 4 additions and 13 deletions

View File

@ -20,20 +20,11 @@ $(document).ready(function() {
var cD = ColumnData;
var new_array = new Array();
for ( j=0 ; j<cD.length ; j++ ) {
var strMatch = cD[j].match(/<br>/gi);
if (strMatch) {
var split_array = cD[j].split(/<br>/gi);
for ( k=0 ; k<split_array.length ; k++ ){
var check_array = $.inArray(split_array[k], new_array);
if (check_array == -1) {
new_array.push(split_array[k]);
}
}
}
else {
var check_array = $.inArray(cD[j], new_array);
var split_array = cD[j].split(/<br>/gi);
for ( k=0 ; k<split_array.length ; k++ ){
var check_array = $.inArray(split_array[k], new_array);
if (check_array == -1) {
new_array.push(cD[j]);
new_array.push(split_array[k]);
}
}
}