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
a1f0679f
Commit
a1f0679f
authored
Nov 28, 2017
by
Sofiya Semenova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Educator 1552 - Implement roving tabindex for WYSIWYG editor for discussions
parent
f9623fc9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
3 deletions
+44
-3
common/static/common/js/discussion/utils.js
+35
-0
common/static/common/js/discussion/views/discussion_thread_view.js
+4
-1
common/static/common/js/discussion/views/new_post_view.js
+4
-1
lms/static/js/Markdown.Editor.js
+0
-0
scripts/all-tests.sh
+1
-1
No files found.
common/static/common/js/discussion/utils.js
View file @
a1f0679f
...
...
@@ -7,6 +7,9 @@
DiscussionUtil
.
wmdEditors
=
{};
DiscussionUtil
.
leftKey
=
37
;
DiscussionUtil
.
rightKey
=
39
;
DiscussionUtil
.
getTemplate
=
function
(
id
)
{
return
$
(
'script#'
+
id
).
html
();
};
...
...
@@ -539,6 +542,38 @@
};
};
DiscussionUtil
.
handleKeypressInToolbar
=
function
(
event
)
{
var
$currentButton
,
$nextButton
,
$toolbar
,
$allButtons
,
keyPressed
,
nextIndex
,
currentButtonIndex
,
validKeyPress
,
toolbarHasButtons
;
$currentButton
=
$
(
event
.
target
);
keyPressed
=
event
.
which
||
event
.
keyCode
;
$toolbar
=
$currentButton
.
parent
();
$allButtons
=
$toolbar
.
children
(
'.wmd-button'
);
validKeyPress
=
keyPressed
===
this
.
leftKey
||
keyPressed
===
this
.
rightKey
;
toolbarHasButtons
=
$allButtons
.
length
>
0
;
if
(
validKeyPress
&&
toolbarHasButtons
)
{
currentButtonIndex
=
$allButtons
.
index
(
$currentButton
);
nextIndex
=
keyPressed
===
this
.
leftKey
?
currentButtonIndex
-
1
:
currentButtonIndex
+
1
;
nextIndex
=
Math
.
max
(
Math
.
min
(
nextIndex
,
$allButtons
.
length
-
1
),
0
);
$nextButton
=
$
(
$allButtons
[
nextIndex
]);
this
.
moveSelectionToNextItem
(
$currentButton
,
$nextButton
);
}
};
DiscussionUtil
.
moveSelectionToNextItem
=
function
(
prevItem
,
nextItem
)
{
prevItem
.
attr
(
'aria-selected'
,
'false'
);
prevItem
.
attr
(
'tabindex'
,
'-1'
);
nextItem
.
attr
(
'aria-selected'
,
'true'
);
nextItem
.
attr
(
'tabindex'
,
'0'
);
nextItem
.
focus
();
};
return
DiscussionUtil
;
}).
call
(
this
);
}).
call
(
window
);
common/static/common/js/discussion/views/discussion_thread_view.js
View file @
a1f0679f
...
...
@@ -62,7 +62,10 @@
DiscussionThreadView
.
prototype
.
events
=
{
'click .discussion-submit-post'
:
'submitComment'
,
'click .add-response-btn'
:
'scrollToAddResponse'
'click .add-response-btn'
:
'scrollToAddResponse'
,
'keydown .wmd-button'
:
function
(
event
)
{
return
DiscussionUtil
.
handleKeypressInToolbar
(
event
);
}
};
DiscussionThreadView
.
prototype
.
$
=
function
(
selector
)
{
...
...
common/static/common/js/discussion/views/new_post_view.js
View file @
a1f0679f
...
...
@@ -137,7 +137,10 @@
'change .post-option-input'
:
'postOptionChange'
,
'click .cancel'
:
'cancel'
,
'click .add-post-cancel'
:
'cancel'
,
'reset .forum-new-post-form'
:
'updateStyles'
'reset .forum-new-post-form'
:
'updateStyles'
,
'keydown .wmd-button'
:
function
(
event
)
{
return
DiscussionUtil
.
handleKeypressInToolbar
(
event
);
}
};
NewPostView
.
prototype
.
toggleGroupDropdown
=
function
(
$target
)
{
...
...
lms/static/js/Markdown.Editor.js
View file @
a1f0679f
This diff is collapsed.
Click to expand it.
scripts/all-tests.sh
View file @
a1f0679f
...
...
@@ -13,7 +13,7 @@ set -e
# Violations thresholds for failing the build
export
LOWER_PYLINT_THRESHOLD
=
1000
export
UPPER_PYLINT_THRESHOLD
=
5900
export
ESLINT_THRESHOLD
=
9
134
export
ESLINT_THRESHOLD
=
9
543
export
STYLELINT_THRESHOLD
=
973
XSSLINT_THRESHOLDS
=
`
cat
scripts/xsslint_thresholds.json
`
...
...
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