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
8e86d7b5
Commit
8e86d7b5
authored
Oct 18, 2013
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor js.
parent
7cbdac73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
cms/static/js/views/metadata.js
+19
-14
No files found.
cms/static/js/views/metadata.js
View file @
8e86d7b5
define
(
define
(
[
[
"backbone"
,
"underscore"
,
"js/models/metadata"
,
"js/views/abstract_editor"
,
"backbone"
,
"underscore"
,
"js/models/metadata"
,
"js/views/abstract_editor"
,
...
@@ -304,25 +303,31 @@ function(Backbone, _, MetadataModel, AbstractEditor, VideoList) {
...
@@ -304,25 +303,31 @@ function(Backbone, _, MetadataModel, AbstractEditor, VideoList) {
templateName
:
"metadata-string-entry"
,
templateName
:
"metadata-string-entry"
,
render
:
function
()
{
initialize
:
function
()
{
Metadata
.
AbstractEditor
.
prototype
.
render
.
apply
(
this
);
Metadata
.
AbstractEditor
.
prototype
.
initialize
.
apply
(
this
);
// Time format: HH:mm:ss
// Time format: HH:mm:ss
$
.
mask
.
definitions
[
'h'
]
=
'[0-2]'
;
var
definitions
=
{
$
.
mask
.
definitions
[
'H'
]
=
'[0-3]'
;
h
:
'[0-2]'
,
$
.
mask
.
definitions
[
'm'
]
=
$
.
mask
.
definitions
[
's'
]
=
'[0-5]'
;
H
:
'[0-3]'
,
$
.
mask
.
definitions
[
'M'
]
=
$
.
mask
.
definitions
[
'S'
]
=
'[0-9]'
;
m
:
'[0-5]'
,
this
.
$el
.
find
(
'#'
+
this
.
uniqueId
).
mask
(
'hH:mM:sS'
,
{
placeholder
:
"0"
});
s
:
'[0-5]'
,
M
:
'[0-9]'
,
S
:
'[0-9]'
};
$
.
each
(
definitions
,
function
(
key
,
value
)
{
$
.
mask
.
definitions
[
key
]
=
value
;
});
this
.
$el
.
find
(
'#'
+
this
.
uniqueId
)
.
mask
(
'hH:mM:sS'
,
{
placeholder
:
'0'
});
},
},
getValueFromEditor
:
function
()
{
getValueFromEditor
:
function
()
{
var
$input
=
this
.
$el
.
find
(
'#'
+
this
.
uniqueId
),
var
$input
=
this
.
$el
.
find
(
'#'
+
this
.
uniqueId
),
value
=
$input
.
val
(),
value
=
$input
.
val
();
time
=
Date
.
parse
(
value
);
if
(
time
===
null
)
{
value
=
null
;
}
return
value
;
return
value
;
},
},
...
...
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