Browse files

BUGFIX Fixed ClassName change detection in javascript

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92775 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 4decff9 commit df46717bf0bda401f3d853b5da54df8a6192cceb @chillu chillu committed Nov 21, 2009
Showing with 11 additions and 16 deletions.
  1. +8 −15 javascript/CMSMain.EditForm.js
  2. +3 −1 javascript/lang/en_US.js
View
23 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'));
}
};
});
@@ -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,
View
4 javascript/lang/en_US.js
@@ -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.