зеркало из https://github.com/mozilla/pjs.git
Bug 391385 - Split PopupAutoComplete in three: UrlbarAutoComplete, SearchAutoComplete and ContentAutoComplete, patch by Simon Bünzli <zeniko@gmail.com>, r=gavin
This commit is contained in:
Родитель
cf63818e55
Коммит
4a27aaed4a
|
@ -1,13 +1,18 @@
|
||||||
|
/* ::::: search bar ::::: */
|
||||||
searchbar {
|
searchbar {
|
||||||
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
|
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#SearchAutoComplete {
|
||||||
|
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar-result-popup");
|
||||||
|
}
|
||||||
|
|
||||||
/* ::::: location bar ::::: */
|
/* ::::: location bar ::::: */
|
||||||
#urlbar {
|
#urlbar {
|
||||||
-moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
|
-moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
#PopupAutoComplete {
|
#UrlbarAutoComplete {
|
||||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-result-popup");
|
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-result-popup");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,9 @@
|
||||||
onclick="checkForMiddleClick(this, event);"/>
|
onclick="checkForMiddleClick(this, event);"/>
|
||||||
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
|
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
|
||||||
|
|
||||||
<panel type="autocomplete" chromedir="&locale.dir;" id="PopupAutoComplete" noautofocus="true"/>
|
<panel type="autocomplete" chromedir="&locale.dir;" id="UrlbarAutoComplete" noautofocus="true"/>
|
||||||
|
<panel type="autocomplete" chromedir="&locale.dir;" id="SearchAutoComplete" noautofocus="true"/>
|
||||||
|
<panel type="autocomplete" chromedir="&locale.dir;" id="ContentAutoComplete" noautofocus="true"/>
|
||||||
|
|
||||||
<panel id="editBookmarkPanel" orient="vertical">
|
<panel id="editBookmarkPanel" orient="vertical">
|
||||||
<vbox id="editBookmarkPanelContent" flex="1"/>
|
<vbox id="editBookmarkPanelContent" flex="1"/>
|
||||||
|
@ -220,7 +222,7 @@
|
||||||
chromedir="&locale.dir;"
|
chromedir="&locale.dir;"
|
||||||
type="autocomplete"
|
type="autocomplete"
|
||||||
autocompletesearch="history"
|
autocompletesearch="history"
|
||||||
autocompletepopup="PopupAutoComplete"
|
autocompletepopup="UrlbarAutoComplete"
|
||||||
completeselectedindex="true"
|
completeselectedindex="true"
|
||||||
tabscrolling="true"
|
tabscrolling="true"
|
||||||
showcommentcolumn="true"
|
showcommentcolumn="true"
|
||||||
|
@ -300,7 +302,8 @@
|
||||||
<toolbaritem id="search-container" title="&searchItem.title;"
|
<toolbaritem id="search-container" title="&searchItem.title;"
|
||||||
align="center" class="chromeclass-toolbar-additional"
|
align="center" class="chromeclass-toolbar-additional"
|
||||||
flex="100" persist="width">
|
flex="100" persist="width">
|
||||||
<searchbar id="searchbar" flex="1" chromedir="&locale.dir;"/>
|
<searchbar id="searchbar" flex="1" chromedir="&locale.dir;"
|
||||||
|
autocompletepopup="SearchAutoComplete"/>
|
||||||
</toolbaritem>
|
</toolbaritem>
|
||||||
|
|
||||||
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||||
|
@ -430,7 +433,7 @@
|
||||||
flex="1" contenttooltip="aHTMLTooltip"
|
flex="1" contenttooltip="aHTMLTooltip"
|
||||||
contentcontextmenu="contentAreaContextMenu"
|
contentcontextmenu="contentAreaContextMenu"
|
||||||
onnewtab="BrowserOpenTab();"
|
onnewtab="BrowserOpenTab();"
|
||||||
autocompletepopup="PopupAutoComplete"
|
autocompletepopup="ContentAutoComplete"
|
||||||
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"
|
ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"
|
||||||
onclick="return contentAreaClick(event, false);"/>
|
onclick="return contentAreaClick(event, false);"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
|
@ -504,7 +504,8 @@
|
||||||
|
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="urlbar-result-popup" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-result-popup">
|
<binding id="urlbar-result-popup"
|
||||||
|
extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-result-popup">
|
||||||
<implementation>
|
<implementation>
|
||||||
<method name="onPopupClick">
|
<method name="onPopupClick">
|
||||||
<parameter name="aEvent"/>
|
<parameter name="aEvent"/>
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
anonid="searchbar-textbox"
|
anonid="searchbar-textbox"
|
||||||
type="autocomplete"
|
type="autocomplete"
|
||||||
flex="1"
|
flex="1"
|
||||||
autocompletepopup="PopupAutoComplete"
|
|
||||||
autocompletesearch="search-autocomplete"
|
autocompletesearch="search-autocomplete"
|
||||||
autocompletesearchparam="searchbar-history"
|
autocompletesearchparam="searchbar-history"
|
||||||
timeout="250"
|
timeout="250"
|
||||||
|
@ -98,7 +97,7 @@
|
||||||
completeselectedindex="true"
|
completeselectedindex="true"
|
||||||
showcommentcolumn="true"
|
showcommentcolumn="true"
|
||||||
tabscrolling="true"
|
tabscrolling="true"
|
||||||
xbl:inherits="disabled,disableautocomplete,searchengine,src">
|
xbl:inherits="disabled,disableautocomplete,autocompletepopup,searchengine,src">
|
||||||
</xul:textbox>
|
</xul:textbox>
|
||||||
</xul:hbox>
|
</xul:hbox>
|
||||||
|
|
||||||
|
@ -839,4 +838,35 @@
|
||||||
<children/>
|
<children/>
|
||||||
</content>
|
</content>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
|
<binding id="searchbar-result-popup"
|
||||||
|
extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-result-popup">
|
||||||
|
<implementation>
|
||||||
|
<method name="onPopupClick">
|
||||||
|
<parameter name="aEvent"/>
|
||||||
|
<body><![CDATA[
|
||||||
|
var controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController);
|
||||||
|
|
||||||
|
// default action on unmodified left-click
|
||||||
|
if (aEvent.button == 0 && !aEvent.shiftKey && !aEvent.ctrlKey &&
|
||||||
|
!aEvent.altKey && !aEvent.metaKey) {
|
||||||
|
controller.handleEnter();
|
||||||
|
}
|
||||||
|
// completely ignore right-clicks
|
||||||
|
else if (aEvent.button != 2) {
|
||||||
|
// handle search bar click
|
||||||
|
var search = controller.getValueAt(this.tree.view.selection.currentIndex);
|
||||||
|
var textbox = this.mInput;
|
||||||
|
|
||||||
|
// close the autocomplete popup and copy the selected value to the search box
|
||||||
|
this.closePopup();
|
||||||
|
textbox.value = search;
|
||||||
|
// open the search results according to the clicking subtlety
|
||||||
|
var where = whereToOpenLink(aEvent, false, true);
|
||||||
|
textbox._getParentSearchbar().doSearch(search, where);
|
||||||
|
}
|
||||||
|
]]></body>
|
||||||
|
</method>
|
||||||
|
</implementation>
|
||||||
|
</binding>
|
||||||
</bindings>
|
</bindings>
|
||||||
|
|
|
@ -914,15 +914,15 @@ toolbar[iconsize="small"] #paste-button:not([disabled="true"]):hover:active {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PopupAutoComplete {
|
#UrlbarAutoComplete {
|
||||||
direction: ltr !important;
|
direction: ltr !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
|
#UrlbarAutoComplete[chromedir="rtl"] > tree > treerows {
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PopupAutoComplete .autocomplete-treebody {
|
#UrlbarAutoComplete .autocomplete-treebody {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче