commit eff310c5c99ff0b2908722eeeecf8ef01fa3dc9e
parent e2e5d59f615945236ec7892b865133b5f13ca9d4
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 5 Oct 2006 02:33:39 +0000
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
Diffstat:
2 files changed, 48 insertions(+), 13 deletions(-)
diff --git a/chrome/content/zotero/bindings/zoterosearch.xml b/chrome/content/zotero/bindings/zoterosearch.xml
@@ -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>
diff --git a/chrome/locale/en-US/zotero/searchbox.dtd b/chrome/locale/en-US/zotero/searchbox.dtd
@@ -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">