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
e9bb5eb1
Commit
e9bb5eb1
authored
Feb 11, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates.
parent
98920e7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
cms/static/js/views/settings/advanced_view.js
+4
-7
No files found.
cms/static/js/views/settings/advanced_view.js
View file @
e9bb5eb1
...
...
@@ -87,8 +87,9 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
}
}
else
{
// This is the case of the page first rendering.
// This is the case of the page first rendering
, or when Cancel is pressed
.
this
.
hideSaveCancelButtons
();
this
.
toggleNewButton
(
true
);
}
},
...
...
@@ -171,7 +172,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// That is, it doesn't change as the val changes until val is accepted.
var
oldKey
=
$
(
event
.
currentTarget
).
closest
(
'.key'
).
attr
(
'id'
);
var
newKey
=
$
(
event
.
currentTarget
).
val
();
console
.
log
(
'update '
,
oldKey
,
newKey
);
// TODO: REMOVE ME
if
(
oldKey
!==
newKey
)
{
// TODO: is it OK to erase other validation messages?
this
.
clearValidationErrors
();
...
...
@@ -179,10 +179,9 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
if
(
!
this
.
validateKey
(
oldKey
,
newKey
))
return
;
if
(
this
.
model
.
has
(
newKey
))
{
console
.
log
(
'dupe key'
);
var
error
=
{};
error
[
oldKey
]
=
newKey
+
" has another entry"
;
error
[
newKey
]
=
"
Other entry for "
+
newKey
;
error
[
oldKey
]
=
'You have already defined "'
+
newKey
+
'" in the manual policy definitions.'
;
error
[
newKey
]
=
"
You tried to enter a duplicate of this key."
;
this
.
model
.
trigger
(
"error"
,
this
.
model
,
error
);
return
false
;
}
...
...
@@ -195,7 +194,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
var
validation
=
this
.
model
.
validate
(
newEntryModel
);
if
(
validation
)
{
console
.
log
(
'reserved key'
);
if
(
_
.
has
(
validation
,
newKey
))
{
// swap to the key which the map knows about
validation
[
oldKey
]
=
validation
[
newKey
];
...
...
@@ -242,7 +240,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// model validation can't handle malformed keys nor notice if 2 fields have same key; so, need to add that chk here
// TODO ensure there's no spaces or illegal chars
if
(
_
.
isEmpty
(
newKey
))
{
console
.
log
(
'no key'
);
var
error
=
{};
error
[
oldKey
]
=
"Key cannot be an empty string"
;
this
.
model
.
trigger
(
"error"
,
this
.
model
,
error
);
...
...
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