People persist in calling Wine "WINE", fix the capitalisation silently in testdata.

This commit is contained in:
Jeff Zaroyko
2008-06-04 15:55:40 +10:00
committed by Chris Morgan
parent 041d0d2bc3
commit 0f9c35b832
2 changed files with 23 additions and 1 deletions

View File

@@ -92,7 +92,29 @@ function showHint(o){
$('hint').addClassName(ratingstyle[o.selectedIndex]);
}
}
/* too many people still call Wine "WINE" */
function bind_tolowerWINE()
{
[
$('app_editor'),
$('version_editor'),
$('Test1'),
$('Test2'),
$('Test3'),
$('extra_comments')].map( function(x)
{
if(x)
{
x.observe('change', tolowerWINE);
}
});
}
function tolowerWINE(o)
{
o.element().value = o.element().value.replace(/WINE([^A-Z]+)|(WINE)$/g,"Wine$1");
}
/* executed when document is ready */
document.observe("dom:loaded", function() {
showHint($('ratingSelect'));
bind_tolowerWINE();
});