Bug 490962 - "Remove unused XBL binding searchTerm" [r+sr=neil]

This commit is contained in:
Kent James 2009-07-30 09:30:30 +01:00
Родитель fba011c382
Коммит ccc7537b01
2 изменённых файлов: 0 добавлений и 246 удалений

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

@ -1583,129 +1583,6 @@
<handler event="keypress" keycode="VK_RETURN" action="onEnterInSearchTerm();"/>
</handlers>
</binding>
<!-- the searchterm binding is not used anymore, remove in bug 490962 -->
<binding id="searchterm" name="searchTerm" extends="xul:box">
<implementation>
<field name="internalSearchTerm">null</field>
<field name="internalBooleanAnd">null</field>
<!-- the actual nsIMsgSearchTerm object -->
<property name="searchTerm" onget="return this.internalSearchTerm">
<setter>
<![CDATA[
this.internalSearchTerm = val;
var term = val;
// val is a nsIMsgSearchTerm
var searchAttribute=this.searchattribute;
var searchOperator=this.searchoperator;
var searchValue=this.searchvalue;
// now reflect all attributes of the searchterm into the widgets
if (searchAttribute) searchAttribute.value = term.attrib;
if (searchOperator) searchOperator.value = val.op;
if (searchValue) searchValue.value = term.value;
this.booleanAnd = val.booleanAnd;
]]>
</setter>
</property>
<property name="searchScope">
<getter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute)
return searchAttribute.searchScope;
return undefined;
]]>
</getter>
<setter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute) searchAttribute.searchScope=val;
]]>
</setter>
</property>
<!-- the three tags that make up a term - to use, set the
attribute in the XUL to the ID of the term.
-->
<property name="searchattribute"
onget="return document.getElementById(this.getAttribute('searchattribute'));"
onset="this.setAttribute('searchattribute',val.id)"/>
<property name="searchoperator"
onget="return document.getElementById(this.getAttribute('searchoperator'));"
onset="this.setAttribute('searchoperator',val.id)"/>
<property name="searchvalue"
onget="return document.getElementById(this.getAttribute('searchvalue'));"
onset="this.setAttribute('searchvalue',val.id)"/>
<field name="booleanNodes">
<![CDATA[
null;
]]>
</field>
<field name="stringBundle">
<![CDATA[
Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService)
.createBundle("chrome://messenger/locale/search.properties")
]]>
</field>
<property name="booleanAnd" onget="return this.internalBooleanAnd">
<setter>
<![CDATA[
// whenever you set this, all nodes in booleanNodes
// are updated to reflect the string
if (this.internalBooleanAnd == val) return;
this.internalBooleanAnd = val;
var booleanNodes = this.booleanNodes;
if (!booleanNodes) return;
var stringBundle = this.stringBundle;
var andString = val ? "And" : "Or";
for (var i=0; i<booleanNodes.length; i++) {
try {
var staticString =
stringBundle.GetStringFromName("search" + andString + i);
if (staticString && staticString.length>0)
booleanNodes[i].setAttribute("value", staticString);
} catch (ex) { /* no error, means string not found */}
}
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchTerm = this.searchTerm;
searchTerm.attrib = this.searchattribute.value;
if (this.searchAttribute > nsMsgSearchAttrib.OtherHeader && this.searchAttribute < nsMsgSearchAttrib.kNumMsgSearchAttributes)
searchTerm.arbitraryHeader = this.searchattribute.label;
searchTerm.op = this.searchoperator.value;
if (this.searchvalue.value)
this.searchvalue.save();
else
this.searchvalue.saveTo(searchTerm.value);
searchTerm.value = this.searchvalue.value;
searchTerm.booleanAnd = this.booleanAnd;
]]>
</body>
</method>
<!-- if you have a search term element with no search term -->
<method name="saveTo">
<parameter name="searchTerm"/>
<body>
<![CDATA[
this.internalSearchTerm = searchTerm;
this.save();
]]>
</body>
</method>
</implementation>
</binding>
<!-- Folder picker helper widgets -->
<binding id="popup-base" extends="chrome://global/content/bindings/popup.xml#popup">

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

