Skip to content

Commit 669671d

Browse files
committed
Init
1 parent 8137ae2 commit 669671d

File tree

15 files changed

+15320
-0
lines changed

15 files changed

+15320
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Web CSV Generator
2+
3+
Web CSV Generator is a web-based random CSV data generator written in JavaScript.
4+
It allows to generate CSV files.
5+
6+
Try the demo here: [https://extendsclass.com/csv-generator.html](https://extendsclass.com/csv-generator.html)
7+
8+
![alt text](./image/preview.png "Preview")
9+
10+
## Dependencies
11+
12+
This tool uses:
13+
* [CodeMirror](https://github.com/codemirror/CodeMirror) (MIT license)
14+
* [Zip.js](https://gildas-lormeau.github.io/zip.js/) (BSD license)
15+
* [Papa Parse](https://github.com/mholt/PapaParse) (MIT license)
16+
* [Random name](https://github.com/dominictarr/random-name) (MIT license)
17+
* [Countries.json](https://gist.github.com/keeguon/2310008) (?)
18+
* [Geodata](https://github.com/mahemoff/geodata) (MIT license)
19+
20+
## Install
21+
22+
Drop the files into a directory (on a server or on your PC) and then visit in a browser.
23+
24+
Note for Chrome:
25+
This tool uses zip.js which uses web workers and Chrome does not allow loading web workers when running scripts from a local file.
26+
When you launch Chrome you must use the --allow-file-access-from-files flag.
27+
You can also use a http server.
28+
29+
## Launch tests
30+
31+
No implemented yet.
32+
33+
## License
34+
35+
MIT

WebCSVGenerator.css

Lines changed: 303 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,303 @@
1+
.csv-container {
2+
max-width: 1350px;
3+
margin-left: auto;
4+
margin-right: auto;
5+
}
6+
7+
.csv-error {
8+
color: red;
9+
padding: 8px;
10+
background-color: #F6CECE;
11+
margin: 10px 0px;
12+
}
13+
14+
.csv-valid {
15+
color: green;
16+
padding: 8px;
17+
background-color: #D0F5A9;
18+
margin: 10px 0px;
19+
}
20+
21+
.csv-container-result {
22+
border: 2px solid #bbbbbb;
23+
padding: 8px;
24+
background-color: #F1F1F1;
25+
min-height: 384px;
26+
margin-top: 55px;
27+
}
28+
29+
.csv-generator-download-link {
30+
float: right;
31+
margin-right: 20px;
32+
cursor: pointer;
33+
font-weight: bold;
34+
}
35+
36+
.csv-generator-download-name,
37+
.csv-generator-download-name-all {
38+
float: left;
39+
margin-left: 20px;
40+
cursor: pointer;
41+
font-weight: bold;
42+
}
43+
44+
.csv-generator-download-name-all,
45+
a.csv-generator-download-name-all {
46+
color: red;
47+
font-weight: bold;
48+
}
49+
50+
.csv-generator-download-clear {
51+
clear: both;
52+
}
53+
54+
.csv-editor-msg {
55+
clear: both;
56+
min-height: 34px;
57+
}
58+
59+
.csv-generator-quick-section {
60+
background-color: #4DAF52;
61+
margin: 8px auto 0px auto;
62+
color: white;
63+
font-weight: bold;
64+
text-align: center;
65+
width: 90%;
66+
border-radius: 2px 2px 0px 0px;
67+
}
68+
69+
.csv-generator-quick-section:hover {
70+
background-color: #4DAF52;
71+
}
72+
73+
.csv-generator-quick-section:after {
74+
color: white;
75+
}
76+
77+
.csv-generator-quick-section:hover::after {
78+
color: white;
79+
}
80+
81+
.csv-generator-quick-content {
82+
width: 90%;
83+
margin: auto;
84+
}
85+
86+
.csv-generator-quick-impair {
87+
background-color: #D0F5A9;
88+
}
89+
90+
td.csv-generator-quick-first {
91+
font-weight: bold;
92+
font-size: 15px;
93+
width: 100%;
94+
}
95+
96+
td.csv-generator-quick-second {
97+
text-align: left;
98+
font-size: 14px;
99+
width: 100%;
100+
}
101+
102+
.table {
103+
width: 100%;
104+
}
105+
106+
div.csv-field {
107+
width: 98%;
108+
clear: both;
109+
display: block;
110+
padding: 2px;
111+
margin-top: 5px;
112+
margin-bottom: 5px;
113+
}
114+
115+
div.csv-field-data {
116+
display: inline-block;
117+
vertical-align: middle;
118+
align: center;
119+
padding: 3px;
120+
margin-right: 5px;
121+
}
122+
123+
label.csv-field-name,
124+
div.csv-field-name {
125+
width: 150px;
126+
}
127+
128+
div.csv-field-name input {
129+
width: 130px;
130+
}
131+
132+
div.csv-field-button {
133+
width: 120px;
134+
}
135+
136+
div.csv-field-type {
137+
width: 150px;
138+
}
139+
140+
div.csv-field-data-top {
141+
display: flex;
142+
align-items: top;
143+
}
144+
145+
h1 {
146+
font-size: 3.1em;
147+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
148+
font-weight: 900;
149+
text-align: center;
150+
color: #4DAF52;
151+
}
152+
153+
input.csv-input-small {
154+
max-width: 50px;
155+
max-height: 17px;
156+
}
157+
158+
textarea {
159+
min-height: 40px;
160+
}
161+
162+
label.csv-fieldColumn {
163+
font-weight: bold;
164+
}
165+
166+
select,
167+
input {
168+
border-radius: 4px 4px 4px 4px;
169+
padding: 5px;
170+
}
171+
172+
input[type='text'],
173+
select {
174+
min-width: 30px;
175+
}
176+
177+
.csv-column-button {
178+
margin-right: 8px;
179+
max-height: 24px;
180+
max-width: 24px;
181+
cursor: pointer;
182+
}
183+
184+
.csv-column-button-reverse {
185+
transform: rotate(180deg);
186+
-webkit-transform: rotate(180deg);
187+
-moz-transform: rotate(180deg);
188+
-o-transform: rotate(180deg);
189+
-ms-transform: rotate(180deg);
190+
}
191+
192+
input.csv-add-field {
193+
float: none;
194+
}
195+
196+
.csv-templates {
197+
float: right;
198+
width: 19%;
199+
margin-right: 20px;
200+
margin-top: 20px;
201+
}
202+
203+
.csv-box-title {
204+
background-color: #424242;
205+
color: white;
206+
text-align: center;
207+
font-size: 13px;
208+
padding: 5px;
209+
}
210+
211+
.csv-box-content {
212+
padding: 5px;
213+
border: 2px solid black;
214+
}
215+
216+
.csv-template-link {
217+
cursor: pointer;
218+
margin-right: 10px;
219+
}
220+
221+
.csv-center {
222+
text-align: center;
223+
}
224+
225+
.csv-column-double {
226+
margin-top: 10px;
227+
width: 46%;
228+
display: inline-block;
229+
vertical-align: top;
230+
word-wrap: break-word;
231+
}
232+
233+
.csv-select {
234+
border: 1px solid #ccc;
235+
padding: 4px;
236+
}
237+
238+
.csv-span {
239+
margin-left: 1%;
240+
margin-right: 1%;
241+
}
242+
243+
.csv-button {
244+
margin-left: 25px;
245+
cursor: pointer;
246+
font-size: 13px;
247+
font-weight: bold;
248+
background: #fff;
249+
border: 1px solid #bbbbbb;
250+
cursor: pointer;
251+
text-decoration: none;
252+
border-radius: 3px;
253+
-moz-border-radius: 3px;
254+
-webkit-border-radius: 3px;
255+
padding: 6px 18px;
256+
background-color: gray;
257+
color: white;
258+
}
259+
260+
.csv-button:hover {
261+
background-color: black;
262+
color: white;
263+
}
264+
265+
.csv-button-generate {
266+
background-color: #4DAF52;
267+
}
268+
269+
.csv-title {
270+
margin-bottom: 3px;
271+
font-weight: bold;
272+
margin-top: 3px;
273+
margin-bottom: 5px;
274+
background-color: #99ff99;
275+
padding: 8px;
276+
font-size: 16px;
277+
list-style: none;
278+
border: 1 px solid gray;
279+
border-radius: 8px;
280+
color: gray;
281+
}
282+
283+
.csv-editor-container {
284+
border: 2px solid #bbbbbb;
285+
padding: 0px;
286+
margin-top: 8px;
287+
}
288+
289+
@media (max-width:860px) {
290+
.csv-templates {
291+
width: 90%;
292+
display: block;
293+
float: none;
294+
margin-right: auto;
295+
clear: both;
296+
margin-left: auto;
297+
}
298+
.csv-column-double {
299+
width: 90%;
300+
margin-left: 5%;
301+
margin-bottom: 10px;
302+
}
303+
}

WebCSVGenerator.js

Lines changed: 872 additions & 0 deletions
Large diffs are not rendered by default.

external/codemirror/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)