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
0d7f6306
Commit
0d7f6306
authored
Sep 20, 2013
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #975 from edx/gprice/markdown-button-taborder
Improve accessibility for forums post toolbar
parents
f3f59d0f
ef02450f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
lms/static/js/Markdown.Editor.js
+21
-17
No files found.
lms/static/js/Markdown.Editor.js
View file @
0d7f6306
...
...
@@ -1399,13 +1399,16 @@
var
disabledYShift
=
"-20px"
;
var
highlightYShift
=
"-40px"
;
var
buttonRow
=
document
.
createElement
(
"ul"
);
var
buttonRow
=
document
.
createElement
(
"div"
);
buttonRow
.
setAttribute
(
"role"
,
"toolbar"
);
buttonRow
.
id
=
"wmd-button-row"
+
postfix
;
buttonRow
.
className
=
'wmd-button-row'
;
buttonRow
=
buttonBar
.
appendChild
(
buttonRow
);
var
xPosition
=
0
;
var
makeButton
=
function
(
id
,
title
,
XShift
,
textOp
)
{
var
button
=
document
.
createElement
(
"li"
);
var
button
=
document
.
createElement
(
"span"
);
button
.
setAttribute
(
"role"
,
"button"
);
button
.
tabIndex
=
0
;
button
.
className
=
"wmd-button"
;
button
.
style
.
left
=
xPosition
+
"px"
;
xPosition
+=
25
;
...
...
@@ -1421,46 +1424,47 @@
return
button
;
};
var
makeSpacer
=
function
(
num
)
{
var
spacer
=
document
.
createElement
(
"li"
);
var
spacer
=
document
.
createElement
(
"span"
);
spacer
.
setAttribute
(
"role"
,
"separator"
);
spacer
.
className
=
"wmd-spacer wmd-spacer"
+
num
;
spacer
.
id
=
"wmd-spacer"
+
num
+
postfix
;
buttonRow
.
appendChild
(
spacer
);
xPosition
+=
25
;
}
buttons
.
bold
=
makeButton
(
"wmd-bold-button"
,
"
Strong <strong> Ctrl+B
"
,
"0px"
,
bindCommand
(
"doBold"
));
buttons
.
italic
=
makeButton
(
"wmd-italic-button"
,
"
Emphasis <em> Ctrl+I
"
,
"-20px"
,
bindCommand
(
"doItalic"
));
buttons
.
bold
=
makeButton
(
"wmd-bold-button"
,
"
Bold (Ctrl+B)
"
,
"0px"
,
bindCommand
(
"doBold"
));
buttons
.
italic
=
makeButton
(
"wmd-italic-button"
,
"
Italic (Ctrl+I)
"
,
"-20px"
,
bindCommand
(
"doItalic"
));
makeSpacer
(
1
);
buttons
.
link
=
makeButton
(
"wmd-link-button"
,
"Hyperlink
<a> Ctrl+L
"
,
"-40px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
buttons
.
link
=
makeButton
(
"wmd-link-button"
,
"Hyperlink
(Ctrl+L)
"
,
"-40px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
return
this
.
doLinkOrImage
(
chunk
,
postProcessing
,
false
);
}));
buttons
.
quote
=
makeButton
(
"wmd-quote-button"
,
"Blockquote
<blockquote> Ctrl+Q
"
,
"-60px"
,
bindCommand
(
"doBlockquote"
));
buttons
.
code
=
makeButton
(
"wmd-code-button"
,
"Code Sample
<pre><code> Ctrl+K
"
,
"-80px"
,
bindCommand
(
"doCode"
));
buttons
.
image
=
makeButton
(
"wmd-image-button"
,
"Image
<img> Ctrl+G
"
,
"-100px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
buttons
.
quote
=
makeButton
(
"wmd-quote-button"
,
"Blockquote
(Ctrl+Q)
"
,
"-60px"
,
bindCommand
(
"doBlockquote"
));
buttons
.
code
=
makeButton
(
"wmd-code-button"
,
"Code Sample
(Ctrl+K)
"
,
"-80px"
,
bindCommand
(
"doCode"
));
buttons
.
image
=
makeButton
(
"wmd-image-button"
,
"Image
(Ctrl+G)
"
,
"-100px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
return
this
.
doLinkOrImage
(
chunk
,
postProcessing
,
true
,
imageUploadHandler
);
}));
makeSpacer
(
2
);
buttons
.
olist
=
makeButton
(
"wmd-olist-button"
,
"Numbered List
<ol> Ctrl+O
"
,
"-120px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
buttons
.
olist
=
makeButton
(
"wmd-olist-button"
,
"Numbered List
(Ctrl+O)
"
,
"-120px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
this
.
doList
(
chunk
,
postProcessing
,
true
);
}));
buttons
.
ulist
=
makeButton
(
"wmd-ulist-button"
,
"Bulleted List
<ul> Ctrl+U
"
,
"-140px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
buttons
.
ulist
=
makeButton
(
"wmd-ulist-button"
,
"Bulleted List
(Ctrl+U)
"
,
"-140px"
,
bindCommand
(
function
(
chunk
,
postProcessing
)
{
this
.
doList
(
chunk
,
postProcessing
,
false
);
}));
buttons
.
heading
=
makeButton
(
"wmd-heading-button"
,
"Heading
<h1>/<h2> Ctrl+H
"
,
"-160px"
,
bindCommand
(
"doHeading"
));
buttons
.
hr
=
makeButton
(
"wmd-hr-button"
,
"Horizontal Rule
<hr> Ctrl+R
"
,
"-180px"
,
bindCommand
(
"doHorizontalRule"
));
buttons
.
heading
=
makeButton
(
"wmd-heading-button"
,
"Heading
(Ctrl+H)
"
,
"-160px"
,
bindCommand
(
"doHeading"
));
buttons
.
hr
=
makeButton
(
"wmd-hr-button"
,
"Horizontal Rule
(Ctrl+R)
"
,
"-180px"
,
bindCommand
(
"doHorizontalRule"
));
makeSpacer
(
3
);
buttons
.
undo
=
makeButton
(
"wmd-undo-button"
,
"Undo
- Ctrl+Z
"
,
"-200px"
,
null
);
buttons
.
undo
=
makeButton
(
"wmd-undo-button"
,
"Undo
(Ctrl+Z)
"
,
"-200px"
,
null
);
buttons
.
undo
.
execute
=
function
(
manager
)
{
if
(
manager
)
manager
.
undo
();
};
var
redoTitle
=
/win/
.
test
(
nav
.
platform
.
toLowerCase
())
?
"Redo
- Ctrl+Y
"
:
"Redo
- Ctrl+Shift+Z
"
;
// mac and other non-Windows platforms
"Redo
(Ctrl+Y)
"
:
"Redo
(Ctrl+Shift+Z)
"
;
// mac and other non-Windows platforms
buttons
.
redo
=
makeButton
(
"wmd-redo-button"
,
redoTitle
,
"-220px"
,
null
);
buttons
.
redo
.
execute
=
function
(
manager
)
{
if
(
manager
)
manager
.
redo
();
};
if
(
helpOptions
)
{
var
helpButton
=
document
.
createElement
(
"
li
"
);
var
helpButton
=
document
.
createElement
(
"
span
"
);
var
helpButtonImage
=
document
.
createElement
(
"span"
);
helpButton
.
appendChild
(
helpButtonImage
);
helpButton
.
className
=
"wmd-button wmd-help-button"
;
...
...
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