Bug 449375 – Use the new search textbox binding in the Places organizer. r=dietrich

This commit is contained in:
Dão Gottwald 2008-08-16 10:45:12 +02:00
Родитель 0ec9026733
Коммит 4000eeb4f8
8 изменённых файлов: 10 добавлений и 230 удалений

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

@ -114,13 +114,13 @@
oncommand="PlacesQueryBuilder.showSearch(this.getAttribute('rowid'), PlacesQueryBuilder._timeInLastSearch);"/>
</menupopup>
</menulist>
<textbox type="timed"
<textbox type="search"
timeout="50"
id="advancedSearch0Textbox"
flex="1"
oncommand="PlacesQueryBuilder.doSearch();"/>
<textbox type="timed"
<textbox type="search"
timeout="50"
id="advancedSearch0TimePicker"
hidden="true" flex="1"

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

@ -3,10 +3,6 @@
-moz-binding: url("chrome://browser/content/places/places.xml#calendar");
}
#searchFilter {
-moz-binding: url("chrome://browser/content/places/places.xml#textbox-timed-arbitrary");
}
button.commandButton {
-moz-binding: url("chrome://browser/content/places/places.xml#command-button");
}
@ -19,9 +15,8 @@ button.commandButton {
width: 0px;
}
#searchFilter[filtered="true"] .textbox-input-searchimage ,
#searchFilter:not([filtered="true"]) .textbox-input-closebutton {
display: none;
#searchFilter {
width: 23em;
}
/* Edit Item Panel */

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

