Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
62a25824
Commit
62a25824
authored
Dec 02, 2013
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1765 from edx/gprice/inline-discussion-a11y
Improve accessibility of inline discussions
parents
7fa7641c
81798dd8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
19 deletions
+28
-19
CHANGELOG.rst
+2
-0
common/static/coffee/src/discussion/discussion_module_view.coffee
+4
-0
common/static/coffee/src/discussion/utils.coffee
+11
-3
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+2
-11
common/static/coffee/src/discussion/views/discussion_thread_profile_view.coffee
+2
-1
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
+4
-2
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
+2
-1
lms/templates/discussion/_discussion_module.html
+1
-1
No files found.
CHANGELOG.rst
View file @
62a25824
...
@@ -27,6 +27,8 @@ Studio: Continued modification of Studio pages to follow a RESTful framework.
...
@@ -27,6 +27,8 @@ Studio: Continued modification of Studio pages to follow a RESTful framework.
includes Settings pages, edit page for Subsection and Unit, and interfaces
includes Settings pages, edit page for Subsection and Unit, and interfaces
for updating xblocks (xmodules) and getting their editing HTML.
for updating xblocks (xmodules) and getting their editing HTML.
LMS: Improve accessibility of inline discussions in courseware.
Blades: Put 2nd "Hide output" button at top of test box & increase text size for
Blades: Put 2nd "Hide output" button at top of test box & increase text size for
code response questions. BLD-126.
code response questions. BLD-126.
...
...
common/static/coffee/src/discussion/discussion_module_view.coffee
View file @
62a25824
...
@@ -2,6 +2,8 @@ if Backbone?
...
@@ -2,6 +2,8 @@ if Backbone?
class
@
DiscussionModuleView
extends
Backbone
.
View
class
@
DiscussionModuleView
extends
Backbone
.
View
events
:
events
:
"click .discussion-show"
:
"toggleDiscussion"
"click .discussion-show"
:
"toggleDiscussion"
"keypress .discussion-show"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleDiscussion
)
"click .new-post-btn"
:
"toggleNewPost"
"click .new-post-btn"
:
"toggleNewPost"
"click .new-post-cancel"
:
"hideNewPost"
"click .new-post-cancel"
:
"hideNewPost"
"click .discussion-paginator a"
:
"navigateToPage"
"click .discussion-paginator a"
:
"navigateToPage"
...
@@ -70,6 +72,7 @@ if Backbone?
...
@@ -70,6 +72,7 @@ if Backbone?
DiscussionUtil
.
safeAjax
DiscussionUtil
.
safeAjax
$elem
:
$elem
$elem
:
$elem
$loading
:
$elem
$loading
:
$elem
takeFocus
:
true
url
:
url
url
:
url
type
:
"GET"
type
:
"GET"
dataType
:
'json'
dataType
:
'json'
...
@@ -77,6 +80,7 @@ if Backbone?
...
@@ -77,6 +80,7 @@ if Backbone?
error
:
error
error
:
error
renderDiscussion
:
(
$elem
,
response
,
textStatus
,
discussionId
)
=>
renderDiscussion
:
(
$elem
,
response
,
textStatus
,
discussionId
)
=>
$elem
.
focus
()
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
DiscussionUtil
.
loadRoles
(
response
.
roles
)
DiscussionUtil
.
loadRoles
(
response
.
roles
)
...
...
common/static/coffee/src/discussion/utils.coffee
View file @
62a25824
...
@@ -2,9 +2,12 @@ $ ->
...
@@ -2,9 +2,12 @@ $ ->
if
!
window
.
$
$contents
if
!
window
.
$
$contents
window
.
$
$contents
=
{}
window
.
$
$contents
=
{}
$
.
fn
.
extend
$
.
fn
.
extend
loading
:
->
loading
:
(
takeFocus
)
->
@
$_loading
=
$
(
"<div class='loading-animation'><span class='sr'>Loading content</span></div>"
)
@
$_loading
=
$
(
"<div class='loading-animation'
tabindex='0'
><span class='sr'>Loading content</span></div>"
)
$
(
this
).
after
(
@
$_loading
)
$
(
this
).
after
(
@
$_loading
)
if
takeFocus
DiscussionUtil
.
makeFocusTrap
(
@
$_loading
)
@
$_loading
.
focus
()
loaded
:
->
loaded
:
->
@
$_loading
.
remove
()
@
$_loading
.
remove
()
...
@@ -87,6 +90,11 @@ class @DiscussionUtil
...
@@ -87,6 +90,11 @@ class @DiscussionUtil
"notifications_status"
:
"/notification_prefs/status"
"notifications_status"
:
"/notification_prefs/status"
}[
name
]
}[
name
]
@
activateOnEnter
:
(
event
,
func
)
->
if
event
.
which
==
13
e
.
preventDefault
()
func
(
event
)
@
makeFocusTrap
:
(
elem
)
->
@
makeFocusTrap
:
(
elem
)
->
elem
.
keydown
(
elem
.
keydown
(
(
event
)
->
(
event
)
->
...
@@ -127,7 +135,7 @@ class @DiscussionUtil
...
@@ -127,7 +135,7 @@ class @DiscussionUtil
if
params
[
"loadingCallback"
]
?
if
params
[
"loadingCallback"
]
?
params
[
"loadingCallback"
].
apply
(
params
[
"$loading"
])
params
[
"loadingCallback"
].
apply
(
params
[
"$loading"
])
else
else
params
[
"$loading"
].
loading
()
params
[
"$loading"
].
loading
(
params
[
"takeFocus"
]
)
if
!
params
[
"error"
]
if
!
params
[
"error"
]
params
[
"error"
]
=
=>
params
[
"error"
]
=
=>
@
discussionAlert
(
@
discussionAlert
(
...
...
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
62a25824
...
@@ -4,7 +4,8 @@ if Backbone?
...
@@ -4,7 +4,8 @@ if Backbone?
events
:
events
:
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"keypress .discussion-flag-abuse"
:
"toggleFlagAbuseKeypress"
"keypress .discussion-flag-abuse"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleFlagAbuse
)
attrRenderer
:
attrRenderer
:
endorsed
:
(
endorsed
)
->
endorsed
:
(
endorsed
)
->
...
@@ -106,11 +107,6 @@ if Backbone?
...
@@ -106,11 +107,6 @@ if Backbone?
@
model
.
bind
(
'change'
,
@
renderPartialAttrs
,
@
)
@
model
.
bind
(
'change'
,
@
renderPartialAttrs
,
@
)
toggleFollowingKeypress
:
(
event
)
->
# Activate on spacebar or enter
if
event
.
which
==
32
or
event
.
which
==
13
@
toggleFollowing
(
event
)
toggleFollowing
:
(
event
)
->
toggleFollowing
:
(
event
)
->
event
.
preventDefault
()
event
.
preventDefault
()
$elem
=
$
(
event
.
target
)
$elem
=
$
(
event
.
target
)
...
@@ -126,11 +122,6 @@ if Backbone?
...
@@ -126,11 +122,6 @@ if Backbone?
url
:
url
url
:
url
type
:
"POST"
type
:
"POST"
toggleFlagAbuseKeypress
:
(
event
)
->
# Activate on spacebar or enter
if
event
.
which
==
32
or
event
.
which
==
13
@
toggleFlagAbuse
(
event
)
toggleFlagAbuse
:
(
event
)
->
toggleFlagAbuse
:
(
event
)
->
event
.
preventDefault
()
event
.
preventDefault
()
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
isFlagModerator
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
isFlagModerator
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
...
...
common/static/coffee/src/discussion/views/discussion_thread_profile_view.coffee
View file @
62a25824
...
@@ -4,7 +4,8 @@ if Backbone?
...
@@ -4,7 +4,8 @@ if Backbone?
events
:
events
:
"click .discussion-vote"
:
"toggleVote"
"click .discussion-vote"
:
"toggleVote"
"click .action-follow"
:
"toggleFollowing"
"click .action-follow"
:
"toggleFollowing"
"keypress .action-follow"
:
"toggleFollowingKeypress"
"keypress .action-follow"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleFollowing
)
"click .expand-post"
:
"expandPost"
"click .expand-post"
:
"expandPost"
"click .collapse-post"
:
"collapsePost"
"click .collapse-post"
:
"collapsePost"
...
...
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
62a25824
...
@@ -4,10 +4,12 @@ if Backbone?
...
@@ -4,10 +4,12 @@ if Backbone?
events
:
events
:
"click .discussion-vote"
:
"toggleVote"
"click .discussion-vote"
:
"toggleVote"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"keypress .discussion-flag-abuse"
:
"toggleFlagAbuseKeypress"
"keypress .discussion-flag-abuse"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleFlagAbuse
)
"click .admin-pin"
:
"togglePin"
"click .admin-pin"
:
"togglePin"
"click .action-follow"
:
"toggleFollowing"
"click .action-follow"
:
"toggleFollowing"
"keypress .action-follow"
:
"toggleFollowingKeypress"
"keypress .action-follow"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleFollowing
)
"click .action-edit"
:
"edit"
"click .action-edit"
:
"edit"
"click .action-delete"
:
"_delete"
"click .action-delete"
:
"_delete"
"click .action-openclose"
:
"toggleClosed"
"click .action-openclose"
:
"toggleClosed"
...
...
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
62a25824
...
@@ -6,7 +6,8 @@ if Backbone?
...
@@ -6,7 +6,8 @@ if Backbone?
"click .action-delete"
:
"_delete"
"click .action-delete"
:
"_delete"
"click .action-edit"
:
"edit"
"click .action-edit"
:
"edit"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
"keypress .discussion-flag-abuse"
:
"toggleFlagAbuseKeypress"
"keypress .discussion-flag-abuse"
:
(
event
)
->
DiscussionUtil
.
activateOnEnter
(
event
,
toggleFlagAbuse
)
$
:
(
selector
)
->
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
@
$el
.
find
(
selector
)
...
...
lms/templates/discussion/_discussion_module.html
View file @
62a25824
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
<
%
include
file=
"_underscore_templates.html"
/>
<
%
include
file=
"_underscore_templates.html"
/>
<div
class=
"discussion-module"
data-discussion-id=
"${discussion_id | h}"
>
<div
class=
"discussion-module"
data-discussion-id=
"${discussion_id | h}"
>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
data-discussion-id=
"${discussion_id | h}"
><span
class=
"show-hide-discussion-icon"
></span><span
class=
"button-text"
>
Show Discussion
</span></a>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
data-discussion-id=
"${discussion_id | h}"
role=
"button"
><span
class=
"show-hide-discussion-icon"
></span><span
class=
"button-text"
>
Show Discussion
</span></a>
<a
href=
"#"
class=
"new-post-btn"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
<a
href=
"#"
class=
"new-post-btn"
><span
class=
"icon icon-edit new-post-icon"
></span>
${_("New Post")}
</a>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment