From e33fe626d84fd8903381f95276658e9f5e5dc4eb Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 20 May 2009 07:05:38 +0000 Subject: [PATCH] Reverted r77385 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@77387 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index c101743d..6e58de25 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -126,6 +126,7 @@ Behaviour.register({ window.ontabschanged = function() { var formEl = $('Form_EditForm'); + if( !formEl ) formEl = $('Form_AddForm'); if( !formEl ) return; @@ -156,7 +157,7 @@ window.onresize = function(init) { if(typeof fitToParent == 'function') { fitToParent('right', 12); if($('ModelAdminPanel')) { - fitToParent('ModelAdminPanel',-30); + fitToParent('ModelAdminPanel',-60); } if($('contentPanel')) { fitToParent('contentPanel', 12); @@ -175,7 +176,9 @@ window.onresize = function(init) { } if(typeof fitToParent == 'function') { - fitToParent('Form_EditForm', 4); + if($('Form_EditForm')) fitToParent('Form_EditForm', 4); + if($('Form_AddForm')) fitToParent('Form_AddForm', 4); + if($('Form_EditorToolbarImageForm') && $('Form_EditorToolbarImageForm').style.display == "block") { fitToParent('Form_EditorToolbarImageForm', 5); fitToParent($('Form_EditorToolbarImageForm').getElementsByTagName('fieldset')[0]); @@ -286,6 +289,25 @@ function prepareAjaxActions(actions, formName, tabName) { } } +/** + * @deprecated 2.3 Please use ss.i18n + */ +function ingize(val) { + var ingWord, suffix; + if(!val) val = "process"; + + if(val.match(/^([^ ]+) +(.*)$/)) { + ingWord = RegExp.$1; + suffix = ' ' + RegExp.$2 + '...'; + } else { + ingWord = val; + suffix = '...'; + } + + if(ingWord.match(/^(.*)e$/)) return RegExp.$1 + 'ing' + suffix; + else return ingWord + 'ing' + suffix; +} + /** * Submit the given form and evaluate the Ajax response. * Needs to be bound to an object with the following parameters to work: