Skip to content

Commit 1721a6d

Browse files
committed
Added cvs import & advanced controls
1 parent 03d6656 commit 1721a6d

File tree

4 files changed

+58
-6
lines changed

4 files changed

+58
-6
lines changed

css/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4444
}
4545

4646
.basic-cs {
47-
background-color: lightsteelblue;
47+
background-color: lightgreen;
4848
border-top-right-radius: 8px;
4949
border-top-left-radius: 8px;
5050
margin-left: -16px;
@@ -54,7 +54,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
5454
}
5555

5656
.advanced-cs {
57-
background-color: lightgrey;
57+
background-color: lightblue;
5858
border-top-right-radius: 8px;
5959
border-top-left-radius: 8px;
6060
margin-left: -16px;

index.html

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,22 @@
7575

7676
<!-- Basic Controls -->
7777
<div id="basic-controls">
78-
78+
<form>
79+
<div class="form-group">
80+
<label for="upload">Select .csv files:</label>
81+
<input class="btn btn-default" id="upload" type=file accept=".csv" name="files[]" size=30 multiple="multiple">
82+
</div>
83+
<div class="form-group">
84+
<label for="first-row-header">Make first row column headers:</label>
85+
<input id="first-row-header" type="checkbox" name="fr-headers"><br>
86+
</div>
87+
<div class="form-group">
88+
<label for="first-row-include">Include first row along with colum headers:</label>
89+
<input id="first-row-include" type="checkbox" name="fr-include"><br>
90+
</div>
91+
</form>
92+
<button id="go" class="btn btn-primary">Go!</button>
93+
<br/><br/>
7994
</div>
8095
</div>
8196
<div class="col-md-3 text-center controls">
@@ -88,7 +103,29 @@
88103

89104
<!-- Advanced Controls -->
90105
<div id="advanced-controls">
91-
106+
<form>
107+
<div class="form-group">
108+
<label for="encoding">Encoding:</label>
109+
<select id="encoding" name="encoding">
110+
<option value="utf-8">UTF-8</option>
111+
</select>
112+
</div>
113+
<div class="form-group">
114+
<label for="column-separator">Column separator</label>
115+
<select id="column-separator" name="column-separator">
116+
<option value="comma">Comma (,)</option>
117+
</select>
118+
</div>
119+
<div class="form-group">
120+
<label for="max-rows">Max rows:</label>
121+
<input id="max-rows" type="number" name="max-rows" min="1">
122+
</div>
123+
<div class="form-group">
124+
<label for="quotes">Treat quoted text as a single cell:</label>
125+
<input id="quotes" type="checkbox" name="quotes"><br>
126+
</div>
127+
<br/><br/>
128+
</form>
92129
</div>
93130
</div>
94131
</div>

js/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18+
/* Semi constant values */
19+
SM_SCREEN_SIZE = 768;
20+
1821
/**
1922
* Basic controls toggle button callback.
2023
*/
2124
$("#basic-controls-toggle").click(function() {
22-
toggleBasic();
25+
if(isSM())
26+
toggleBasic();
2327
});
2428

2529
/**
@@ -53,7 +57,8 @@ function toggleBasic(){
5357
* Advanced controls toggle button callback.
5458
*/
5559
$("#advanced-controls-toggle").click(function() {
56-
toggleAdvanced();
60+
if(isSM())
61+
toggleAdvanced();
5762
});
5863

5964
/**
@@ -81,4 +86,8 @@ function toggleAdvanced(){
8186
} else {
8287
showAdvanced();
8388
}
89+
}
90+
91+
function isSM(){
92+
return $(window).width() < SM_SCREEN_SIZE;
8493
}

nbproject/customs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"attributes": {
44
"integrity": {
55
"context": "link"
6+
},
7+
"size": {
8+
"context": "input"
9+
},
10+
"for": {
11+
"context": "input"
612
}
713
}
814
}

0 commit comments

Comments
 (0)