Fixes #339, Saved search dialog doesn't expand when you add new conditions

Addresses #155, Localize strings

- Fixed flex/overflow issues with search dialog
- Localized "Name:" in search dialog
- Disabled hover color for disabled clicky buttons with CSS3 not() selector and removed "unclicky" class
This commit is contained in:
Dan Stillman 2006-11-05 08:18:06 +00:00
parent f91134edd7
commit bfe62046d1
7 changed files with 51 additions and 20 deletions

View File

@ -219,10 +219,10 @@
</implementation> </implementation>
<content> <content>
<xul:hbox xbl:inherits="flex"> <xul:hbox flex="1">
<xul:textbox/> <xul:textbox flex="1"/>
<xul:menulist label="days"> <xul:menulist>
<xul:menupopup> <xul:menupopup flex="1">
<xul:menuitem label="&zotero.search.date.units.days;" value="days" selected="true"/> <xul:menuitem label="&zotero.search.date.units.days;" value="days" selected="true"/>
<xul:menuitem label="&zotero.search.date.units.months;" value="months"/> <xul:menuitem label="&zotero.search.date.units.months;" value="months"/>
<xul:menuitem label="&zotero.search.date.units.years;" value="years"/> <xul:menuitem label="&zotero.search.date.units.years;" value="years"/>

View File

@ -118,16 +118,15 @@
var remove = document.createElement("label"); var remove = document.createElement("label");
remove.setAttribute('value','-'); remove.setAttribute('value','-');
remove.setAttribute('class','zotero-clicky');
if (id) if (id)
{ {
remove.setAttribute('tabindex', -1); remove.setAttribute('tabindex', -1);
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+id+"');"); remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+id+"');");
remove.setAttribute('class','zotero-clicky');
} }
else else
{ {
remove.setAttribute('disabled', true); remove.setAttribute('disabled', true);
remove.setAttribute('class', 'zotero-unclicky');
} }
var row = document.createElement("row"); var row = document.createElement("row");

View File

@ -79,7 +79,12 @@
condition.initWithParentAndCondition(this, ref); condition.initWithParentAndCondition(this, ref);
conditionsBox.childNodes[0].id('remove').hidden = (conditionsBox.childNodes.length == 1); if (conditionsBox.childNodes.length == 2){
conditionsBox.childNodes[0].enableRemoveButton();
}
else if (conditionsBox.childNodes.length == 1){
conditionsBox.childNodes[0].disableRemoveButton();
}
]]> ]]>
</body> </body>
</method> </method>
@ -97,7 +102,9 @@
} }
} }
conditionsBox.childNodes[0].id('remove').hidden = (conditionsBox.childNodes.length == 1); if (conditionsBox.childNodes.length == 1){
conditionsBox.childNodes[0].disableRemoveButton();
}
]]> ]]>
</body> </body>
</method> </method>
@ -443,16 +450,34 @@
<method name="onRemoveClicked"> <method name="onRemoveClicked">
<body> <body>
<![CDATA[ <![CDATA[
if(this.parent) if (this.parent){
this.parent.removeCondition(this.conditionID); this.parent.removeCondition(this.conditionID);
}
window.sizeToContent()
]]> ]]>
</body> </body>
</method> </method>
<method name="onAddClicked"> <method name="onAddClicked">
<body> <body>
<![CDATA[ <![CDATA[
if(this.parent) if (this.parent){
this.parent.onAddClicked(); this.parent.onAddClicked();
}
window.sizeToContent()
]]>
</body>
</method>
<method name="disableRemoveButton">
<body>
<![CDATA[
document.getAnonymousNodes(this)[0].lastChild.previousSibling.disabled = true;
]]>
</body>
</method>
<method name="enableRemoveButton">
<body>
<![CDATA[
document.getAnonymousNodes(this)[0].lastChild.previousSibling.disabled = false;
]]> ]]>
</body> </body>
</method> </method>
@ -477,7 +502,7 @@
<xul:menulist id="valuemenu" flex="1" hidden="true"> <xul:menulist id="valuemenu" flex="1" hidden="true">
<xul:menupopup/> <xul:menupopup/>
</xul:menulist> </xul:menulist>
<xul:zoterosearchagefield id="value-date-age" hidden="true"/> <xul:zoterosearchagefield id="value-date-age" hidden="true" flex="1"/>
<xul:toolbarbutton id="remove" class="zotero-clicky" label="-" oncommand="this.parentNode.parentNode.onRemoveClicked();"/> <xul:toolbarbutton id="remove" class="zotero-clicky" label="-" oncommand="this.parentNode.parentNode.onRemoveClicked();"/>
<xul:toolbarbutton id="add" class="zotero-clicky" label="+" oncommand="this.parentNode.parentNode.onAddClicked();"/> <xul:toolbarbutton id="add" class="zotero-clicky" label="+" oncommand="this.parentNode.parentNode.onAddClicked();"/>
</xul:hbox> </xul:hbox>

