From df46717bf0bda401f3d853b5da54df8a6192cceb Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:17:54 +0000 Subject: [PATCH] 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 --- javascript/CMSMain.EditForm.js | 23 ++++++++--------------- javascript/lang/en_US.js | 4 +++- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index cbd84eb5..8ec4d43c 100644 --- a/javascript/CMSMain.EditForm.js +++ b/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, diff --git a/javascript/lang/en_US.js b/javascript/lang/en_US.js index 2a4b02de..ac4710b9 100644 --- a/javascript/lang/en_US.js +++ b/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.' }); } \ No newline at end of file