Skip to content

Commit

Permalink
BUGFIX Fixed ClassName change detection in javascript
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92775 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent 4decff9 commit df46717
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
23 changes: 8 additions & 15 deletions javascript/CMSMain.EditForm.js
@@ -1,20 +1,13 @@
(function($) {
/**
* @class CMS-specific form behaviour
* @name ss.EditForm
* Alert the user on change of page-type - this might have implications
* on the available form fields etc.
* @name ss.EditFormClassName
*/
$('.CMSMain #Form_EditForm').concrete('ss', function($){
return/** @lends ss.EditForm */{
onmatch: function() {
// Alert the user on change of page-type - this might have implications
// on the available form fields etc.
this.find(':input[name=ClassName]').bind('change',
function() {
alert('The page type will be updated after the page is saved');
}
);

this._super();
$('#Form_EditForm :input[name=ClassName]').concrete('ss', function($){
return/** @lends ss.EditFormClassName */{
onchange: function() {
alert(ss.i18n._t('CMSMAIN.ALERTCLASSNAME'));
}
};
});
Expand All @@ -28,7 +21,7 @@

FilterRegex: /[^A-Za-z0-9-]+/,

ValidationMessage: 'URLs can only be made up of letters, digits and hyphens.',
ValidationMessage: ss.i18n._t('CMSMAIN.URLSEGMENTVALIDATION'),

MaxLength: 50,

Expand Down
4 changes: 3 additions & 1 deletion javascript/lang/en_US.js
Expand Up @@ -25,6 +25,8 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'ModelAdmin.VALIDATIONERROR': "Validation Error",
'LeftAndMain.PAGEWASDELETED': "This page was deleted. To edit a page, select it from the left.",
'LeftAndMain.CONFIRMUNSAVED': "Are you sure you want to navigate away from this page?\n\nWARNING: Your changes have not been saved.\n\nPress OK to continue, or Cancel to stay on the current page.",
'LeftAndMain.CONFIRMUNSAVEDSHORT': "WARNING: Your changes have not been saved."
'LeftAndMain.CONFIRMUNSAVEDSHORT': "WARNING: Your changes have not been saved.",
'CMSMAIN.ALERTCLASSNAME': 'The page type will be updated after the page is saved',
'CMSMAIN.URLSEGMENTVALIDATION': 'URLs can only be made up of letters, digits and hyphens.'
});
}

0 comments on commit df46717

Please sign in to comment.