Previously, buttons were activated on pressing Enter, but the expected
behavior is to activate on pressing Space. Several JavaScript errors
that prevented various buttons from properly activating via the keyboard
are also fixed.
This change involves substantial refactoring of the relevant code to
reduce duplication. It also makes the templates for the vote buttons
more consistent and cleaner.
JIRA: FOR-64
A newer version was added to common/, so that is used instead. It is
also added to the set of JS files used in unit tests to allow forums
code in common/ to be tested.
These changes implement STUD-813. The commit consists of the
following logical changes:
- a REST API has been implemented for a course's assets
- the page itself now fetches the assets client-side
- the Backbone.Paginator library is used to support pagination
- the AssetCollection has been refactored to extend
Backbone.Paginator.requestPager so that it can be paged
- an abstract PagingView class has been added to generalize
the communication with a paging REST API
- the AssetsView has been reimplemented to extend PagingView
- two new child views have been added:
- PagingHeader: the paging controls above the list of assets
- PagingFooter: the paging controls below the assets
* matches syntax used when importing Open Sans in LMS/Studio
* simplifies and moves syntax to modern Google Web Font standards
* maintains the http/https agnostic work
This button has been broken for at least a year, so the code has
suffered from bit rot and should be reimplmemented if the feature is
necessary in the short term (which is unlikely since it has been broken
for so long).
The show/hide toggle now properly acts like a button, and focus is now
trapped on the loading element for both the show/hide action and loading
of a new page.
Now the interface will reset apropriately and allow a user to retry
expanding the discussion or loading a new page, and the alert message
will ask the user to retry.
JIRA: FOR-300, FOR-301
For accessibility purposes, it is bad to allow a user to initiate
loading of additional threads in the navigation sidebar and then shift
focus away from the sidebar, only to have focus snap back when the
additional threads are loaded. Now, we trap focus on the loading element
as recommended by our accessibility consultant.
JIRA: FOR-238
When a user attempts to load more threads in the forum navigation
sidebar, reset the state of the world so the user can retry, and alert
the user appropriately.
AJAX requests on forums pages occasionally fail (usually when a request
to the comments service times out), but the user is not made aware of
the failure. This manifests as either the system not appearing to store
state (e.g. if an attempt to flag a post fails) or something taking
forever to load. Now, a modal will pop up to alert the user that a
request has failed and instruct them to reload the page.
In the longer term, we should fix each user gesture that results in an
AJAX call to gracefully handle a failure by resetting the state of the
world appropriately and aleritng the user.
JIRA: FOR-37