@ -224,10 +224,8 @@ var PlacesOrganizer = {
// Make sure the search UI is hidden.
PlacesSearchBox.hideSearchUI();
if (resetSearchBox) {
var searchFilter = document.getElementById("searchFilter");
searchFilter.reset();
}
if (resetSearchBox)
PlacesSearchBox.searchFilter.reset();
this._setSearchScopeForNode(node);
if (this._places.treeBoxObject.focused)
@ -837,7 +835,7 @@ var PlacesSearchBox = {
// contents of the current scope.
// XXX this might be to jumpy, maybe should search for "", so results
// are ungrouped, and search box not reset
if ((filterString == "" || this.searchFilter.hasAttribute("empty"))) {
if (filterString == "") {
PO.onPlaceSelected(false);
return;
}
@ -879,7 +877,6 @@ var PlacesSearchBox = {
}
PlacesSearchBox.showSearchUI();
this.searchFilter.setAttribute("filtered", "true");
// Update the details panel
PlacesOrganizer.onContentTreeSelect();

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

@ -11,62 +11,6 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- XXXben - replace this upon checkin by allowing generic textboxes to show
arbitrary content before the html:input itself using a
<children/> -->
<binding id="textbox-timed-arbitrary"
extends="chrome://global/content/bindings/textbox.xml#timed-textbox">
<resources>
<stylesheet src="chrome://browser/skin/places/places.css"/>
</resources>
<content>
<children/>
<xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context">
<html:input class="textbox-input" flex="1" anonid="input"
xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,tabindex,accesskey"/>
</xul:hbox>
<xul:hbox>
<xul:button class="textbox-input-closebutton"/>
<xul:image class="textbox-input-searchimage"
chromedir="&locale.dir;"/>
</xul:hbox>
</content>
<implementation>
<method name="reset">
<body><![CDATA[
this.removeAttribute("filtered");
]]></body>
</method>
<method name="_resetInternal">
<body><![CDATA[
this.value = "";
this.reset();
var event = document.createEvent("Events");
event.initEvent("reset", true, true);
var cancel = !this.dispatchEvent(event);
var handler = this.getAttribute("onreset");
if (handler) {
var handlerFunction = new Function("event", handler);
handlerFunction(event);
}
]]></body>
</method>
</implementation>
<handlers>
<handler event="click"><![CDATA[
if (event.originalTarget.className == "textbox-input-closebutton") {
this.inputField.focus();
this._resetInternal();
}
]]></handler>
<handler event="keypress" keycode="VK_ESCAPE"><![CDATA[
this._resetInternal();
]]></handler>
</handlers>
</binding>
<binding id="command-button" extends="chrome://global/content/bindings/button.xml#button">
<implementation>
<method name="updateActiveView">

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

@ -386,9 +386,10 @@
<spacer flex="1"/>
<textbox id="searchFilter" style="width: 23em;" timeout="500" clickSelectsAll="true"
<textbox id="searchFilter"
clickSelectsAll="true"
type="search"
oncommand="PlacesSearchBox.search(this.value);"
onreset="PlacesOrganizer.onPlaceSelected(false);"
collection="bookmarks">
</textbox>
</toolbar>

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

@ -83,41 +83,6 @@
padding: 5px;
}
/* Search Bar */
#searchbar {
margin: 6px -4px 0px 2px;
}
.textbox-input-searchimage {
margin: 2px 0;
-moz-margin-end: 2px;
list-style-image: url("chrome://global/skin/icons/Search-glass.png");
cursor: default;
}
.textbox-input-searchimage[chromedir="rtl"] {
list-style-image: url("chrome://global/skin/icons/Search-glass-rtl.png");
}
.textbox-input-closebutton {
-moz-appearance: none;
margin: 1px 2px 1px 1px;
min-width: 0;
background-color: transparent;
border: none;
padding: 0 !important;
list-style-image: url("moz-icon://stock/gtk-clear?size=menu");
width: 16px;
height: 16px;
cursor: default;
}
.textbox-input-closebutton > .button-box {
margin: 0;
padding: 0;
border: 0;
}
.small, .small[disabled="true"] {
font-size: x-small;
min-width: 0px;
@ -132,14 +97,6 @@
border: 0px;
}
#searchFilter {
padding: 0px;
}
#searchFilter .textbox-input-box {
padding: 2px 2px 3px 4px;
}
%ifdef PLACES_QUERY_BUILDER
/* Calendar */
.history-calendar {

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

@ -300,41 +300,6 @@
border-color: transparent;
}
/* Search Bar */
#searchbar {
margin-top: 6px;
-moz-margin-start: 2px;
-moz-margin-end: -4px;
}
.textbox-input-searchimage {
display: none;
}
.textbox-input-closebutton {
-moz-appearance: none;
margin: -2px 0;
-moz-margin-end: -2px;
min-width: 0;
background-color: transparent;
border: none;
padding: 0 !important;
list-style-image: url("chrome://global/skin/icons/closetab.png");
width: 16px;
height: 16px;
cursor: default;
}
.textbox-input-closebutton > .button-box {
margin: 0;
padding: 0;
border: none;
}
.textbox-input-closebutton:hover:active {
list-style-image: url("chrome://global/skin/icons/closetab-active.png");
}
.small {
font-size: x-small;
min-width: 0px;
@ -349,31 +314,6 @@
border: 0px;
}
#searchFilter {
-moz-appearance: none;
border: 3px solid;
-moz-border-top-colors: #676767 #C5C5C5 -moz-Field;
-moz-border-bottom-colors: #C2C2C2 #A4A4A4 -moz-Field;
-moz-border-right-colors: #969696 #C5C5C5 -moz-Field;
-moz-border-left-colors: #969696 #C5C5C5 -moz-Field;
-moz-border-radius: 12px;
background: url("chrome://global/skin/icons/search-textbox.png") -moz-Field no-repeat 1px center;
-moz-background-clip: border !important;
padding: 0;
-moz-padding-start: 14px;
}
#searchFilter[focused="true"] {
outline: 2px solid #4F8EC9;
-moz-outline-radius: 12px;
-moz-outline-offset: -2px;
}
#searchFilter > .textbox-input-box {
padding: 2px;
border-left: 2px solid transparent;
}
.filterList {
-moz-appearance: none;
background-color: transparent;

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

@ -131,56 +131,11 @@
border: 0px;
}
/* Search Bar */
#searchbar {
margin: 6px -4px 0px 2px;
}
#infoPaneBox {
border-top: 1px solid ThreeDShadow;
padding: 5px;
}
.textbox-input-searchimage {
margin: 2px 0;
-moz-margin-end: 2px;
list-style-image: url("chrome://global/skin/icons/Search-glass.png");
-moz-image-region: rect(0px 16px 16px 0px);
cursor: default;
}
.textbox-input-searchimage[chromedir="rtl"] {
list-style-image: url("chrome://global/skin/icons/Search-glass-rtl.png");
}
.textbox-input-closebutton {
-moz-appearance: none;
margin: 1px 2px 1px 1px;
min-width: 0;
background-color: transparent;
border: none;
padding: 0 !important;
list-style-image: url("chrome://global/skin/icons/Search-close.png");
-moz-image-region: rect(0px 16px 16px 0px);
width: 14px;
height: 14px;
cursor: default;
}
.textbox-input-closebutton > .button-box {
margin: 0;
padding: 0;
border: 0;
}
.textbox-input-closebutton:hover {
-moz-image-region: rect(0px 32px 16px 16px);
}
.textbox-input-closebutton:hover:active {
-moz-image-region: rect(0px 48px 16px 32px);
}
.small, .small[disabled="true"] {
font-size: x-small;
min-width: 0px;
@ -195,15 +150,6 @@
border: 0px;
}
#searchFilter {
padding: 0px;
margin: 0px;
}
#searchFilter .textbox-input-box {
padding: 2px 2px 3px 4px;
}
%ifdef PLACES_QUERY_BUILDER
/* Calendar */
.history-calendar {