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
79519b7a
Commit
79519b7a
authored
Dec 11, 2013
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address comments.
parent
418d6fa9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
CHANGELOG.rst
+2
-0
common/lib/xmodule/xmodule/js/src/capa/imageinput.js
+18
-13
No files found.
CHANGELOG.rst
View file @
79519b7a
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
the top. Include a label indicating the component affected.
Blades: Fix bug when Image mapping problems are not working for students in IE. BLD-413.
Blades: Add template that displays the most up-to-date features of
Blades: Add template that displays the most up-to-date features of
drag-and-drop. BLD-479.
drag-and-drop. BLD-479.
...
...
common/lib/xmodule/xmodule/js/src/capa/imageinput.js
View file @
79519b7a
...
@@ -4,19 +4,24 @@
...
@@ -4,19 +4,24 @@
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// click on image,
return
coordinates
// click on image,
update
coordinates
// put a dot at location of click, on imag
// put a dot at location of click, on imag
e
window
.
image_input_click
=
function
(
id
,
event
){
window
.
image_input_click
=
function
(
id
,
event
)
{
iidiv
=
document
.
getElementById
(
"imageinput_"
+
id
);
var
iidiv
=
document
.
getElementById
(
"imageinput_"
+
id
),
pos_x
=
event
.
offsetX
?(
event
.
offsetX
):
event
.
pageX
-
iidiv
.
offsetLeft
;
pos_x
=
event
.
offsetX
?
(
event
.
offsetX
)
:
event
.
pageX
-
iidiv
.
offsetLeft
,
pos_y
=
event
.
offsetY
?(
event
.
offsetY
):
event
.
pageY
-
iidiv
.
offsetTop
;
pos_y
=
event
.
offsetY
?
(
event
.
offsetY
)
:
event
.
pageY
-
iidiv
.
offsetTop
,
result
=
"["
+
Math
.
round
(
pos_x
)
+
","
+
Math
.
round
(
pos_y
)
+
"]"
;
// To reduce differences between values returned by different kinds of
cx
=
(
pos_x
-
15
)
+
"px"
;
// browsers, we round `pos_x` and `pos_y`.
cy
=
(
pos_y
-
15
)
+
"px"
;
// IE10: `pos_x` and `pos_y` - float.
// Chrome, FF: `pos_x` and `pos_y` - integers.
result
=
"["
+
Math
.
round
(
pos_x
)
+
","
+
Math
.
round
(
pos_y
)
+
"]"
,
cx
=
(
pos_x
-
15
)
+
"px"
,
cy
=
(
pos_y
-
15
)
+
"px"
,
cross
=
document
.
getElementById
(
"cross_"
+
id
);
document
.
getElementById
(
"cross_"
+
id
)
.
style
.
left
=
cx
;
cross
.
style
.
left
=
cx
;
document
.
getElementById
(
"cross_"
+
id
)
.
style
.
top
=
cy
;
cross
.
style
.
top
=
cy
;
document
.
getElementById
(
"cross_"
+
id
)
.
style
.
visibility
=
"visible"
;
cross
.
style
.
visibility
=
"visible"
;
document
.
getElementById
(
"input_"
+
id
).
value
=
result
;
document
.
getElementById
(
"input_"
+
id
).
value
=
result
;
};
};
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