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
75ceed7f
Commit
75ceed7f
authored
Feb 12, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show "successful save" message when a new edit is made.
parent
e9bb5eb1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
cms/static/js/views/settings/advanced_view.js
+3
-8
No files found.
cms/static/js/views/settings/advanced_view.js
View file @
75ceed7f
...
@@ -4,7 +4,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -4,7 +4,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// the key for a newly added policy-- before the user has entered a key value
// the key for a newly added policy-- before the user has entered a key value
new_key
:
"__new_advanced_key__"
,
new_key
:
"__new_advanced_key__"
,
error_saving
:
"error_saving"
,
error_saving
:
"error_saving"
,
unsaved_changes
:
"unsaved_changes"
,
successful_changes
:
"successful_changes"
,
successful_changes
:
"successful_changes"
,
// Model class is CMS.Models.Settings.Advanced
// Model class is CMS.Models.Settings.Advanced
...
@@ -67,7 +66,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -67,7 +66,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// TODO: error checking
// TODO: error checking
var
JSONValue
=
JSON
.
parse
(
quotedValue
);
var
JSONValue
=
JSON
.
parse
(
quotedValue
);
self
.
model
.
set
(
key
,
JSONValue
,
{
validate
:
true
});
self
.
model
.
set
(
key
,
JSONValue
,
{
validate
:
true
});
self
.
showMessage
(
self
.
unsaved_changes
);
}
}
});
});
},
},
...
@@ -78,9 +76,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -78,9 +76,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
if
(
type
===
this
.
error_saving
)
{
if
(
type
===
this
.
error_saving
)
{
this
.
$el
.
find
(
".message-status.error"
).
addClass
(
"is-shown"
);
this
.
$el
.
find
(
".message-status.error"
).
addClass
(
"is-shown"
);
}
}
else
if
(
type
===
this
.
unsaved_changes
)
{
$
(
'.wrapper-notification'
).
addClass
(
'is-shown'
);
}
else
if
(
type
===
this
.
successful_changes
)
{
else
if
(
type
===
this
.
successful_changes
)
{
this
.
$el
.
find
(
".message-status.confirm"
).
addClass
(
"is-shown"
);
this
.
$el
.
find
(
".message-status.confirm"
).
addClass
(
"is-shown"
);
this
.
hideSaveCancelButtons
();
this
.
hideSaveCancelButtons
();
...
@@ -95,6 +90,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -95,6 +90,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
showSaveCancelButtons
:
function
()
{
showSaveCancelButtons
:
function
()
{
if
(
!
this
.
buttonsVisible
)
{
if
(
!
this
.
buttonsVisible
)
{
this
.
$el
.
find
(
".message-status"
).
removeClass
(
"is-shown"
);
$
(
'.wrapper-notification'
).
addClass
(
'is-shown'
);
$
(
'.wrapper-notification'
).
addClass
(
'is-shown'
);
this
.
buttonsVisible
=
true
;
this
.
buttonsVisible
=
true
;
}
}
...
@@ -128,7 +124,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -128,7 +124,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
this
.
model
.
unset
(
key
);
this
.
model
.
unset
(
key
);
}
}
li$
.
remove
();
li$
.
remove
();
this
.
show
Message
(
this
.
unsaved_changes
);
this
.
show
SaveCancelButtons
(
);
},
},
saveView
:
function
(
event
)
{
saveView
:
function
(
event
)
{
// TODO one last verification scan:
// TODO one last verification scan:
...
@@ -165,7 +161,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -165,7 +161,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// only 1 but hey, let's take advantage of the context mechanism
// only 1 but hey, let's take advantage of the context mechanism
_
.
each
(
policyValueDivs
,
this
.
attachJSONEditor
,
this
);
_
.
each
(
policyValueDivs
,
this
.
attachJSONEditor
,
this
);
this
.
toggleNewButton
(
false
);
this
.
toggleNewButton
(
false
);
this
.
show
Message
(
this
.
unsaved_changes
);
this
.
show
SaveCancelButtons
(
);
},
},
updateKey
:
function
(
event
)
{
updateKey
:
function
(
event
)
{
// old key: either the key as in the model or new_key.
// old key: either the key as in the model or new_key.
...
@@ -233,7 +229,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
...
@@ -233,7 +229,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
_
.
each
(
policyValueDivs
,
this
.
attachJSONEditor
,
this
);
_
.
each
(
policyValueDivs
,
this
.
attachJSONEditor
,
this
);
this
.
fieldToSelectorMap
[
newKey
]
=
newKey
;
this
.
fieldToSelectorMap
[
newKey
]
=
newKey
;
this
.
showMessage
(
this
.
unsaved_changes
);
}
}
},
},
validateKey
:
function
(
oldKey
,
newKey
)
{
validateKey
:
function
(
oldKey
,
newKey
)
{
...
...
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