Closes #294, Checkbox in search dialog to search subfolders recursively

Addresses #155, Localize strings

- Added "Search subfolders"

- Localized strings in search dialog

Known issue:

#342, "Search subfolders" checkbox should be greyed out until applicable
This commit is contained in:
Dan Stillman 2006-10-05 02:33:39 +00:00
parent e2e5d59f61
commit eff310c5c9
2 changed files with 48 additions and 13 deletions

View File

@ -21,6 +21,8 @@
***** END LICENSE BLOCK *****
-->
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/searchbox.dtd">
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -44,6 +46,11 @@
this.id('joinModeMenu').setAttribute('condition',id);
this.id('joinModeMenu').value = conditions[id]['operator'];
}
else if(conditions[id]['condition'] == 'recursive')
{
this.id('recursiveCheckbox').setAttribute('condition',id);
this.id('recursiveCheckbox').checked = (conditions[id]['operator']=='true');
}
else
{
this.addCondition(conditions[id]);
@ -106,6 +113,24 @@
]]>
</body>
</method>
<method name="updateRecursive">
<body>
<![CDATA[
var checkbox = this.id('recursiveCheckbox');
var value = checkbox.checked ? 'true' : 'false';
if(checkbox.hasAttribute('condition'))
{
this.search.updateCondition(checkbox.getAttribute('condition'),
'recursive', value, null);
}
else
{
checkbox.setAttribute('condition',
this.search.addCondition('recursive', value, null));
}
]]>
</body>
</method>
<method name="save">
<body>
<![CDATA[
@ -133,19 +158,22 @@
<handlers>
</handlers>
<content>
<xul:groupbox xbl:inherits="flex">
<xul:caption align="center">
<xul:label value="Match"/>
<xul:menulist id="joinModeMenu" oncommand="this.parentNode.parentNode.parentNode.updateJoinMode();">
<xul:menupopup>
<xul:menuitem label="any" value="any"/>
<xul:menuitem label="all" value="all" selected="true"/>
</xul:menupopup>
</xul:menulist>
<xul:label value="of the following:"/>
</xul:caption>
<xul:vbox id="conditions"/>
</xul:groupbox>
<xul:vbox flex="1">
<xul:groupbox xbl:inherits="flex">
<xul:caption align="center">
<xul:label value="&zotero.search.joinMode.match;"/>
<xul:menulist id="joinModeMenu" oncommand="this.parentNode.parentNode.parentNode.parentNode.updateJoinMode()">
<xul:menupopup>
<xul:menuitem label="&zotero.search.joinMode.any;" value="any"/>
<xul:menuitem label="&zotero.search.joinMode.all;" value="all" selected="true"/>
</xul:menupopup>
</xul:menulist>
<xul:label value="&zotero.search.joinMode.ofTheFollowing;:"/>
</xul:caption>
<xul:vbox id="conditions"/>
</xul:groupbox>
<xul:checkbox id="recursiveCheckbox" label="&zotero.search.recursive.label;" oncommand="this.parentNode.parentNode.updateRecursive()"/>
</xul:vbox>
</content>
</binding>

View File

@ -1,3 +1,10 @@
<!ENTITY zotero.search.joinMode.match "Match">
<!ENTITY zotero.search.joinMode.any "any">
<!ENTITY zotero.search.joinMode.all "all">
<!ENTITY zotero.search.joinMode.ofTheFollowing "of the following">
<!ENTITY zotero.search.recursive.label "Search subfolders">
<!ENTITY zotero.search.textModes.phrase "Phrase">
<!ENTITY zotero.search.textModes.phraseBinary "Phrase (incl. binary files)">
<!ENTITY zotero.search.textModes.regexp "Regexp">