new Conversor(htmlContent)#
Represents the logic of the by file controller view
Parameters:
Name | Type | Description |
---|---|---|
htmlContent | HTMLElement | The HTML template of the by file view |
- Source
Example
const conversor = new Conversor(htmlTemplate);
Members#
dropArea :HTMLElement#
Type:
- HTMLElement
- Source
files :null#
Type:
- null
- Source
htmlContent :HTMLElement#
Type:
- HTMLElement
- Source
inputFile :HTMLElement#
Type:
- HTMLElement
- Source
Methods#
buildCsvFile(text, title) → {void}#
Create the csv file and downloand it
Parameters:
Name | Type | Description |
---|---|---|
text | String | The data text in csv format |
title | String | The title of the file uploaded |
- Source
Returns:
- Type:
- void
handleDragOver(e) → {void}#
Handle the dragOver event in the drop area
Parameters:
Name | Type | Description |
---|---|---|
e | Event | Event |
- Source
Fires:
Returns:
- Type:
- void
handleDrop(e) → {void}#
Handle the drop event in the drop area
Parameters:
Name | Type | Description |
---|---|---|
e | Event | Event |
- Source
Fires:
Returns:
- Type:
- void
handleEnter() → {void}#
Handle dragenter event in the drop area
- Source
Fires:
Returns:
- Type:
- void
handleFiles(e) → {void}#
Handle the files upload in the input type file
Parameters:
Name | Type | Description |
---|---|---|
e | Event | Event |
- Source
Fires:
Returns:
- Type:
- void
handleLeave(e) → {void}#
Handle the dragOver event in the drop area
Parameters:
Name | Type | Description |
---|---|---|
e | Event | Event |
- Source
Returns:
- Type:
- void
init() → {void}#
Init the Conversor by file and add the needed listeners
- Source
Returns:
- Type:
- void
processFile(file) → {void}#
Process the json file to convert into a csv text format
Parameters:
Name | Type | Description |
---|---|---|
file | file | The json file got it to convert into csv |
- Source
Returns:
- Type:
- void