View File

@ -542,6 +542,7 @@ var ZoteroItemPane = new function()
// Plus (+) button // Plus (+) button
var addButton = document.createElement('label'); var addButton = document.createElement('label');
addButton.setAttribute("value","+"); addButton.setAttribute("value","+");
addButton.setAttribute("class","zotero-clicky");
// If row isn't saved, don't let user add more // If row isn't saved, don't let user add more
if (unsaved) if (unsaved)
{ {
@ -722,14 +723,12 @@ var ZoteroItemPane = new function()
function disableButton(button) function disableButton(button)
{ {
button.setAttribute('disabled', true); button.setAttribute('disabled', true);
button.setAttribute('class', 'zotero-unclicky');
button.setAttribute('onclick', false); button.setAttribute('onclick', false);
} }
function _enablePlusButton(button, creatorTypeID, fieldMode) function _enablePlusButton(button, creatorTypeID, fieldMode)
{ {
button.setAttribute('disabled', false); button.setAttribute('disabled', false);
button.setAttribute("class","zotero-clicky");
button.setAttribute("onclick", button.setAttribute("onclick",
"ZoteroItemPane.disableButton(this); ZoteroItemPane.addCreatorRow('', '', " + (creatorTypeID ? creatorTypeID : 'false') + ", " + fieldMode + ", true);"); "ZoteroItemPane.disableButton(this); ZoteroItemPane.addCreatorRow('', '', " + (creatorTypeID ? creatorTypeID : 'false') + ", " + fieldMode + ", true);");
} }

View File

@ -2,7 +2,8 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/searchbox.dtd">
<dialog <dialog
id="zotero-search-dialog" id="zotero-search-dialog"
@ -18,6 +19,9 @@
<script src="include.js"/> <script src="include.js"/>
<script src="searchDialog.js"/> <script src="searchDialog.js"/>
<hbox align="center"><label value="Name:"/><textbox id="search-name" flex="1"/></hbox> <hbox align="center">
<label value="&zotero.search.name;"/>
<textbox id="search-name" flex="1"/>
</hbox>
<zoterosearch id="search-box" flex="1"/> <zoterosearch id="search-box" flex="1"/>
</dialog> </dialog>

View File

@ -1,3 +1,5 @@
<!ENTITY zotero.search.name "Name:">
<!ENTITY zotero.search.joinMode.prefix "Match"> <!ENTITY zotero.search.joinMode.prefix "Match">
<!ENTITY zotero.search.joinMode.any "any"> <!ENTITY zotero.search.joinMode.any "any">
<!ENTITY zotero.search.joinMode.all "all"> <!ENTITY zotero.search.joinMode.all "all">

View File

@ -110,7 +110,10 @@ zoterosearchagefield
-moz-binding: url('chrome://zotero/content/bindings/searchtextbox.xml#search-in-the-last'); -moz-binding: url('chrome://zotero/content/bindings/searchtextbox.xml#search-in-the-last');
} }
zoterosearchagefield textbox
{
min-width:3em;
}
#zotero-editpane-dynamic-fields row, tagsbox row #zotero-editpane-dynamic-fields row, tagsbox row
{ {
@ -192,20 +195,19 @@ zoterosearchagefield
margin: 0 0 0 1px; margin: 0 0 0 1px;
} }
.zotero-clicky, .zotero-unclicky .zotero-clicky
{ {
-moz-border-radius: 6px; -moz-border-radius: 6px;
} }
.zotero-clicky[value="-"], .zotero-clicky[value="+"], .zotero-clicky[value="-"], .zotero-clicky[value="+"]
.zotero-unclicky[value="-"], .zotero-unclicky[value="+"]
{ {
margin: 0px; margin: 0px;
padding-left: 4px; padding-left: 4px;
padding-right: 4px; padding-right: 4px;
} }
.zotero-clicky:hover .zotero-clicky:not([disabled=true]):hover
{ {
color: white; color: white;
background: #666666; background: #666666;