AppRouter

AppRouter

Routes URLs to different dashboard layouts and data.As backbone is a one page app, this shows and hides different "pages", for example it starts out with a full screen dashboard view, with datalist and a datum, but when the user clicks the full screen buttons or uses the navigation menu, and it also happens any time the URL changes it will make the component full screen by hiding and showing divs using jquery.

Constructor

new AppRouter()

Source:

Extends

  • Backbone.Router

Methods

renderDashboardOrNot(dbname)

Source:
Does nothing or renders
Parameters:
Name Type Description
dbname String (Optional) The name of the corpus to display.

showAllData(dbname)

Source:
The showAllData function gives the user a Datalist of all the Datums in their corpus (embedded Datalist view) it does this by calling the search method of searchEditView within appView
Parameters:
Name Type Description
dbname identifies the database to look in TODO: try saving it, setting it as current datalist and rendering that fullscreen

showAllDataInSession(dbname, id, goal)

Source:
The showAllData function gives the user a Datalist of all the Datums in this session (embedded Datalist view) it does this by calling the search method of searchEditView within appView with the goal of the session. An alternative is to use the map reduce function for this, which returns the datum in a session too (more precisely) however, we believe that it is usually the goal which the user is actually searching for, not the session itself.
Parameters:
Name Type Description
dbname identifies the database to look in TODO: try saving it, setting it as current datalist and rendering that fullscreen
id this is the id of the session itself
goal this is the goal of the session or what to search for.

showDashboard(dbname)

Source:
Displays the dashboard view of the given dbname, if one was given. Or the blank dashboard view, otherwise.
Parameters:
Name Type Description
dbname String (Optional) The name of the corpus to display.

showEmbeddedCorpus()

Source:
Displays all of the corpus details and settings.

showEmbeddedSearch()

Source:
Displays the advanced search in embedded form.

showEmbeddedSession(dbname, sessionid)

Source:
Displays the fullscreen view of the session specified by the given dbname and the given datumid.
Parameters:
Name Type Description
dbname String The name of the corpus this datum is from, this needs to direclty match its pouch.
sessionid Number The ID of the session within the corpus.

showFullscreenCorpus(dbname)

Source:
Displays all of the corpus details and settings.
Parameters:
Name Type Description
dbname String The name of the corpus this datum is from.

showFullscreenDataList(dbname, dataListid)

Source:
Displays the fullscreen view of the datalist specified by the given dbname and the given dataListid
Parameters:
Name Type Description
dbname String The name of the corpus this datalist is from.
dataListid Number The ID of the datalist within the corpus.

showFullscreenSearch()

Source:
Displays the advanced search in fullscreen form.

showFullscreenSession()

Source:
Displays the fullscreen view of the session.

showFullscreenUser()

Source:
Displays the public user page view of the given userid, if their public user is stored in this pouch.