@ -1559,129 +1559,6 @@
<handler event="keypress" keycode="VK_RETURN" action="onEnterInSearchTerm();"/>
</handlers>
</binding>
<!-- the searchterm binding is not used anymore, remove in bug 490962 -->
<binding id="searchterm" name="searchTerm" extends="xul:box">
<implementation>
<field name="internalSearchTerm">null</field>
<field name="internalBooleanAnd">null</field>
<!-- the actual nsIMsgSearchTerm object -->
<property name="searchTerm" onget="return this.internalSearchTerm">
<setter>
<![CDATA[
this.internalSearchTerm = val;
var term = val;
// val is a nsIMsgSearchTerm
var searchAttribute=this.searchattribute;
var searchOperator=this.searchoperator;
var searchValue=this.searchvalue;
// now reflect all attributes of the searchterm into the widgets
if (searchAttribute) searchAttribute.value = term.attrib;
if (searchOperator) searchOperator.value = val.op;
if (searchValue) searchValue.value = term.value;
this.booleanAnd = val.booleanAnd;
]]>
</setter>
</property>
<property name="searchScope">
<getter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute)
return searchAttribute.searchScope;
return undefined;
]]>
</getter>
<setter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute) searchAttribute.searchScope=val;
]]>
</setter>
</property>
<!-- the three tags that make up a term - to use, set the
attribute in the XUL to the ID of the term.
-->
<property name="searchattribute"
onget="return document.getElementById(this.getAttribute('searchattribute'));"
onset="this.setAttribute('searchattribute',val.id)"/>
<property name="searchoperator"
onget="return document.getElementById(this.getAttribute('searchoperator'));"
onset="this.setAttribute('searchoperator',val.id)"/>
<property name="searchvalue"
onget="return document.getElementById(this.getAttribute('searchvalue'));"
onset="this.setAttribute('searchvalue',val.id)"/>
<field name="booleanNodes">
<![CDATA[
null;
]]>
</field>
<field name="stringBundle">
<![CDATA[
Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService)
.createBundle("chrome://messenger/locale/search.properties")
]]>
</field>
<property name="booleanAnd" onget="return this.internalBooleanAnd">
<setter>
<![CDATA[
// whenever you set this, all nodes in booleanNodes
// are updated to reflect the string
if (this.internalBooleanAnd == val) return;
this.internalBooleanAnd = val;
var booleanNodes = this.booleanNodes;
if (!booleanNodes) return;
var stringBundle = this.stringBundle;
var andString = val ? "And" : "Or";
for (var i=0; i<booleanNodes.length; i++) {
try {
var staticString =
stringBundle.GetStringFromName("search" + andString + i);
if (staticString && staticString.length>0)
booleanNodes[i].setAttribute("value", staticString);
} catch (ex) { /* no error, means string not found */}
}
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchTerm = this.searchTerm;
searchTerm.attrib = this.searchattribute.value;
if (this.searchAttribute > nsMsgSearchAttrib.OtherHeader && this.searchAttribute < nsMsgSearchAttrib.kNumMsgSearchAttributes)
searchTerm.arbitraryHeader = this.searchattribute.label;
searchTerm.op = this.searchoperator.value;
if (this.searchvalue.value)
this.searchvalue.save();
else
this.searchvalue.saveTo(searchTerm.value);
searchTerm.value = this.searchvalue.value;
searchTerm.booleanAnd = this.booleanAnd;
]]>
</body>
</method>
<!-- if you have a search term element with no search term -->
<method name="saveTo">
<parameter name="searchTerm"/>
<body>
<![CDATA[
this.internalSearchTerm = searchTerm;
this.save();
]]>
</body>
</method>
</implementation>
</binding>
<!-- Folder picker helper widgets -->
<binding id="popup-base" extends="chrome://global/content/bindings/popup.xml#popup">