Global

Members

(constant) @private :string

JSDoc comment for this constant.
Source:
Type:
  • string

(constant) id

Unique integer identifier & index for the recipe.
Source:

(constant) params

Retrieve GET queries for current recipe. /recipe.html?source=placeholder&id=index See https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams
Source:

(constant) recipeDiv

Container with recipe data elements.
Source:

(constant) recipeJSON

LD-JSON structured data storing recipe data in the document head.
Source:

(constant) source

Either 'user' to specify a user recipe, or an external source like 'delicious.com.au' to specify a preset recipe.
Source:

(constant) TIME_FIELDS

['prepTime', 'cookTime', 'totalTime']
Source:

(constant) userRecipes

Fetch user recipes to populate frontend.
Source:

(constant) userRecipes

Fetch user recipes to populate frontend.
Source:

(constant) userRecipes

Access local storage to retrieve recipe data.
Source:

Methods

activateAddBtn()

"Add recipe" button logic.
Source:

activateBookmarkBtn()

"Bookmark recipe" button logic.
Source:

activateClearBtn()

"Delete recipe" button logic.
Source:

activateCreateBtn()

"Create new recipe" button logic.
Source:

activateDeleteBtn()

"Delete recipe" button logic.
Source:

activateDrawerEditing()

Activate editing functionality in the drawer.
Source:

activateSearchBar()

Recipe search bar logic.
Source:

activateSpeechBtn()

"Toggle speech commands" button logic.
Source:

caloriesNinjasNutritions(query) → {Array}

Get a detailed list of nutrition information for each item from an input text query.
Source:
Parameters:
Name Type Description
query string the text query that contains recipe information
Returns:
Type:
Array
An array of items given by the queries with the detailed nurtitions

createIngredientList(ingredientArr) → {string}

Takes in a list of ingredients raw from imported data and returns a neatly formatted comma separated list.
Source:
Parameters:
Name Type Description
ingredientArr Array.<string> The raw unprocessed array of ingredients from the imported data.
Returns:
Type:
string
The string comma separate list of ingredients from the array.

createTagList(data) → {Object|Array|string}

Takes in a list of ingredients raw from imported data and returns a neatly formatted comma separated list.
Source:
Parameters:
Name Type Description
data Object The recipe data object to search through.
Returns:
  • Type:
    Object
    tagList - An object storing the tags in array and string format.
  • Type:
    Array
    tagList.array - Array of tags
  • Type:
    string
    tagList.string - String of tags

deleteCornerBtns(btnIds)

Deletes specified corner buttons.
Source:
Parameters:
Name Type Description
btnIds Array.<string> IDs of buttons to delete. {'bookmarkBtn','addBtn', 'editBtn', 'deleteBtn'}

getIngredientInfo(id) → {Object}

Use an ingredient id to get all available information about an ingredient, such as its image and supermarket aisle.
Source:
Parameters:
Name Type Description
id number The ingredient id.
Returns:
Type:
Object
A JavaScript object that contains all the information of the given ingredient

getIngredientSubstitutes(name) → {Object}

Search for substitutes for a given ingredient.
Source:
Parameters:
Name Type Description
name string The ingredient id.
Returns:
Type:
Object
A JavaScript object that contains all the substitutes for a given ingredient.

getRecipeInformation(id) → {Object}

Use a recipe id to get full information about a recipe, such as ingredients, nutrition, diet and allergen information, etc.
Source:
Parameters:
Name Type Description
id number A JavaScript object that contains different types of params given in https://spoonacular.com/food-api/docs#Search-Recipes-Complex
Returns:
Type:
Object
A JavaScript object that contains all the information of the given recipe

getSimilarRecipe(id) → {Object}

Find recipes which are similar to the given one.
Source:
Parameters:
Name Type Description
id number The recipe id.
Returns:
Type:
Object
A JavaScript object that contains all the results in an array

ingredientsSearch(query) → {Object}

Search for simple whole foods (e.g. fruits, vegetables, nuts, grains, meat, fish, dairy etc.).
Source:
Parameters:
Name Type Description
query string The partial or full ingredient name.
Returns:
Type:
Object
A JavaScript object that contains all the information of the query

initializeDrawer()

Toggle expand button visibility based on drawer visibility.
Source:

initializeServiceWorker()

PWA/SPA ABANDONED: Detects if there's a service worker, then loads it and begins the process of installing it and getting it running.
Source:

initializeTooltips()

Initialize tooltips.
Source:

invalidRecipe()

Replaces recipe content with 404 message if there is no valid specified recipe to load.
Source:

parseISO(isoString) → {string}

Takes in a list of ingredients raw from imported data and returns a neatly formatted comma separated list.
Source:
Parameters:
Name Type Description
isoString string The ISO 8601 string to be parsed.
Returns:
Type:
string
The duration in a human-readable format (# hr # min).

populateDrawer()

Populates the editing drawer with recipe data.
Source:

populateRecipe(data)

Populates recipe content with recipe data.
Source:
Parameters:
Name Type Description
data Object Recipe data.

searchForKey(object, key) → {*}

Recursively search for a key nested somewhere inside an object
Source:
Parameters:
Name Type Description
object Object The object with which you'd like to search.
key string The key that you are looking for in the object.
Returns:
Type:
*
The value of the found key.

searchRecipe(params) → {Object}

Search through hundreds of thousands of recipes using advanced filtering and ranking. NOTE: This method combines searching by query, by ingredients, and by nutrients into one endpoint.
Source:
Parameters:
Name Type Description
params Object A JavaScript object that contains different types of params given in https://spoonacular.com/food-api/docs#Search-Recipes-Complex
Returns:
Type:
Object
A JavaScript object that contains all the results in an array