mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Improved ingize() support so that it works on multi-word verbs
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@40997 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6c4a2e24aa
commit
62c2237773
@ -234,9 +234,19 @@ function prepareAjaxActions(actions, formName, tabName) {
|
||||
}
|
||||
|
||||
function ingize(val) {
|
||||
var ingWord, suffix;
|
||||
if(!val) val = "process";
|
||||
if(val.substr(val.length-1) == 'e') return val.substr(0, val.length-1) + 'ing...';
|
||||
else return val + 'ing...';
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user