diff --git a/scripts/output.js b/scripts/output.js index b3a39eb1..cc09e8c6 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -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(); @@ -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(); @@ -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 @@ -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(); @@ -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');