Ignore .ignore files

I have rejiggered the .gitignore file so that I can maintain a file with a plaintext copy of the API key and matching instance URL without committing it to Git accidentally.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Non-PHP Javascript

Using global.js to amalgamate my Javascript files, rather than PHP (which our lame web server doesn't support).

Reduce testers list and default to student view of resources menu.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Safer Function Naming Pattern

I realized that just tossing my arbitrarily named Javascript functions into the same namespace as the app that I'm modifying… could end badly.

Now all of my functions are named stmarks_*.

'would be good to move my variables out of that namespace as well, but so far nothing is breaking!

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Hide Pages if Hidden

Seems self-evident, but [this thread](https://help.instructure.com/entries/21422345) on the Canvas Communities highlights an annoying visibility issue: users who can't see the Pages section can still see the whole list of pages if they are on a Page.

This removes those lists from the interface.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Scrollable Faculty Journal

Allow teachers to open a scrollable faculty journal page from their People listing for a course. Inserts a menu and next/prev buttons into the resulting faculty journal page to let teachers scroll through each student in their course, from within the faculty journal.

Signed-off-by: Seth Battis <seth@battis.net>
Timing

Put a delay in before adding the Faculty Journal button (I'm guessing the timing wasn't about the menus -- although we're now dependent on resources-menu.js running ahead of us -- but actually on the sidebar completing loading dynamically.

Whatevs. It works.

Signed-off-by: Seth Battis <seth@battis.net>
Variable Timing

For whatever reason, loading the menu seems to happen slightly sooner than adding the button, which means that the userClass may not have been set yet. Since students can't see the Faculty Journal anyway, no need to check if they're teachers, I guess.

Signed-off-by: Seth Battis <seth@battis.net>
Going Live

Switching over to live instance from the test instance.

Signed-off-by: Seth Battis <seth@battis.net>
Delays no longer arbitrary

Gee, if the problem is that the code needs a particular element or variable to be ready before it runs, howsabout not just guessing how long it _might_ take, but just waiting for it to be ready?

Gosh, Seth, that's a good idea!

Darn right it is. So now the code will simply keep retrying until the elements it needs for its tests are ready and can be used.

For dumb.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Timing Update

Updated hide-future-courses.js to simply keep retrying until the variables and/or DOM elements required are available (as in [dev-faculty-journal](https://github.com/smtech/canvas/commit/38955ef47b33478d0549712689844734dc66001d))

Also, re-added discussion-permalinks.js back into global.js.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Retimed Faculty Journal Button

It is now independent of resources-menu.js (around which there seemed to be some timing issues), but instead simply checking if this is a user who can add people to the class (like a teacher or TA) before adding the Faculty Journal button.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
W3C-compliant

Oy. InnerText is really IE (but everyone except Firefox supports it). innerHTML works better (textContent didn't seem to work at all, even though MDN says it should be used instead of innerText.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Re-Fixing Permission Check

Somehow we reverted back to checking userClass. Should be checking for Add People button.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
All HTTPS, All The Time

Something shifted overnight on October 3, and suddenly Chrome and a few other browsers started to treat this script like a cross-site scripting attack. To get around  that, everything is being accessed via HTTPS now.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Disabled.

Removed the triggering JavaScript from global.js, pending fuller discussion of the use of the Faculty Journal after the Parents' Weekend updates have been completed.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Grading Analytics Button

Add a grading analytics button to the course home page for teachers (only).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Reorganization

Pulling files into better organized directories. Rewrote includes and HREFs to be more durable across different folder organizations.

Added top-level configuration for school information in config.inc.php

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Removing Buggy Redundancy

Fixing some lingering issues from the transition to dev-support.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Restructure dev-faculty-journal

Restructured to Faculty Journal to reflect updated dev-support branch.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Wait for DOM

I got tired of tired retyping the same code again and again, so I put it — finally — in global.js, hopefully in a generalizable form.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>