Conversor#

new Conversor(htmlContent)#

Represents the logic of the by file controller view
Parameters:
NameTypeDescription
htmlContentHTMLElementThe HTML template of the by file view
Example
CODE
const conversor = new Conversor(htmlTemplate);

Members#

dropArea :HTMLElement#

Type:
  • HTMLElement

files :null#

Type:
  • null

htmlContent :HTMLElement#

Type:
  • HTMLElement

inputFile :HTMLElement#

Type:
  • HTMLElement

Methods#

buildCsvFile(text, title) → {void}#

Create the csv file and downloand it
Parameters:
NameTypeDescription
textStringThe data text in csv format
titleStringThe title of the file uploaded
Returns:
Type: 
void

handleDragOver(e) → {void}#

Handle the dragOver event in the drop area
Parameters:
NameTypeDescription
eEventEvent
Returns:
Type: 
void

handleDrop(e) → {void}#

Handle the drop event in the drop area
Parameters:
NameTypeDescription
eEventEvent
Returns:
Type: 
void

handleEnter() → {void}#

Handle dragenter event in the drop area
Returns:
Type: 
void

handleFiles(e) → {void}#

Handle the files upload in the input type file
Parameters:
NameTypeDescription
eEventEvent
Returns:
Type: 
void

handleLeave(e) → {void}#

Handle the dragOver event in the drop area
Parameters:
NameTypeDescription
eEventEvent
Returns:
Type: 
void

init() → {void}#

Init the Conversor by file and add the needed listeners
Returns:
Type: 
void

processFile(file) → {void}#

Process the json file to convert into a csv text format
Parameters:
NameTypeDescription
filefileThe json file got it to convert into csv
Returns:
Type: 
void