diff --git a/.gitignore b/.gitignore index 496ee2c..0c4ab86 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,16 @@ -.DS_Store \ No newline at end of file +# Vim +*~ +*.swp +*.swo +*.swn + +# OS +.DS_Store + +# Eclipse +.buildpath +.project +.settings + +# LibreOffice +.~lock* diff --git a/index.html b/index.html index af128d7..53abd0d 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,6 @@

Mr. Data Converter

I will convert your Excel data into one of several web-friendly formats, including HTML, JSON and XML.

-

Fork me on github.

Settings

@@ -35,8 +34,8 @@

Settings

Decimal Sign: - - + +

diff --git a/js/CSVParser.js b/js/CSVParser.js index bf816fa..f9bb098 100644 --- a/js/CSVParser.js +++ b/js/CSVParser.js @@ -131,7 +131,7 @@ var CSVParser = { if (dataArray[r]) { //replace comma with dot if comma is decimal separator if(decimalSign='comma' && isDecimal_re.test(dataArray[r][i])){ - dataArray[r][i] = dataArray[r][i].replace(",", "."); + //dataArray[r][i] = dataArray[r][i].replace(",", "."); } if (CSVParser.isNumber(dataArray[r][i])) { numInts++ diff --git a/js/DataGridRenderer.js b/js/DataGridRenderer.js index 1af1a44..239f2c0 100755 --- a/js/DataGridRenderer.js +++ b/js/DataGridRenderer.js @@ -84,14 +84,31 @@ var DataGridRenderer = { var outputText = ""; var numRows = dataGrid.length; var numColumns = headerNames.length; + var slug = function(str) { + str = str.replace(/^\s+|\s+$/g, ''); // trim + str = str.toLowerCase(); + + // remove accents, swap ñ for n, etc + var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;"; + var to = "aaaaaeeeeeiiiiooooouuuunc------"; + for (var i=0, l=from.length ; i"+newLine; outputText += indent+indent+""+newLine; for (var j=0; j < numColumns; j++) { - outputText += indent+indent+indent+''; + outputText += indent+indent+indent+''; outputText += headerNames[j]; outputText += ''+newLine; }; @@ -108,7 +125,7 @@ var DataGridRenderer = { } outputText += indent+indent+""+newLine; for (var j=0; j < numColumns; j++) { - outputText += indent+indent+indent+''; + outputText += indent+indent+indent+''; outputText += row[j] outputText += ''+newLine }; diff --git a/js/converter.js b/js/converter.js index e9c3820..3c5aa6f 100755 --- a/js/converter.js +++ b/js/converter.js @@ -31,7 +31,7 @@ function DataConverter(nodeId) { {"text":"XML - Properties", "id":"xmlProperties", "notes":""}, {"text":"XML - Nodes", "id":"xml", "notes":""}, {"text":"XML - Illustrator", "id":"xmlIllustrator", "notes":""}]; - this.outputDataType = "json"; + this.outputDataType = "html"; this.columnDelimiter = "\t"; this.rowDelimiter = "\n"; @@ -70,7 +70,7 @@ DataConverter.prototype.create = function(w,h) { var self = this; //build HTML for converter - this.inputHeader = $('

Input CSV or tab-delimited data. Using Excel? Simply copy and paste. No data on hand? Use sample

'); + this.inputHeader = $('

Input CSV or tab-delimited data. Using Excel? Simply copy and paste. Use sample

'); this.inputTextArea = $(''); var outputHeaderText = '

Output as