diff --git a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js index 57bf3446052..7c1ff560cef 100644 --- a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js +++ b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js @@ -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") + } } diff --git a/mozilla/editor/ui/dialogs/content/EdHLineProps.js b/mozilla/editor/ui/dialogs/content/EdHLineProps.js index 96a34fb9ccf..31e7309e3e6 100644 --- a/mozilla/editor/ui/dialogs/content/EdHLineProps.js +++ b/mozilla/editor/ui/dialogs/content/EdHLineProps.js @@ -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)