Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions scripts/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ var globName = "";

/*
* Function: now
* Gets the date and time in the format hr:min
* Ret: string (formatted time)
* Returns the current time in the format hr:min
*/
function now() {
var date = new Date();
return date.getHours() + ":" + date.getMinutes();
}

/*
* Function: today
* Gets the date in the format month/day/year
* Ret: string (formatted date)
* Returns the date in the format month/day/year
*/
function today() {
var date = new Date();
Expand All @@ -52,7 +55,7 @@ function sanitizeString(unsafeWord){
* Function: getSubgoalInfo
* Ret: string (ready for csv)
* Formats the subgoal information for the csv file. Also makes call to getActionInfo
* so that each subgoal includes the actions associate with it
* so that each subgoal includes the actions associated with it
*/
function getSubgoalInfo(){
var subgoalList= getSubgoalArrayFromLocal();
Expand Down Expand Up @@ -360,8 +363,11 @@ function downloadCSV(csvContent, old) {
}

/*
*This function downloads the image into the designated folder when given the uri and name
*/
* Function: downloadURI
* Arg: uri - the image data URI
* Arg: name - the desired filename
* Adds an image to the zip archive by creating a named object from the URI.
*/
function downloadURI(uri, name) {
try {
//checks to see if the uri or name is null
Expand Down Expand Up @@ -410,9 +416,12 @@ function downloadURI(uri, name) {
ynm: yesnomaybe,
why: whyText,
facetValues: facets

/*
* Function: parseSubgoalArray
*
* Ret: array of arrays representing csv-formatted subgoal/action entries
* Parses user input stored locally and transforms it into an array of rows
* compatible with old-format GenderMag CSV.
*/
function parseSubgoalArray(){
var userInput= getSubgoalArrayFromLocal();
Expand Down Expand Up @@ -481,9 +490,12 @@ function parseSubgoalArray(){
}
return entries;
}

/*
* Function: createOLDCSV
*
* Function: createOldCSV
* Ret: string (ready for csv)
* Assembles header and data content from parseSubgoalArray into a final
* CSV string for the old-format GenderMag report.
*/
function createOldCSV() {
console.log('getting things');
Expand Down