@@ -105,34 +105,47 @@ function isSM(){
105105 * of the method call.
106106 */
107107function getUserInput ( ) {
108- var userInput = { } ;
109-
110- userInput . maxRows = getFMaxRows ( ) ;
111- userInput . encoding = getFEncoding ( ) ;
112- userInput . columnSeparator = getFColumnSeparator ( ) ;
113- userInput . useQuotes = isFUseQuotes ( ) ;
108+ var userInput = { } ;
109+
110+ userInput . maxRows = getMaxRows ( ) ;
111+ userInput . encoding = getEncoding ( ) ;
112+ userInput . columnSeparator = getColumnSeparator ( ) ;
113+ userInput . useQuotes = useQuotes ( ) ;
114+ userInput . firstRowHeaders = firstRowHeaders ( ) ;
115+ userInput . firstRowInlcude = firstRowInclude ( ) ;
116+ userInput . files = getFiles ( ) ;
114117
115- return userInput ;
116- }
117-
118- function getFMaxRows ( ) {
119- return $ ( "#max-rows" ) . val ( ) === "" ? "0" : $ ( "#max-rows" ) . val ( ) ;
120- }
118+ function getMaxRows ( ) {
119+ return $ ( "#max-rows" ) . val ( ) === "" ? "0" : $ ( "#max-rows" ) . val ( ) ;
120+ }
121121
122- function getFEncoding ( ) {
123- return $ ( "#encoding" ) . val ( ) ;
124- }
122+ function getEncoding ( ) {
123+ return $ ( "#encoding" ) . val ( ) ;
124+ }
125125
126- function getFColumnSeparator ( ) {
127- return $ ( "#column-separator" ) . val ( ) ;
128- }
126+ function getColumnSeparator ( ) {
127+ return $ ( "#column-separator" ) . val ( ) ;
128+ }
129129
130- function isFUseQuotes ( ) {
131- return $ ( "#quotes" ) . val ( ) ;
130+ function useQuotes ( ) {
131+ return $ ( "#quotes" ) . is ( ":checked" ) ;
132+ }
133+
134+ function firstRowHeaders ( ) {
135+ return $ ( "#first-row-header" ) . is ( ":checked" ) ;
136+ }
137+
138+ function firstRowInclude ( ) {
139+ return $ ( "#first-row-include" ) . is ( ":checked" ) ;
140+ }
141+
142+ function getFiles ( ) {
143+ return $ ( "#upload" ) . prop ( 'files' ) ;
144+ }
145+
146+ return userInput ;
132147}
133148
134149$ ( "#go" ) . click ( function ( ) {
135- userInput = getUserInput ( ) ;
136150
137- alert ( userInput . maxRows + "\n" + userInput . encoding + "\n" + userInput . columnSeparator + "\n" + userInput . useQuotes ) ;
138151} ) ;
0 commit comments