зеркало из https://github.com/mozilla/gecko-dev.git
137 строки
4.5 KiB
XML
137 строки
4.5 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://navigator/skin/navWidgets.css"?>
|
|
|
|
<bindings id="navigatorWidgetBindings"
|
|
xmlns="http://www.mozilla.org/xbl"
|
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
xmlns:xbl="http://www.mozilla.org/xbl">
|
|
|
|
<binding id="urlbar" extends="xul:box">
|
|
<content flex="1">
|
|
<xul:box class="urlbar-container" align="center" flex="1">
|
|
<xul:box class="urlbar-pre-buttons">
|
|
<children includes="button"/>
|
|
</xul:box>
|
|
<xul:menulist editable="true" class="location-field" flex="1"
|
|
autocomplete="true" timeout="300" searchSessionType="urlbar"
|
|
xbl:inherits="label=content"
|
|
tooltiptext="" ubattr="field"/>
|
|
<xul:button class="button-toolbar-3 go-button" label="Go"
|
|
ubattr="go-button" tooltiptext="Go"/>
|
|
<xul:box class="urlbar-post-buttons">
|
|
<children includes="button"/>
|
|
</xul:box>
|
|
</xul:box>
|
|
</content>
|
|
<implementation>
|
|
|
|
</implementation>
|
|
<handlers>
|
|
<handler event="command">
|
|
<![CDATA[
|
|
switch (event.originalTarget.getAttribute("ubattr")) {
|
|
case "go-button":
|
|
var menulist = this.getElementByAttribute("ubattr", "field");
|
|
menulist.loadURL();
|
|
break;
|
|
case "search-button":
|
|
this.doSearch();
|
|
break;
|
|
}
|
|
]]>
|
|
</handler>
|
|
</handlers>
|
|
</binding>
|
|
|
|
<binding id="menulist-editable" extends="chrome://global/content/bindings/menulist.xml#menulist">
|
|
<content>
|
|
<xul:box align="center" flex="1" class="menulist-container">
|
|
<xul:image class="menulist-icon" xbl:inherits="src" emattr="icon"/>
|
|
<xul:textbox class="menulist-editable-textbox plain" flex="1" emattr="field"
|
|
xbl:inherits="autocomplete,searchSessionType,timeout,tooltiptext=fieldtooltiptext,value"/>
|
|
<xul:menubutton class="menulist-editable-menubutton menubutton-icon" emattr="menubutton">
|
|
<xul:menupopup class="menulist-editable-menupopup" emattr="menupopup"
|
|
popupalign="topright" popupanchor="bottomright">
|
|
<children includes="template"/>
|
|
</xul:menupopup>
|
|
</xul:menubutton>
|
|
</xul:box>
|
|
</content>
|
|
</binding>
|
|
|
|
<binding id="urlbar-menulist" extends="chrome://navigator/content/navWidgetBindings.xml#menulist-editable">
|
|
<implementation>
|
|
</implementation>
|
|
<handlers>
|
|
|
|
<!-- Proxy Icon -->
|
|
<handler event="draggesture">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "icon") {
|
|
// Do Drag Processing for Proxy Icon
|
|
}
|
|
]]>
|
|
</handler>
|
|
|
|
<!-- Location Field -->
|
|
<handler event="click">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "field")
|
|
if (event.button == 0) this.doFocus();
|
|
]]>
|
|
</handler>
|
|
<handler event="blur">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "field")
|
|
this.doBlur();
|
|
]]>
|
|
</handler>
|
|
<handler event="keypress">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "field")
|
|
if (event.keyCode == 13) BrowserLoadURL(this.value);
|
|
]]>
|
|
</handler>
|
|
|
|
<!-- Location Bar Type-In History -->
|
|
<handler event="popupshowing">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "menupopup")
|
|
this.createUBHistory();
|
|
]]>
|
|
</handler>
|
|
<handler event="command">
|
|
<![CDATA[
|
|
if (event.originalTarget.getAttribute("emattr") == "menubutton") {
|
|
this.goToHistory();
|
|
return;
|
|
}
|
|
]]>
|
|
</handler>
|
|
</handlers>
|
|
</binding>
|
|
|
|
<!-- XXX work in progress -->
|
|
<binding id="back-button">
|
|
<content>
|
|
<xul:menubutton id="back-button" label="Back" buttontooltiptext="Go Back"
|
|
oncommand="gotoHistoryIndex(event);" buttonaction="BrowserBack();" context="backMenu"
|
|
class="menubutton-dual toolbar top" crop="right" observes="canGoBack">
|
|
<xul:menupopup onpopupshowing="BrowserBackMenu(event);"/>
|
|
</xul:menubutton>
|
|
</content>
|
|
<handlers>
|
|
<handler type="command">
|
|
<![CDATA[
|
|
if (event.originalTarget.localName == "button") {
|
|
// internal menubutton
|
|
}
|
|
]]>
|
|
</handler>
|
|
</handlers>
|
|
</binding>
|
|
|
|
</bindings>
|
|
|