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
7395e8ab
Commit
7395e8ab
authored
May 15, 2015
by
aamir-khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-1472: fixed the tab issue for taking photo
parent
225f4426
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
lms/static/js/verify_student/views/webcam_photo_view.js
+24
-4
lms/templates/verify_student/webcam_photo.underscore
+2
-2
No files found.
lms/static/js/verify_student/views/webcam_photo_view.js
View file @
7395e8ab
...
...
@@ -2,7 +2,10 @@
* Interface for retrieving webcam photos.
* Supports HTML5 and Flash.
*/
var
edx
=
edx
||
{};
var
edx
=
edx
||
{},
key
=
{
enter
:
13
};
(
function
(
$
,
_
,
Backbone
,
gettext
)
{
'use strict'
;
...
...
@@ -12,6 +15,7 @@
edx
.
verify_student
.
WebcamPhotoView
=
Backbone
.
View
.
extend
({
template
:
"#webcam_photo-tpl"
,
el
:
"#webcam"
,
backends
:
{
"html5"
:
{
...
...
@@ -241,12 +245,18 @@
);
$
(
this
.
el
).
html
(
renderedHtml
);
var
resetBtn
=
this
.
$el
.
find
(
'#webcam_reset_button'
);
var
captureBtn
=
this
.
$el
.
find
(
'#webcam_capture_button'
);
// Install event handlers
$
(
"#webcam_reset_button"
,
this
.
el
).
on
(
'click'
,
_
.
bind
(
this
.
reset
,
this
)
);
$
(
"#webcam_capture_button"
,
this
.
el
).
on
(
'click'
,
_
.
bind
(
this
.
capture
,
this
)
);
resetBtn
.
on
(
'click'
,
_
.
bind
(
this
.
reset
,
this
)
);
captureBtn
.
on
(
'click'
,
_
.
bind
(
this
.
capture
,
this
)
);
resetBtn
.
on
(
'keyup'
,
_
.
bind
(
this
.
reset_by_enter
,
this
)
);
captureBtn
.
on
(
'keyup'
,
_
.
bind
(
this
.
capture_by_enter
,
this
)
);
// Show the capture button
$
(
"#webcam_capture_button"
,
this
.
el
)
.
removeClass
(
'is-hidden'
);
captureBtn
.
removeClass
(
'is-hidden'
);
return
this
;
},
...
...
@@ -266,6 +276,16 @@
$
(
"#webcam_capture_button"
,
this
.
el
).
removeClass
(
'is-hidden'
);
},
capture_by_enter
:
function
(
event
){
if
(
event
.
keyCode
==
key
.
enter
){
this
.
capture
();
}
},
reset_by_enter
:
function
(
event
){
if
(
event
.
keyCode
==
key
.
enter
){
this
.
reset
();
}
},
capture
:
function
()
{
// Take a snapshot of the video
var
success
=
this
.
backend
.
snapshot
();
...
...
lms/templates/verify_student/webcam_photo.underscore
View file @
7395e8ab
...
...
@@ -21,10 +21,10 @@
<div class="controls photo-controls">
<div class="control control-retake is-hidden" id="webcam_reset_button">
<a class="action action-redo"><%- gettext( "Retake Photo" ) %></a>
<a class="action action-redo"
tabindex=1
><%- gettext( "Retake Photo" ) %></a>
</div>
<div class="control control-do is-hidden" id="webcam_capture_button">
<a class="action action-do">
<a class="action action-do"
tabindex=1
>
<i class="icon fa fa-camera" aria-hidden="true"></i> <span class="sr"><%- gettext( "Take Photo" ) %></span>
</a>
</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