Methods
-
<static> usersList( courseID )
-
Description
Renders the people tab for a classParameters
Name Type Description courseID
string The course ID to render the people tab for Details
-
<static> globalSearch( term )
-
Description
Searches Power+ globally and shows results on the "Search Results" screenParameters
Name Type Description term
string The search term typed in the input box Details
-
<static> renderAssignment( assignment [, childDisplay ] ) → {string}
-
Description
Renders HTML for an assignment item in a listParameters
Name Type Attributes Description assignment
Assignment The assignment object to render childDisplay
string <optional> Text to display for specifying the child or children this assignment is for Returns
Details
-
<static> loadThreadsList( courseID [, defaultThread [, fromModules [, defaultPost ] ] ] )
-
Description
Renders the discussions list for a classParameters
Name Type Attributes Description courseID
string The course ID to render discussion threads for defaultThread
string <optional> The thread to load by default fromModules
boolean <optional> True if this page is being loaded from the moduleStream defaultPost
string <optional> The post to load by default Details
-
<static> renderAssignmentScore( assignment ) → {string}
-
Description
Renders HTML for an assignment score if the assignment is gradedParameters
Name Type Description assignment
Assignment The assignment object to render a score for Returns
Details
-
<static> class() → {object|undefined}
-
Description
Debugging shortcut for getting the selected class. This should only be used in the web inspector and not in actual code.Returns
Details
-
<static> mergeAndRenderChildAssignments( assignments ) → {string}
-
Description
Merges and renders assignments for children in the same classParameters
Name Type Description assignments
Array.<Assignment> An array of assignment objects to merge Returns
Details
-
<static> mainStream()
-
Description
Renders the DTPS dashboard and calls dtps.renderCalendar, dtps.renderUpdates, and dtps.renderUpcomingDetails
-
<static> changelog( fromVersion, draft )
-
Description
Fetches and displays the DTPS changelog modalParameters
Name Type Description fromVersion
number The previous version of DTPS installed. Will show popup changelogs since that version, if there aren't any, it will silently skip. draft
boolean True to show draft changelogs Details
-
<static> loadThreadPosts( classNum, threadID [, fromModules [, defaultPost ] ] )
-
Description
Fetches and displays posts in a discussionParameters
Name Type Attributes Description classNum
number The class number to render threadID
string The discussion thread to render fromModules
boolean <optional> True if this page is being loaded from the moduleStream defaultPost
string <optional> The post ID to jump to Details
-
<static> isDueOnDate( date [, onDate ] )
-
<static> log( ...msg )
-
Description
Logs debugging messagesParameters
Name Type Attributes Description msg
* <repeatable> The debugging messages to log Details
-
<static> renderDueToday( doneLoading [, fromDate ] )
-
Description
Compiles and displays due today / to-do streamParameters
Name Type Attributes Description doneLoading
boolean True if all classes have finished loading their assignment lists fromDate
Date <optional> The date to display assignments from. Defaults to the current date. Details
-
<static> error( msg [, devNotes [, err ] ] )
-
Description
Shows an error message alert and logs to consoleParameters
Name Type Attributes Description msg
string The error to display devNotes
string <optional> Technical error details displayed in a smaller font err
Error <optional> An error object to log to the console. If this is null, DTPS will assume the error has been handled elsewhere. Details
-
<static> firstrun()
-
Description
Renders "Welcome to Project DTPS" screen on the first runDetails
-
<static> renderUpcoming( [ fromDate ] )
-
Description
Compiles and displays upcoming assignments streamParameters
Name Type Attributes Description fromDate
Date <optional> The date to display assignments from. Defaults to the current date. Details
-
<static> loadPagesList( courseID [, defaultPage ], fromModules )
-
Description
Renders the pages list for a classParameters
Name Type Attributes Description courseID
string The course ID to render pages for defaultPage
string <optional> If provided, load the pageID by default fromModules
boolean True if this page is being loaded from the moduleStream Details
-
<static> renderLoadingScreen()
-
Description
Renders the DTPS loading screenDetails
-
<static> JS( cb )
-
Description
Load all external JavaScript librariesParameters
Name Type Description cb
function Callback function Details
-
<static> CSS()
-
Description
Load all DTPS CSS filesDetails
-
<static> renderUpdates( [ dateSelected ] )
-
Description
Renders updates stream (recently graded & announcements)Parameters
Name Type Attributes Description dateSelected
boolean <optional> True if a date is selected in the dashboard Details
-
<static> dayTimeMinutes( d )
-
Description
Gets the amount of minutes elapsed in the dayParameters
Name Type Description d
date The day Returns
Details
-
<static> filterSearch( [ toggleItem ] )
-
Description
Filters search resultsParameters
Name Type Attributes Description toggleItem
Element | string <optional> The selector for the element to toggle Details
-
<static> init()
-
Description
Starts DTPS (entrypoint function)Details
-
<static> calendar( doneLoading )
-
Description
Compiles and displays the assignment calendarParameters
Name Type Description doneLoading
boolean True if all classes have finished loading their assignment lists Details
-
<static> loadPage( classNum, pageID, fromModules )
-
Description
Fetches and renders a page and its contentsParameters
Name Type Description classNum
string The class number of the page to render pageID
string The page ID to render fromModules
boolean True if this page is being loaded from the moduleStream Details
-
<static> renderSearchResult( result, matchData [, mixedClasses ] ) → {string}
-
Description
Renders a Search data object into HTML for display in the search results listParameters
Name Type Attributes Description result
SearchData The search result to render matchData
Array.<Object> The list of matches from Lunr mixedClasses
boolean <optional> True if there are results from multiple classes Returns
Details
-
<static> classStream( classID [, searchResults ] )
-
Description
Shows the assignments stream for a classParameters
Name Type Attributes Description classID
string The class ID to show assignments for searchResults
Array.<Assignment> <optional> An array of assignemnts to render instead of course.assignments. Used for assignment search. Details
-
<static> assignment( id, classNum [, generic ] )
-
Description
Shows details for an assignment given the assignment ID and class numberParameters
Name Type Attributes Description id
string Assignment ID classNum
number Assignment class number generic
boolean <optional> True if user-specific details, such as grades, should not be displayed Details
-
<static> moduleStream( classID )
-
Description
Shows the module stream for a classParameters
Name Type Description classID
string Class number to fetch modules for Details
-
<static> formatDate( date ) → {string}
-
Description
Formats a date to a readable date stringParameters
Name Type Description date
Date The date to format Returns
Details
-
<static> iframeLoad( iframeID )
-
Description
Adjusts the height of an iFrame to match its contentParameters
Name Type Description iframeID
string The ID of the iFrame element to adjust Details
-
<static> clearData()
-
Description
Clears all DTPS dataDetails
-
<static> showClasses( [ override ] )
-
Description
Renders the class list in the sidebarParameters
Name Type Attributes Description override
boolean <optional> True if the sidebar should be forcefully re-rendered Details
-
<static> moduleCollapse( ele, classID, modID )
-
Description
Collapses a moduleParameters
Name Type Description ele
Element Element of the module collapse arrow classID
string Class ID modID
string Module ID of the module to collapse Details
-
<static> moduleCollapseAll( collapse )
-
Description
Collapses all moduleParameters
Name Type Description collapse
boolean If true, modules will be collapsed, otherwise, they will all be expanded Details
-
<static> presentClass( classNum )
-
Description
Renders the class header (color, name, tabs, etc.) and sets the class as the selected classParameters
Name Type Description classNum
number | string The class number to load or "dash" if loading the dashboard Details
-
<static> renderStreamTools( num, type ) → {string}
-
Description
Gets stream tools HTML (search box, class info, and modules/assignment switcher)Parameters
Name Type Description num
number Class number type
string Class content these tools are for (e.g. "stream") Returns
Details
-
<static> gradebook( classID )
-
Description
Shows the generic gradebookParameters
Name Type Description classID
string Class ID Details
-
<static> classHome( num )
-
Description
Displays the class homepageParameters
Name Type Description num
number Class number to show the homepage for Details
-
<static> showLMSGradebook( classID )
-
Description
Shows the gradebook using HTML from dtpsLMS.gradebookParameters
Name Type Description classID
string Class ID Details
-
<static> showIFrameCard( url )
-
Description
Shows a URL in the iFrame cardParameters
Name Type Description url
string The URL to load Details
-
<static> brightenTextForDarkMode( html [, bg ] ) → {string}
-
Description
Brightens text in an HTML string for dark modeParameters
Name Type Attributes Description html
string The HTML to brighten text for bg
string <optional> The background color that the HTML will be displayed on Returns
Details
-
<static> logGrades( classNum )
-
Description
Stores grade data locally for the previous grade featureParameters
Name Type Description classNum
Class number to log grade Details
-
<static> settings( [ forceRerenderDashboard ] )
-
Description
Opens the settings pageParameters
Name Type Attributes Description forceRerenderDashboard
boolean <optional> If this is true, the dashboard settings will be re-rendered Details
-
<static> settingsReloadWarning()
-
Description
Enables the reload warning when the user exists settingsDetails
-
<static> dangerousCBLPrompt( [ accepted ] )
-
Description
Prompts for dangerous CBL enablementParameters
Name Type Attributes Description accepted
boolean <optional> True if the disclaimer has been accepted Details
-
<static> renderGradesInSettings()
-
Description
Renders the grades tab in settingsDetails
-
<static> saveDashboardPrefs()
-
Description
Saves dashboard prefrencesDetails
-
<static> resetDashboardPrefs()
-
Description
Resets dashboard prefrencesDetails
-
<static> classicEntry()
-
Description
Redirects to DTPS classic editionDetails
-
<static> loadDashboardPrefs()
-
Description
Loads dashboard prefrencesDetails
-
<static> render()
-
Description
Renders initial static DTPS HTMLDetails
-
<static> setSearchBox()
-
Description
Sets the search box text based on the current page or keywordsDetails
-
<static> renderLite()
-
Description
Renders basic content after the user has been loadedDetails
-
<static> closeScreen()
-
Description
A callback for blocking Fluid UI card closesDetails