зеркало из https://github.com/mozilla/gecko-dev.git
Add Keywords menu by the urlbar
This commit is contained in:
Родитель
4272fa7e4b
Коммит
051db5b733
|
@ -535,6 +535,50 @@ function Shutdown()
|
|||
RefreshUrlbar();
|
||||
}
|
||||
|
||||
function setKeyword(index)
|
||||
{
|
||||
urlbar = document.getElementById('urlbar');
|
||||
if (!urlbar)
|
||||
return;
|
||||
switch(index) {
|
||||
case 0:
|
||||
urlbar.focus();
|
||||
urlbar.value = bundle.GetStringFromName("quoteKeyword");
|
||||
urlbar.setSelectionRange(14,33);
|
||||
break;
|
||||
case 1:
|
||||
urlbar.focus();
|
||||
urlbar.value = bundle.GetStringFromName("localKeyword");
|
||||
urlbar.setSelectionRange(12,27);
|
||||
break;
|
||||
case 2:
|
||||
urlbar.focus();
|
||||
urlbar.value = bundle.GetStringFromName("shopKeyword");
|
||||
urlbar.setSelectionRange(13,22);
|
||||
break;
|
||||
case 3:
|
||||
urlbar.focus();
|
||||
urlbar.value = bundle.GetStringFromName("careerKeyword");
|
||||
urlbar.setSelectionRange(8,19);
|
||||
break;
|
||||
case 4:
|
||||
if (appCore)
|
||||
appCore.loadUrl(bundle.GetStringFromName("webmailKeyword"));
|
||||
else
|
||||
dump("Couldn't find instance of BrowserAppCore\n");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (appCore)
|
||||
appCore.loadUrl(bundle.GetStringFromName("keywordList"));
|
||||
else
|
||||
dump("Couldn't find instance of BrowserAppCore\n");
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function OpenBookmarkURL(node, datasources)
|
||||
{
|
||||
if (node.getAttribute('container') == "true") {
|
||||
|
|
|
@ -348,6 +348,19 @@ Contributor(s): ______________________________________. -->
|
|||
<!-- This is the smart search pop-up -->
|
||||
<!-- <titledbutton id="action-popup" align="right"/> -->
|
||||
|
||||
<!-- this is the urlbar keyword/session history popup -->
|
||||
<menu>
|
||||
<titledbutton id="sessionhist-popup"/>
|
||||
<menupopup>
|
||||
<menuitem value=""eKeyword.label;" oncommand="setKeyword(0)"/>
|
||||
<menuitem value="&localKeyword.label;" oncommand="setKeyword(1)"/>
|
||||
<menuitem value="&shopKeyword.label;" oncommand="setKeyword(2)"/>
|
||||
<menuitem value="&careerKeyword.label;" oncommand="setKeyword(3)"/>
|
||||
<menuitem value="&webmailKeyword.label;" oncommand="setKeyword(4)"/>
|
||||
<menuitem value="&listKeywords.label;" oncommand="setKeyword(5)"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<titledbutton id="page-proxy-button" ondraggesture="DragProxyIcon(event);"/>
|
||||
|
||||
<!-- this is the urlbar -->
|
||||
|
|
|
@ -341,5 +341,11 @@
|
|||
<!ENTITY selectAllCmd.accesskey "l">
|
||||
<!ENTITY copyLinkCmd.label "Copy Link Location">
|
||||
<!ENTITY copyLinkCmd.accesskey "l">
|
||||
<!ENTITY quoteKeyword.label "Get a quote">
|
||||
<!ENTITY careerKeyword.label "Get a job">
|
||||
<!ENTITY shopKeyword.label "Shop Online">
|
||||
<!ENTITY webmailKeyword.label "Check your email">
|
||||
<!ENTITY localKeyword.label "Local Information">
|
||||
<!ENTITY listKeywords.label "List of Keywords">
|
||||
<!ENTITY copyImageCmd.label "Copy Image Location">
|
||||
<!ENTITY copyImageCmd.accesskey "m">
|
||||
|
|
|
@ -2,5 +2,10 @@ nv_done=Document: Done
|
|||
homePageDefault=http://www.mozilla.org/
|
||||
openFile=Open File
|
||||
defaultStatus=default status text
|
||||
|
||||
shopKeyword=keyword:shop [Product]
|
||||
quoteKeyword=keyword:quote [Enter symbol here]
|
||||
localKeyword=keyword:zip [Your zip code]
|
||||
keywordList=http://home.netscape.com/escapes/keywords
|
||||
webmailKeyword=http://webmail.netscape.com
|
||||
careerKeyword=keyword:[Your city] careers
|
||||
|
||||
|
|
|
@ -92,10 +92,11 @@ box#searchbutton {
|
|||
}
|
||||
|
||||
#sessionhist-popup {
|
||||
background-color: white;
|
||||
margin: 0px;
|
||||
background-color: #99CCCC;
|
||||
margin: 0px 4px 0px 0px;
|
||||
width: 10px;
|
||||
border: none;
|
||||
-moz-border-radius: 4px;
|
||||
list-style-image:url("chrome://global/skin/scroll-down.gif");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче