Part of fix for why forceInteger filter in Composer edit boxes doesn't work (fixed RegExp syntax). Added debug dump lines to help investigate bug 18707 (exists only in optimized builds). r=sfraser

This commit is contained in:
cmanske%netscape.com 2000-01-11 21:03:23 +00:00
Родитель 497840dc76
Коммит e3e6a3dee9
2 изменённых файлов: 26 добавлений и 2 удалений

Просмотреть файл

@ -367,8 +367,9 @@ function forceInteger(elementID)
return;
var stringIn = editField.value;
var pat = /\D+/g;
var pat = new RegExp("/\D+/");
if (pat.test(stringIn)) {
dump("TEST SUCCEEDED\n")
editField.value = stringIn.replace(pat,"");
// we hope to remove the following line for blur() once xp widgets land
@ -376,6 +377,9 @@ function forceInteger(elementID)
//editField.blur();
sysBeep.Beep();
}
else {
dump("TEST didn't SUCCEEDED\n")
}
}

Просмотреть файл

@ -75,9 +75,29 @@ function Startup()
// by AdvancedEdit(), which is shared by all property dialogs
function InitDialog()
{
//******** Debuggin weird RegExp problems
var stringIn = "123abc456";
dump("Test string = "+stringIn+"\n");
var pat = new RegExp("/\D+/g");
if (pat.test(stringIn)) {
var tempStr = stringIn.replace(pat,"");
dump("Replaced pattern = "+tempStr+"\n");
} else {
dump("Failed test for nonnumeral characters\n");
}
//***************** end of test
// Just to be confusing, "size" is used instead of height
var height = globalElement.getAttribute("size");
if(!height) {
dump("NO SIZE FOUND FOR HLINE");
height = 2; //Default value
}
dump("HLine size = "+height+"\n");
// We will use "height" here and in UI
dialog.heightInput.value = globalElement.getAttribute("size");
dialog.heightInput.value = height;
// Get the width attribute of the element, stripping out "%"
// This sets contents of combobox (adds pixel and percent option elements)