зеркало из https://github.com/mozilla/pjs.git
Remove 'AppendStringToMenulist' JS method. b=183055, r=neil@parkwaycc.co.uk, sr=hewitt
This commit is contained in:
Родитель
6acb4787b6
Коммит
e1f53da40f
|
@ -23,7 +23,7 @@
|
|||
|
||||
function BuildHTMLAttributeNameList()
|
||||
{
|
||||
ClearMenulist(gDialog.AddHTMLAttributeNameInput);
|
||||
gDialog.AddHTMLAttributeNameInput.removeAllItems();
|
||||
|
||||
var elementName = gElement.localName.toLowerCase();
|
||||
var attNames = gHTMLAttr[elementName];
|
||||
|
@ -228,7 +228,7 @@ function onInputHTMLAttributeName()
|
|||
// one (default) item, don't use menulist for that
|
||||
if (listLen > 1)
|
||||
{
|
||||
ClearMenulist(gDialog.AddHTMLAttributeValueMenulist);
|
||||
gDialog.AddHTMLAttributeValueMenulist.removeAllItems();
|
||||
|
||||
if (deckIndex != "1")
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
function BuildJSEAttributeNameList()
|
||||
{
|
||||
ClearMenulist(gDialog.AddJSEAttributeNameList);
|
||||
gDialog.AddJSEAttributeNameList.removeAllItems();
|
||||
|
||||
// Get events specific to current element
|
||||
var elementName = gElement.localName.toLowerCase();
|
||||
|
|
|
@ -104,9 +104,7 @@
|
|||
<!-- Lists are built at runtime -->
|
||||
<menulist id="AddHTMLAttributeNameInput" editable="true" flex="1"
|
||||
oninput="onInputHTMLAttributeName();"
|
||||
onchange="onChangeHTMLAttribute();">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
onchange="onChangeHTMLAttribute();"/>
|
||||
<deck id="AddHTMLAttributeValueDeck" selectedIndex="0">
|
||||
<hbox align="top">
|
||||
<textbox id="AddHTMLAttributeValueTextbox" flex="1"
|
||||
|
@ -114,9 +112,7 @@
|
|||
</hbox>
|
||||
<hbox align="top">
|
||||
<menulist id="AddHTMLAttributeValueMenulist" editable="true" flex="1"
|
||||
oninput="onInputHTMLAttributeValue();">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
oninput="onInputHTMLAttributeValue();"/>
|
||||
</hbox>
|
||||
</deck>
|
||||
</row>
|
||||
|
|
|
@ -238,49 +238,6 @@ function GetAppropriatePercentString(elementForAtt, elementInDoc)
|
|||
} catch (e) { return "";}
|
||||
}
|
||||
|
||||
function AppendStringToMenulistById(menulist, stringID)
|
||||
{
|
||||
return AppendStringToMenulist(menulist, GetString(stringID));
|
||||
}
|
||||
|
||||
function AppendStringToMenulist(menulist, string)
|
||||
{
|
||||
if (menulist)
|
||||
{
|
||||
var menupopup = menulist.firstChild;
|
||||
// May not have any popup yet -- so create one
|
||||
if (!menupopup)
|
||||
{
|
||||
menupopup = document.createElementNS(XUL_NS, "menupopup");
|
||||
if (menupopup)
|
||||
menulist.appendChild(menupopup);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
var menuItem = document.createElementNS(XUL_NS, "menuitem");
|
||||
if (menuItem)
|
||||
{
|
||||
menuItem.setAttribute("label", string);
|
||||
menupopup.appendChild(menuItem);
|
||||
return menuItem;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function ClearMenulist(menulist)
|
||||
{
|
||||
// Always use "AppendStringToMenulist" so we know there's
|
||||
// just one <menupopup> as 1st child of <menulist>
|
||||
if (menulist) {
|
||||
menulist.selectedItem = null;
|
||||
var popup = menulist.firstChild;
|
||||
if (popup)
|
||||
while (popup.firstChild)
|
||||
popup.removeChild(popup.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function ClearListbox(listbox)
|
||||
{
|
||||
if (listbox)
|
||||
|
@ -337,12 +294,12 @@ function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menu
|
|||
return size;
|
||||
}
|
||||
|
||||
ClearMenulist(menulist);
|
||||
pixelItem = AppendStringToMenulist(menulist, GetString("Pixels"));
|
||||
menulist.removeAllItems();
|
||||
pixelItem = menulist.appendItem(GetString("Pixels"));
|
||||
|
||||
if (!pixelItem) return 0;
|
||||
|
||||
percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc));
|
||||
percentItem = menulist.appendItem(GetAppropriatePercentString(elementForAtt, elementInDoc));
|
||||
if (size && size.length > 0)
|
||||
{
|
||||
// Search for a "%" or "px"
|
||||
|
|
|
@ -217,7 +217,7 @@ function DisableLatinL(disable)
|
|||
|
||||
function UpdateLatinL()
|
||||
{
|
||||
ClearMenulist(LatinL);
|
||||
LatinL.removeAllItems();
|
||||
if (category == "AccentUpper" || category == "AccentLower")
|
||||
{
|
||||
DisableLatinL(false);
|
||||
|
@ -238,7 +238,7 @@ function UpdateLatinL()
|
|||
|
||||
function UpdateLatinM()
|
||||
{
|
||||
ClearMenulist(LatinM);
|
||||
LatinM.removeAllItems();
|
||||
var i, accent;
|
||||
switch(category)
|
||||
{
|
||||
|
|
|
@ -188,7 +188,7 @@ function ConvertStartAttrToUserString(startAttr, type)
|
|||
|
||||
function BuildBulletStyleList()
|
||||
{
|
||||
ClearMenulist(gDialog.BulletStyleList);
|
||||
gDialog.BulletStyleList.removeAllItems();
|
||||
var label;
|
||||
|
||||
if (gListType == "ul")
|
||||
|
|
|
@ -193,7 +193,7 @@ function Startup()
|
|||
|
||||
function FillSiteList()
|
||||
{
|
||||
ClearMenulist(gDialog.SiteList);
|
||||
gDialog.SiteList.removeAllItems();
|
||||
gDefaultSiteIndex = -1;
|
||||
|
||||
// Fill the site lists
|
||||
|
@ -240,8 +240,8 @@ function SelectSiteList()
|
|||
var savePassword = false;
|
||||
var publishOtherFiles = true;
|
||||
|
||||
ClearMenulist(gDialog.DocDirList);
|
||||
ClearMenulist(gDialog.OtherDirList);
|
||||
gDialog.DocDirList.removeAllItems();
|
||||
gDialog.OtherDirList.removeAllItems();
|
||||
|
||||
if (gPublishSiteData && selectedSiteIndex != -1)
|
||||
{
|
||||
|
|
|
@ -65,9 +65,7 @@
|
|||
<!-- Contents filled in at runtime -->
|
||||
<menulist id="SiteList"
|
||||
style="min-width:18em; max-width:18em;" crop="right"
|
||||
oncommand="SelectSiteList();">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
oncommand="SelectSiteList();"/>
|
||||
<hbox>
|
||||
<button label="&newSiteButton.label;" oncommand="AddNewSite();"/>
|
||||
<spacer flex="1"/>
|
||||
|
@ -93,9 +91,7 @@
|
|||
<hbox align="center">
|
||||
<!-- Contents filled in at runtime -->
|
||||
<menulist id="DocDirList" class="minWidth20 uri-element" editable="true" flex="1"
|
||||
oninput="onInputSettings();">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
oninput="onInputSettings();"/>
|
||||
<!--
|
||||
<button label="&chooseDirButton.label;" oncommand="ChooseDir(gDialog.DocDirList);" disabled="true"/>
|
||||
-->
|
||||
|
@ -125,9 +121,7 @@
|
|||
<spacer class="radio-spacer"/>
|
||||
<!-- Contents filled in at runtime -->
|
||||
<menulist id="OtherDirList" class="minWidth20 uri-element" editable="true" flex="1"
|
||||
tooltiptext="&useSubdir.tooltip;" oninput="onInputSettings();">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
tooltiptext="&useSubdir.tooltip;" oninput="onInputSettings();"/>
|
||||
<!--
|
||||
<button label="&chooseDirButton.label;" oncommand="ChooseDir(gDialog.OtherDirList);" disabled="true"/>
|
||||
-->
|
||||
|
|
Загрузка…
Ссылка в новой задаче