Browse Source

Reordered a couple things

pull/17/head
Matthew Holt 11 years ago
parent
commit
83cb826fd7
  1. 2
      index.html
  2. 47
      jquery.parse.js

2
index.html

@ -94,7 +94,7 @@ $(function() @@ -94,7 +94,7 @@ $(function()
$('#parseFiles').click(function()
{
$('#fileinput1').parse(
$('#fileinput1, #fileinput2').parse(
{
before: function(file, inputElem)
{

47
jquery.parse.js

@ -177,20 +177,6 @@ @@ -177,20 +177,6 @@
this.setOptions(config);
function returnable()
{
return {
results: _state.parsed,
errors: _state.errors
};
}
function reset(input)
{
_state = emptyState();
_input = input;
}
function validConfig(config)
{
if (typeof config.delimiter !== 'string'
@ -244,13 +230,9 @@ @@ -244,13 +230,9 @@
_state.i++;
}
else if (delimBefore || delimAfter)
{
_state.inQuotes = !_state.inQuotes;
}
else
{
addError("Quotes", "UnexpectedQuotes", "Unexpected quotes");
}
}
function inQuotes()
@ -340,14 +322,6 @@ @@ -340,14 +322,6 @@
_state.field ++;
}
function endRow()
{
saveField();
var emptyLine = trimEmptyLine();
if (!emptyLine && _config.header)
inspectFieldCount();
}
function newRow()
{
endRow();
@ -362,6 +336,14 @@ @@ -362,6 +336,14 @@
_state.field = 0;
}
function endRow()
{
saveField();
var emptyLine = trimEmptyLine();
if (!emptyLine && _config.header)
inspectFieldCount();
}
function tryParseFloat(num)
{
var isNumber = _regex.floats.test(num);
@ -427,6 +409,19 @@ @@ -427,6 +409,19 @@
return false;
}
function returnable()
{
return {
results: _state.parsed,
errors: _state.errors
};
}
function reset(input)
{
_state = emptyState();
_input = input;
}
}
})(jQuery);

Loading…
Cancel
Save