зеркало из https://github.com/mozilla/gecko-dev.git
Use 'oninput' instead of 'onkeyup' for JS input handler (59654). r=mjudge, sr=sfraser
This commit is contained in:
Родитель
50c21b52c4
Коммит
32d551740a
|
@ -141,7 +141,7 @@
|
|||
<columns><column/><column flex="1"/></columns>
|
||||
<rows>
|
||||
<row autostretch="never" valign="middle" style="margin-bottom: 5px">
|
||||
<textfield id="BackgroundImageInput" onkeyup="ChangeBackgroundImage()"
|
||||
<textfield id="BackgroundImageInput" oninput="ChangeBackgroundImage()"
|
||||
tooltip="aTooltip" tooltiptext="&backgroundImage.tooltip;"
|
||||
style="min-width : 18em"/>
|
||||
<!-- from EdDialogOverlay.xul -->
|
||||
|
|
|
@ -156,15 +156,12 @@ function ValidateData()
|
|||
{
|
||||
// Height is always pixels
|
||||
height = ValidateNumberString(dialog.heightInput.value, 1, maxPixels);
|
||||
if (height == "") {
|
||||
// Set focus to the offending control
|
||||
dump("Height is empty\n");
|
||||
SetTextfieldFocus(dialog.heightInput);
|
||||
SetTextfieldFocus(dialog.heightInput);
|
||||
return false;
|
||||
if (height)
|
||||
{
|
||||
globalElement.setAttribute("size", height);
|
||||
}
|
||||
dump("Setting height="+height+"\n");
|
||||
globalElement.setAttribute("size", height);
|
||||
else
|
||||
globalElement.removeAttribute("size");
|
||||
|
||||
var isPercent = (dialog.pixelOrPercentMenulist.selectedIndex == 1);
|
||||
var maxLimit;
|
||||
|
@ -176,16 +173,14 @@ function ValidateData()
|
|||
}
|
||||
|
||||
width = ValidateNumberString(dialog.widthInput.value, 1, maxLimit);
|
||||
if (width == "") {
|
||||
dump("Width is empty\n");
|
||||
SetTextfieldFocus(dialog.widthInput);
|
||||
return false;
|
||||
if (width)
|
||||
{
|
||||
if (isPercent)
|
||||
width = width + "%";
|
||||
globalElement.setAttribute("width", width);
|
||||
}
|
||||
if (isPercent)
|
||||
width = width + "%";
|
||||
|
||||
dump("HLine: Height="+height+" Width="+width+"\n");
|
||||
globalElement.setAttribute("width", width);
|
||||
else
|
||||
globalElement.removeAttribute("width");
|
||||
|
||||
align = "left";
|
||||
if (dialog.centerAlign.checked) {
|
||||
|
|
|
@ -54,13 +54,13 @@
|
|||
<rows>
|
||||
<row valign="middle" autostretch="never">
|
||||
<text class="label" value="&widthEditField.label;" />
|
||||
<textfield class="narrow" id="width" flex="1" onkeyup="forceInteger('width')"/>
|
||||
<textfield class="narrow" id="width" flex="1" oninput="forceInteger('width')"/>
|
||||
<menulist id="pixelOrPercentMenulist" />
|
||||
<!-- menupopup and menuitems added by JS -->
|
||||
</row>
|
||||
<row valign="middle" autostretch="never">
|
||||
<text class="label" value="&heightEditField.label;" />
|
||||
<textfield class="narrow" id="height" onkeyup="forceInteger('height')"/>
|
||||
<textfield class="narrow" id="height" oninput="forceInteger('height')"/>
|
||||
<text class="label" value="&pixelsPopup.value;" />
|
||||
</row>
|
||||
</rows>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
/>
|
||||
<textfield
|
||||
id = "srcInput"
|
||||
onkeyup = "doOverallEnabling()"
|
||||
oninput = "doOverallEnabling()"
|
||||
onmouseup = "doOverallEnabling()"
|
||||
onchange = "ChangeImageSrc()"
|
||||
style = "min-width : 20em"/>
|
||||
|
@ -172,7 +172,7 @@
|
|||
id = "widthInput"
|
||||
class = "narrow"
|
||||
onfocus = "oldSourceInt = this.value;"
|
||||
onkeyup = "constrainProportions(this.id, 'heightInput')"/>
|
||||
oninput = "constrainProportions(this.id, 'heightInput')"/>
|
||||
<menulist id = "widthUnitsMenulist"
|
||||
oncommand = "doDimensionEnabling();" />
|
||||
<!-- contents are appended by JS -->
|
||||
|
@ -187,7 +187,7 @@
|
|||
id = "heightInput"
|
||||
class = "narrow"
|
||||
onfocus = "oldSourceInt = this.value;"
|
||||
onkeyup = "constrainProportions(this.id, 'widthInput')"/>
|
||||
oninput = "constrainProportions(this.id, 'widthInput')"/>
|
||||
<menulist id = "heightUnitsMenulist"
|
||||
oncommand = "doDimensionEnabling();" />
|
||||
<!-- contents are appended by JS -->
|
||||
|
@ -282,7 +282,7 @@
|
|||
<textfield
|
||||
class = "narrow"
|
||||
id = "imageleftrightInput"
|
||||
onkeyup = "forceInteger(this.id)"/>
|
||||
oninput = "forceInteger(this.id)"/>
|
||||
<text
|
||||
class = "label"
|
||||
id = "leftrighttypeLabel"
|
||||
|
@ -296,7 +296,7 @@
|
|||
<textfield
|
||||
class = "narrow"
|
||||
id = "imagetopbottomInput"
|
||||
onkeyup = "forceInteger(this.id)"/>
|
||||
oninput = "forceInteger(this.id)"/>
|
||||
<text
|
||||
class = "label"
|
||||
id = "topbottomtypeLabel"
|
||||
|
@ -309,7 +309,7 @@
|
|||
<textfield
|
||||
class = "narrow"
|
||||
id = "border"
|
||||
onkeyup = "forceInteger(this.id)"/>
|
||||
oninput = "forceInteger(this.id)"/>
|
||||
<text
|
||||
class = "label"
|
||||
id = "bordertypeLabel"
|
||||
|
|
|
@ -54,7 +54,7 @@ function onOK()
|
|||
if (srcInput.value != "")
|
||||
editorShell.InsertSource(srcInput.value);
|
||||
else {
|
||||
dump("Null value -- not inserting\n");
|
||||
dump("Null value -- not inserting in HTML Source dialog\n");
|
||||
return false;
|
||||
}
|
||||
SaveWindowLocation();
|
||||
|
|
|
@ -176,7 +176,6 @@ function onOK()
|
|||
tableElement.appendChild(tableBody);
|
||||
|
||||
// Create necessary rows and cells for the table
|
||||
//dump("Rows = "+rows+" Columns = "+columns+"\n");
|
||||
for (var i = 0; i < rows; i++)
|
||||
{
|
||||
var newRow = editorShell.CreateElementWithDefaults("tr");
|
||||
|
|
|
@ -54,17 +54,17 @@
|
|||
<rows>
|
||||
<row valign="middle" text-align="right" autostretch="never">
|
||||
<text class="label align-right" text-align="right" value="&numRowsEditField.label;" />
|
||||
<textfield class="narrow" id="rowsInput" onkeyup="ChangeRowOrColumn(this.id)" />
|
||||
<textfield class="narrow" id="rowsInput" oninput="ChangeRowOrColumn(this.id)" />
|
||||
<spring/>
|
||||
</row>
|
||||
<row valign="middle" text-align="right" autostretch="never">
|
||||
<text class="label align-right" value="&numColumnsEditField.label;" />
|
||||
<textfield class="narrow" id="columnsInput" onkeyup="ChangeRowOrColumn(this.id)" />
|
||||
<textfield class="narrow" id="columnsInput" oninput="ChangeRowOrColumn(this.id)" />
|
||||
<spring/>
|
||||
</row>
|
||||
<row valign="middle" text-align="right" autostretch="never">
|
||||
<text class="label align-right" value="&widthEditField.label;" />
|
||||
<textfield class="narrow" id="widthInput" onkeyup="forceInteger(this.id)" />
|
||||
<textfield class="narrow" id="widthInput" oninput="forceInteger(this.id)" />
|
||||
<menulist id="widthPixelOrPercentMenulist"><menupopup/></menulist>
|
||||
<!-- child elements are appended by JS -->
|
||||
</row>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<box>
|
||||
<text class="label align-right" text-align="right" value="&borderEditField.label;"
|
||||
tooltip="aTooltip" tooltiptext="&borderEditField.tooltip;" />
|
||||
<textfield class="narrow" id="borderInput" onkeyup="forceInteger(this.id)" />
|
||||
<textfield class="narrow" id="borderInput" oninput="forceInteger(this.id)" />
|
||||
<text class="label" value="&pixels.label;"/>
|
||||
</box>
|
||||
<!-- from EdDialogOverlay -->
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
<box orient="vertical" style="min-width: 20em">
|
||||
<titledbox orient="vertical"><title id="linkTextCaption" align="left"/>
|
||||
<text class="label" id="linkTextMessage"/>
|
||||
<textfield id="linkTextInput" flex="1" onkeyup="ChangeText()"/>
|
||||
<textfield id="linkTextInput" flex="1" oninput="ChangeText()"/>
|
||||
</titledbox>
|
||||
|
||||
<titledbox orient="vertical"><title value="&LinkURLBox.label;"/>
|
||||
<text class="label" value="&LinkURLEditField.label;"/>
|
||||
<box autostretch="never" valign="middle">
|
||||
<textfield id="hrefInput" flex="1" style="min-width: 18em" onkeyup="ChangeLocation()"/>
|
||||
<textfield id="hrefInput" flex="1" style="min-width: 18em" oninput="ChangeLocation()"/>
|
||||
<button class="dialog" id="ChooseFile" flex="1"/>
|
||||
</box>
|
||||
<html class="wrap" flex="1" id="RemoveLinkMsg" style="margin-bottom: 7px">&RemoveLinkMsg.label;</html>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<spring class="spacer"/>
|
||||
<box>
|
||||
<text class="label" id="StartingNumberLabel" value="&startingNumber.label;"/>
|
||||
<textfield class="narrow" id="StartingNumber" onkeyup="forceInteger(this.id)"/>
|
||||
<textfield class="narrow" id="StartingNumber" oninput="forceInteger(this.id)"/>
|
||||
<spring/>
|
||||
</box>
|
||||
<html id="StartExample" class="wrap" flex="1" style="width: 1em">&startingHelp.label;</html>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<popupset id="aTooltipSet" />
|
||||
|
||||
<text class="label" align="left" for="nameInput" value="&anchorNameEditField.label;"/>
|
||||
<textfield class="MinWidth20em" id="nameInput" onkeyup="ChangeName()"
|
||||
<textfield class="MinWidth20em" id="nameInput" oninput="ChangeName()"
|
||||
tooltip="aTooltip" tooltiptext="&nameInput.tooltip;"/>
|
||||
<spring class="spacer"/>
|
||||
<!-- from EdDialogOverlay -->
|
||||
|
|
|
@ -58,15 +58,15 @@
|
|||
<spring class="spacer"/>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&titleInput.label;"/>
|
||||
<textfield class="MinWidth20em" id="TitleInput" onkeyup="TextfieldChanged(this.id)"/>
|
||||
<textfield class="MinWidth20em" id="TitleInput" oninput="TextfieldChanged(this.id)"/>
|
||||
</row>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&authorInput.label;"/>
|
||||
<textfield class="MinWidth20em" id="AuthorInput" onkeyup="TextfieldChanged(this.id)"/>
|
||||
<textfield class="MinWidth20em" id="AuthorInput" oninput="TextfieldChanged(this.id)"/>
|
||||
</row>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&descriptionInput.label;"/>
|
||||
<textfield class="MinWidth20em" id="DescriptionInput" onkeyup="TextfieldChanged(this.id)"/>
|
||||
<textfield class="MinWidth20em" id="DescriptionInput" oninput="TextfieldChanged(this.id)"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</row>
|
||||
<row>
|
||||
<text class="label" id="ReplaceWordLabel" value="&wordEditField.label;"/>
|
||||
<textfield id="ReplaceWord" onkeyup="ChangeReplaceWord()"/>
|
||||
<textfield id="ReplaceWord" oninput="ChangeReplaceWord()"/>
|
||||
<button id="CheckWord" oncommand="CheckWord()" value="&checkwordButton.label;"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
|
|
@ -61,11 +61,11 @@
|
|||
<rows>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&tableRows.label;"/>
|
||||
<textfield class="narrow" id="TableRowsInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="TableRowsInput" oninput="forceInteger(this.id);"/>
|
||||
</row>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&tableColumns.label;"/>
|
||||
<textfield class="narrow" id="TableColumnsInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="TableColumnsInput" oninput="forceInteger(this.id);"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
@ -75,7 +75,7 @@
|
|||
<rows>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&tableWidth.label;"/>
|
||||
<textfield class="narrow" id="TableWidthInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="TableWidthInput" oninput="forceInteger(this.id);"/>
|
||||
<menulist id="TableWidthUnits"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
@ -87,17 +87,17 @@
|
|||
<rows>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&tableBorderWidth.label;"/>
|
||||
<textfield class="narrow" id="BorderWidthInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="BorderWidthInput" oninput="forceInteger(this.id);"/>
|
||||
<text class="label" align="left" value="&pixels.label;"/>
|
||||
</row>
|
||||
<row valign="middle">
|
||||
<text class="label" value="&tableSpacing.label;"/>
|
||||
<textfield class="narrow" id="SpacingInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="SpacingInput" oninput="forceInteger(this.id);"/>
|
||||
<text class="label" value="&tablePxBetwCells.label;"/>
|
||||
</row>
|
||||
<row valign="middle" autostretch="never">
|
||||
<text class="label" value="&tablePadding.label;"/>
|
||||
<textfield class="narrow" id="PaddingInput" onkeyup="forceInteger(this.id);"/>
|
||||
<textfield class="narrow" id="PaddingInput" oninput="forceInteger(this.id);"/>
|
||||
<text class="label" value="&tablePxBetwBrdrCellContent.label;"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
@ -178,12 +178,12 @@
|
|||
<rows>
|
||||
<row valign="middle" autostretch="never">
|
||||
<checkbox id="CellHeightCheckbox" value="&tableHeight.label;"/>
|
||||
<textfield class="narrow" id="CellHeightInput" onkeyup="ChangeIntTextfield(this.id,'CellHeightCheckbox');"/>
|
||||
<textfield class="narrow" id="CellHeightInput" oninput="ChangeIntTextfield(this.id,'CellHeightCheckbox');"/>
|
||||
<menulist id="CellHeightUnits" oncommand="SetCheckbox('CellHeightCheckbox');"/>
|
||||
</row>
|
||||
<row valign="middle" autostretch="never">
|
||||
<checkbox id="CellWidthCheckbox" value="&tableWidth.label;"/>
|
||||
<textfield class="narrow" id="CellWidthInput" onkeyup="ChangeIntTextfield(this.id,'CellWidthCheckbox');"/>
|
||||
<textfield class="narrow" id="CellWidthInput" oninput="ChangeIntTextfield(this.id,'CellWidthCheckbox');"/>
|
||||
<menulist id="CellWidthUnits" oncommand="SetCheckbox('CellWidthCheckbox');"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
@ -194,11 +194,11 @@
|
|||
<rows>
|
||||
<row valign="middle" autostretch="never">
|
||||
<checkbox id="RowSpanCheckbox" value="&cellRowSpan.label;"/>
|
||||
<textfield class="narrow" id="RowSpanInput" onkeyup="ChangeIntTextfield(this.id,'RowSpanCheckbox');"/>
|
||||
<textfield class="narrow" id="RowSpanInput" oninput="ChangeIntTextfield(this.id,'RowSpanCheckbox');"/>
|
||||
</row>
|
||||
<row valign="middle" autostretch="never">
|
||||
<checkbox id="ColSpanCheckbox" value="&cellColSpan.label;"/>
|
||||
<textfield class="narrow" id="ColSpanInput" onkeyup="ChangeIntTextfield(this.id,'ColSpanCheckbox');"/>
|
||||
<textfield class="narrow" id="ColSpanInput" oninput="ChangeIntTextfield(this.id,'ColSpanCheckbox');"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<titledbox orient="vertical"><title align="left" value="&documentTitleTitle.label;"/>
|
||||
<!-- Text labels filled in from editor.properties -->
|
||||
<text id="EnterTitleLabel" class="label"/>
|
||||
<textfield id="TitleInput" flex="1" onkeyup="TitleChanged();"/>
|
||||
<textfield id="TitleInput" flex="1" oninput="TitleChanged();"/>
|
||||
<html id="TitleHelp" class="label wrap" style="width:1em" flex="1"/>
|
||||
</titledbox>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче