v2.9.1
diff --git a/docs/static/jsdoc/scripts_pages-discussions.js.html b/docs/static/jsdoc/scripts_pages-discussions.js.html
new file mode 100644
index 0000000..801008c
--- /dev/null
+++ b/docs/static/jsdoc/scripts_pages-discussions.js.html
@@ -0,0 +1,455 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Source: scripts/pages-discussions.js</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Source: scripts/pages-discussions.js</h1>
+
+    
+
+
+
+    
+    <section>
+        <article>
+            <pre class="prettyprint source linenums"><code>/**
+ * @file DTPS pages &amp; discussion functions
+ * @author jottocraft
+ * 
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+
+/**
+ * Renders the discussions list for a class
+ * 
+ * @param {string} courseID The course ID to render discussion threads for
+ */
+dtps.loadThreadsList = function (courseID) {
+    //Get class index and set as selected class
+    var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
+    dtps.selectedClass = classNum;
+
+    //Set discussions as the selected content
+    dtps.selectedContent = "discuss";
+    $("#dtpsTabBar .btn").removeClass("active");
+    $("#dtpsTabBar .btn.discuss").addClass("active");
+
+    if (classNum == -1) {
+        //Class does not exist
+        dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadThreadsList");
+    }
+
+    //Load class color and things
+    dtps.presentClass(classNum);
+    jQuery("body").removeClass("collapsedSidebar");
+
+    if ((dtps.selectedClass == classNum) &amp;&amp; (dtps.selectedContent == "discuss")) {
+        //Render sidebar
+        jQuery(".sidebar").html(/*html*/`
+            &lt;div class="bigLogo" style="text-align: center; margin: 10px 0 20px; height: 38px;">
+                &lt;i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">forum&lt;/i>
+                &lt;h4 style="color: var(--text); display: inline-block; font-size: 28px; vertical-align: middle; margin: 0px;">Discussions&lt;/h4>
+            &lt;/div>
+                        
+            &lt;div class="items">
+                &lt;div class="spinner">&lt;/div>
+            &lt;/div>
+        `);
+
+        //Delete existing class content HTML
+        jQuery(".classContent").html("");
+    }
+
+    //Fetch discussion thread data
+    dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].id).then(function (threadData) {
+        //Store fetched data to the selected class
+        dtps.classes[classNum].discussions = threadData;
+
+        if (dtps.classes[classNum].discussions.length == 0) {
+            //No discussion topics in this class
+            jQuery(".sidebar .items").html(/*html*/`
+                &lt;div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
+                    &lt;span class="label">Classes&lt;/span>
+                    &lt;div class="icon">
+                        &lt;i class="material-icons">keyboard_arrow_left&lt;/i>
+                    &lt;/div>
+                &lt;/div>
+
+                &lt;p style="text-align: center; font-weight: bold; margin-top: 60px;">No discussions found&lt;/p>
+                &lt;p style="text-align: center; font-size: 14px;">There aren't any discussion topics&lt;/p>
+            `);
+        } else {
+            //Loop over discusson threads array to create discussion thread HTML for the sidebar
+            var discussionHTML = dtps.classes[classNum].discussions.map(discussionThread => {
+                return /*html*/`
+                    &lt;div data-threadID="${discussionThread.id}" class="class item">
+                        &lt;span class="label">${discussionThread.title}&lt;/span>
+                        &lt;div class="icon">
+                            &lt;i style="font-family: 'Material Icons Extended';" class="material-icons">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}&lt;/i>
+                        &lt;/div>
+                    &lt;/div>
+                `;
+            }).join("");
+
+            //Render discussion threads in the sidebar
+            if ((dtps.selectedClass == classNum) &amp;&amp; (dtps.selectedContent == "discuss")) {
+                jQuery(".sidebar .items").html(/*html*/`
+                    &lt;div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="class item main back">
+                        &lt;span class="label">Classes&lt;/span>
+                        &lt;div class="icon">
+                            &lt;i class="material-icons">keyboard_arrow_left&lt;/i>
+                        &lt;/div>
+                    &lt;/div>
+
+                    ${
+                    dtps.classes[classNum].newDiscussionThreadURL ? (/*html*/`
+                            &lt;div onclick="window.open('${dtps.classes[classNum].newDiscussionThreadURL}')" class="class item back">
+                                &lt;span class="label">New discussion&lt;/span>
+                                &lt;div class="icon">
+                                    &lt;i class="material-icons">add&lt;/i>
+                                &lt;/div>
+                            &lt;/div>
+                        `) : ""
+                    }
+
+                    &lt;div class="divider">&lt;/div>
+
+                    ${discussionHTML}
+                `);
+            }
+
+            //Add click event listeners for discussion threads
+            $(".class:not(.back)").click(function (event) {
+                //Show the selected thread as active
+                $(this).siblings().removeClass("active");
+                $(this).addClass("active");
+
+                //Get thread ID from HTML attribute
+                var postID = $(this).attr("data-threadID");
+
+                //Load the thread
+                dtps.loadThreadPosts(classNum, postID);
+            });
+        }
+
+    }).catch(function (err) {
+        dtps.error("Could not fetch discussion threads", "Caught promise rejection @ dtps.loadThreadsList", err);
+    });
+}
+
+/**
+ * Fetches and displays posts in a discussion
+ * 
+ * @param {number} classNum The class number to render
+ * @param {string} threadID The discussion thread to render
+ */
+dtps.loadThreadPosts = function (classNum, threadID) {
+    //Show loading indicator
+    if ((dtps.selectedClass == classNum) &amp;&amp; (dtps.selectedContent == "discuss")) {
+        jQuery(".classContent").html(`&lt;div class="spinner">&lt;/div>`);
+    }
+
+    //Get discussion data
+    var thread = {};
+    dtps.classes[classNum].discussions.forEach(discussionThread => {
+        if (discussionThread.id == threadID) {
+            thread = discussionThread;
+        }
+    });
+
+    //Fetch discussion posts from the LMS
+    dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].id, threadID).then(function (postData) {
+        //Store posts in the discussion thread
+        thread.posts = postData;
+
+        //Post HTML array
+        var postHTML = [];
+
+        thread.posts.forEach((post, index) => {
+            //Get background and text color for iFrame content
+            var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+            var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
+
+            //Create a new blob data URL with the post's content
+            var blob = new Blob([`
+                    &lt;base target="_blank" /> 
+                    &lt;link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+                    &lt;style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};&lt;/style>
+                    ${post.body}
+                `], { type: 'text/html' });
+            var discussionPostContentURL = window.URL.createObjectURL(blob);
+
+            //Create HTML for replies
+            var replyHTML = [];
+            if (post.replies) {
+                //Add space above replies
+                replyHTML.push(`&lt;br />`);
+
+                //Get HTML for each reply and add to array
+                post.replies.forEach(reply => {
+                    replyHTML.push(/*html*/`
+                        &lt;div style="margin-left: ${(reply.depth || 0) * 50}px;" class="discussionReply">
+                            &lt;div class="discussionHeader">
+                                ${post.author ? /*html*/`
+                                    &lt;img src="${reply.author.photoURL}" />
+                                    &lt;h5>${reply.author.name}&lt;/h5>
+                                ` : ``}
+                                
+                                &lt;span style="cursor: pointer;" onclick="window.open('${reply.replyURL}')">
+                                    &lt;i class="material-icons">reply&lt;/i>
+                                    &lt;span>Reply&lt;/span>
+                                &lt;/span>
+                            &lt;/div>
+
+                            ${reply.body}
+                        &lt;/div>
+                    `)
+                });
+
+                //Add space below replies
+                replyHTML.push(`&lt;br />`);
+            }
+
+            //Create HTML for this post
+            //Note that index == 0 is the initial post
+            postHTML.push(/*html*/`
+                    &lt;div class="card" style="margin-top: 20px;${index == 0 ? "margin-bottom: 75px;" : "padding: 20px 30px;"}">
+                        &lt;!-- Thread title (Initial post) -->
+                        ${index == 0 ? /*html*/`
+                            &lt;h4 style="font-weight: bold">${thread.title}&lt;/h4>
+                        ` : ''}
+
+                        &lt;!-- Author header -->
+                        &lt;div ${index == 0 ? `style="margin-bottom: 32px;"` : ""} class="discussionHeader">
+                            ${post.author ? /*html*/`
+                                &lt;img src="${post.author.photoURL}" />
+                                &lt;h5>${post.author.name}&lt;/h5>
+                            ` : ``}
+
+                            &lt;i class="material-icons">calendar_today&lt;/i>
+                            &lt;span>${dtps.formatDate(post.postedAt)}&lt;/span>
+
+                            &lt;!-- Thread info (initial post) -->
+                            ${index == 0 ? /*html*/`
+                                ${thread.locked ? `&lt;i class="material-icons">lock&lt;/i>` : ""}
+                                ${thread.requireInitialPost ? /*html*/`
+                                    &lt;i class="material-icons">visibility&lt;/i>
+                                    &lt;span>You must post before you can see other replies&lt;/span>
+                                ` : ""}
+                            ` : ''}
+                        &lt;/div>
+         
+                        ${post.body}
+
+                        ${replyHTML.join("")}
+
+                        &lt;!-- Reply / Add post footer -->
+                        ${post.replyURL ? /*html*/`
+                            &lt;div ${index == 0 ? `style="margin-top: 32px;"` : ""} class="discussionFooter">
+                                ${index == 0 ? /*html*/`
+                                    &lt;button onclick="window.open('${post.replyURL}')" class="btn small">&lt;i class="material-icons">post_add&lt;/i> Add Post&lt;/button>
+                                ` : /*html*/`
+                                    &lt;button onclick="window.open('${post.replyURL}')" class="btn small">&lt;i class="material-icons">reply&lt;/i> Reply&lt;/button>
+                                `}
+                            &lt;/div> 
+                        ` : ""}
+                    &lt;/div>
+                `);
+        });
+
+        //Render HTML
+        jQuery(".classContent").html(postHTML.join(""));
+    }).catch(function (err) {
+        dtps.error("Could not fetch discussion posts", "Caught promise rejection @ dtps.loadThreadPosts", err);
+    });
+}
+
+/**
+ * Renders the pages list for a class
+ * 
+ * @param {string} courseID The course ID to render pages for
+ */
+dtps.loadPages = function (courseID) {
+    //Get class index and set as selected class
+    var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
+    dtps.selectedClass = classNum;
+
+    //Set pages as the selected content
+    dtps.selectedContent = "pages";
+    $("#dtpsTabBar .btn").removeClass("active");
+    $("#dtpsTabBar .btn.pages").addClass("active");
+
+    if (classNum == -1) {
+        //Class does not exist
+        dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadPages");
+    }
+
+    //Load class color and things
+    dtps.presentClass(classNum);
+    jQuery("body").removeClass("collapsedSidebar");
+
+    if ((dtps.selectedClass == classNum) &amp;&amp; (dtps.selectedContent == "pages")) {
+        //Render sidebar
+        jQuery(".sidebar").html(/*html*/`
+            &lt;div class="bigLogo" style="text-align: center; margin: 10px 0 20px; height: 38px;">
+                &lt;i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">insert_drive_file&lt;/i>
+                &lt;h4 style="color: var(--text); display: inline-block; font-size: 28px; vertical-align: middle; margin: 0px;">Pages&lt;/h4>
+            &lt;/div>
+                        
+            &lt;div class="items">
+                &lt;div class="spinner">&lt;/div>
+            &lt;/div>
+        `);
+
+        //Delete existing class content HTML
+        jQuery(".classContent").html("");
+    }
+
+    dtpsLMS.fetchPages(dtps.classes[classNum].id).then(function (pagesData) {
+        if (data.error) {
+            jQuery(".sidebar").html(`&lt;div onclick="dtps.selectedContent = 'stream'; dtps.chroma(); dtps.classStream(dtps.selectedClass);" class="class item main back">
+            &lt;span class="label">Classes&lt;/span>
+            &lt;div class="icon">&lt;i class="material-icons">keyboard_arrow_left&lt;/i>&lt;/div>
+            &lt;/div>
+    &lt;div class="divider">&lt;/div>
+  &lt;h5 style="text-align: center; font-weight: bold;">No pages found&lt;/h5>&lt;p style="text-align: center;">This class doesn't have any pages&lt;/p>`)
+        } else {
+            dtps.classes[num].pages = [];
+            dtps.classes[num].pagelist = [];
+            for (var i = 0; i &lt; data.length; i++) {
+                dtps.classes[num].pages.push({
+                    id: data[i].page_id,
+                    title: data[i].title,
+                    content: "",
+                    num: i
+                });
+                dtps.classes[num].pagelist.push(`
+      &lt;div onclick="dtps.selectedPage = ` + data[i].page_id + `" class="class item ` + data[i].page_id + `">
+      &lt;span class="label">` + data[i].title + `&lt;/span>
+      &lt;div class="icon">&lt;i class="material-icons">notes&lt;/i>&lt;/div>
+      &lt;/div>
+      `);
+            }
+            if ((dtps.selectedClass == num) &amp;&amp; (dtps.selectedContent == "pages")) {
+                jQuery(".sidebar").html(`&lt;div onclick="dtps.selectedContent = 'stream'; dtps.chroma(); dtps.classStream(dtps.selectedClass);" class="class item main back">
+      &lt;span class="label">Classes&lt;/span>
+      &lt;div class="icon">&lt;i class="material-icons">keyboard_arrow_left&lt;/i>&lt;/div>
+      &lt;/div>
+      &lt;div class="divider">&lt;/div>
+    ` + dtps.classes[num].pagelist.join(""))
+            }
+
+            $(".class:not(.back)").click(function (event) {
+                $(this).siblings().removeClass("active")
+                $(this).addClass("active")
+                dtps.getPage(dtps.classes[dtps.selectedClass].id, dtps.selectedPage);
+            });
+        }
+    });
+}
+
+//Loads a page
+dtps.getPage = function (classID, id, fromModuleStream) {
+    if (id == undefined) var id = dtps.selectedPage;
+    if ((dtps.classes[dtps.selectedClass].id == classID) &amp;&amp; ((dtps.selectedContent == "pages") || fromModuleStream)) {
+        jQuery(".classContent").html(`&lt;div class="spinner">&lt;/div>`);
+    }
+    var spinnerTmp = true;
+    dtps.webReq("canvas", "/api/v1/courses/" + classID + "/pages/" + id, function (resp) {
+        var data = JSON.parse(resp);
+        if ((dtps.classes[dtps.selectedClass].id == classID) &amp;&amp; ((dtps.selectedContent == "pages") || fromModuleStream)) {
+            var blob = new Blob([`&lt;base target="_blank" /> &lt;link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+                &lt;style>body {background-color: ` + getComputedStyle($(".card.details")[0]).getPropertyValue("--cards") + `; color: ` + getComputedStyle($(".card.details")[0]).getPropertyValue("--text") + `}&lt;/style>` + data.body], { type: 'text/html' });
+            var newurl = window.URL.createObjectURL(blob);
+            jQuery(".classContent").html((fromModuleStream ? `&lt;div class="acrylicMaterial" onclick="dtps.moduleStream(dtps.selectedClass)" style="line-height: 40px;display:  inline-block;border-radius: 20px;margin: 82px 0px 0px 82px; cursor: pointer;">
+                &lt;div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 20px;">&lt;i style="vertical-align: middle;" class="material-icons">keyboard_arrow_left&lt;/i> Back&lt;/div>&lt;/div>` : "") + `
+        &lt;div class="card">
+       &lt;h4 style="font-weight: bold;">` + data.title + `&lt;/h4>
+       &lt;br />
+       &lt;iframe id="classPageIframe" onload="dtps.iframeLoad('classPageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="` + newurl + `" />
+        &lt;/div>
+      `);
+        }
+    });
+}
+
+//Fluid UI screen definitions
+fluid.externalScreens.discussions = (courseID) => {
+    dtps.loadThreadsList(courseID);
+}
+
+fluid.externalScreens.pages = (courseID) => {
+    dtps.loadPages(courseID);
+}
+
+//Type definitions
+
+/**
+* @typedef {Object} DiscussionThread
+* @description Defines discussion thread objects in DTPS
+* @property {string} title Title of the discussion thread
+* @property {string} id Discussion thread ID
+* @property {DiscussionPost[]} posts Posts in this thread, with the initial one first. Assume that the topic has not been selected and loaded if this is undefined, and that there are no posts if this is an empty array.
+* @property {boolean} [locked] True if posting to the discussion thread is locked
+* @property {boolean} [requireInitialPost] True if the user must post before viewing others' posts
+*/
+
+/**
+* @typedef {Object} DiscussionPost
+* @description Defines discussion post objects in DTPS
+* @property {string} id Discussion post ID
+* @property {string} body Discussion post body HTML
+* @property {Date} postedAt Date for when the post was posted
+* @property {number} [depth] The depth level this post is
+* @property {User} [author] Discussion post author
+* @property {DiscussionPost[]} [replies] Replies to this post. Nested replies (replies to replies) should be after this post in the array with a depth of 1, not in the replies key.
+* @property {string} [replyURL] A URL that the user can visit to reply to this post
+*/
+
+/**
+* @typedef {Object} Page
+* @description Defines Page objects in DTPS
+* @property {string} title Page title
+* @property {string} id Page ID
+* @property {string} content Page content. Assume the page hasn't been selected/loaded if this is undefined.
+* @property {Date} [updatedAt] When the page was last updated
+* @property {User} [author] Page author
+*/</code></pre>
+        </article>
+    </section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="dtps.html">dtps</a></li><li><a href="dtps.gradeCalc.html">gradeCalc</a></li><li><a href="dtpsLMS.html">dtpsLMS</a></li></ul><h3><a href="global.html">Global</a></h3>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Fri May 29 2020 18:46:27 GMT-0700 (Pacific Daylight Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>