зеркало из https://github.com/mozilla/pjs.git
URLBAR deck selector.
This commit is contained in:
Родитель
a5fcb0754c
Коммит
8b545edaf1
|
@ -48,6 +48,8 @@ var gGlobalHistory = null;
|
|||
var gURIFixup = null;
|
||||
var gShowingMenuPopup=null;
|
||||
var gFocusedElementHREFContextMenu=null;
|
||||
var gDeckMode=0; // 0 = site, 1 = sb, 2= rss. Used for the URLBAR selector, DeckMode impl.
|
||||
var gDeckMenuChecked=null; // to keep the state of the checked URLBAR selector mode.
|
||||
|
||||
var gPref = null; // so far snav toggles on / off via direct access to pref.
|
||||
// See bugzilla.mozilla.org/show_bug.cgi?id=311287#c1
|
||||
|
@ -624,6 +626,20 @@ function BrowserViewRSS() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deckmode urlbar selector.
|
||||
* Toggles menu item and deckmode.
|
||||
*/
|
||||
function BrowserViewDeckSB() {
|
||||
if(gDeckMode==1) BrowserSetDeck(0,null); else BrowserSetDeck(1,document.getElementById("command_ViewDeckSB"));
|
||||
}
|
||||
|
||||
function BrowserViewDeckSearch() {
|
||||
if(gDeckMode==2) BrowserSetDeck(0,null); else BrowserSetDeck(2,document.getElementById("command_ViewDeckSearch"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Has to go through some other approach like a XML-based rule system.
|
||||
* Those are constraints conditions and action.
|
||||
|
@ -764,6 +780,22 @@ function DoBrowserSearch() {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Search extension to urlbar, deckmode.
|
||||
* Called form the deckmode urlbar selector
|
||||
*/
|
||||
|
||||
function DoBrowserSearchURLBAR(vQuery) {
|
||||
BrowserViewSearch();
|
||||
try {
|
||||
if(vQuery!="") {
|
||||
getBrowser().selectedTab = getBrowser().addTab('http://www.google.com/xhtml?q='+vQuery+'&hl=en&lr=&safe=off&btnG=Search&site=search&mrestrict=xhtml');
|
||||
browserInit(getBrowser().selectedTab);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Toolbar specific code - to be removed from here */
|
||||
|
||||
function DoBrowserRSS(sKey) {
|
||||
|
@ -951,6 +983,16 @@ function URLBarEntered()
|
|||
return;
|
||||
}
|
||||
|
||||
// SB mode
|
||||
if(gDeckMode==1) {
|
||||
DoBrowserSB(gURLBar.value);
|
||||
return;
|
||||
}
|
||||
|
||||
if(gDeckMode==2) {
|
||||
DoBrowserSearchURLBAR(gURLBar.value);
|
||||
return;
|
||||
}
|
||||
/* Other normal cases */
|
||||
|
||||
var fixedUpURI = gURIFixup.createFixupURI(url, 2 /*fixup url*/ );
|
||||
|
@ -1016,6 +1058,24 @@ function MenuPopupHidden() {
|
|||
gShowingMenuPopup=false;
|
||||
}
|
||||
|
||||
/* The URLBAR Deck mode selector
|
||||
*/
|
||||
|
||||
function BrowserSetDeck(dMode,menuElement) {
|
||||
|
||||
if(gDeckMenuChecked!=null) {
|
||||
gDeckMenuChecked.setAttribute("checked","false");
|
||||
}
|
||||
gDeckMenuChecked=menuElement;
|
||||
|
||||
if(menuElement!=null) menuElement.setAttribute("checked","true");
|
||||
|
||||
gDeckMode=dMode;
|
||||
if(dMode==2) document.getElementById("urlbar-deck").className='search';
|
||||
if(dMode==1) document.getElementById("urlbar-deck").className='sb';
|
||||
if(dMode==0) document.getElementById("urlbar-deck").className='';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -81,8 +81,12 @@
|
|||
<command id="cmd_BrowserTestDialogs" oncommand="BrowserTestDialogs()"/>
|
||||
<command id="cmd_BrowserTestSendSMS" oncommand="BrowserTestSendSMS()"/>
|
||||
<command id="cmd_ViewOptions" oncommand="BrowserViewOptions()"/>
|
||||
<!--
|
||||
<command id="cmd_ViewRSS" oncommand="BrowserViewRSS()"/>
|
||||
<command id="cmd_ViewSearch" oncommand="BrowserViewSearch()"/>
|
||||
-->
|
||||
<command id="cmd_ViewDeckSB" oncommand="BrowserViewDeckSB()"/>
|
||||
<command id="cmd_ViewDeckSearch" oncommand="BrowserViewDeckSearch()"/>
|
||||
<command id="cmd_ViewFind" oncommand="BrowserViewFind()"/>
|
||||
<command id="cmd_BrowserOpenLinkAsNewTab" oncommand="BrowserOpenLinkAsTab()" />
|
||||
<command id="cmd_BrowserBack" oncommand="BrowserBack()" />
|
||||
|
@ -134,6 +138,11 @@
|
|||
autocompletepopup="PopupAutoComplete"
|
||||
onfocus="URLBarFocusHandler();"
|
||||
ontextentered="return URLBarEntered();">
|
||||
|
||||
<deck id='proxy-deck'>
|
||||
<image id="urlbar-deck" />
|
||||
</deck>
|
||||
|
||||
<hbox>
|
||||
<button type="menu" style="-moz-user-focus: none" class="plain" id="feed-button">
|
||||
<menupopup id='feed-button-menu' position="after_end" />
|
||||
|
@ -211,10 +220,16 @@
|
|||
-->
|
||||
<menuitem id="command_DoPanelPreferences" command="cmd_DoPanelPreferences" label="&prefs.label;" />
|
||||
<!-- separator for now in CSS - need to redesign -->
|
||||
<menuitem id="command_ViewOptions" class="separator-menu" type="checkbox" command="cmd_ViewOptions" label="&zoom.label;" />
|
||||
|
||||
<menuitem id="command_ViewDeckSB" class="separator-menu" type="checkbox" command="cmd_ViewDeckSB" label="&decksb.label;" />
|
||||
<menuitem id="command_ViewDeckSearch" type="checkbox" command="cmd_ViewDeckSearch" label="&decksearch.label;" />
|
||||
|
||||
<menuitem id="command_ViewOptions" type="checkbox" command="cmd_ViewOptions" label="&zoom.label;" />
|
||||
<menuitem id="command_ViewFind" type="checkbox" command="cmd_ViewFind" label="&findToolbar.label;" />
|
||||
<!--
|
||||
<menuitem id="command_ViewRSS" type="checkbox" command="cmd_ViewRSS" label="&rssBMtitle.label;" />
|
||||
<menuitem id="command_ViewSearch" type="checkbox" command="cmd_ViewSearch" label="&searchToolbar.label;" />
|
||||
<menuitem id="command_ViewFind" type="checkbox" command="cmd_ViewFind" label="&findToolbar.label;" />
|
||||
-->
|
||||
|
||||
<!-- separator for now in CSS - need to redesign -->
|
||||
<menuitem id="command_Quit" class="separator-menu" command="cmd_Quit" label="&quit.label;" />
|
||||
|
|
|
@ -44,5 +44,7 @@ minimo.jar:
|
|||
skin/classic/minimo/down.png (skin/down.png)
|
||||
skin/classic/minimo/transfer.jpg (skin/transfer.jpg)
|
||||
skin/classic/minimo/preferences/options.png (skin/preferences/options.png)
|
||||
skin/classic/minimo/extensions/icon-delicious.png (skin/extensions/icon-delicious.png)
|
||||
skin/classic/minimo/extensions/icon-google.png (skin/extensions/icon-google.png)
|
||||
branding/locale/brand.dtd (locale/en-US/brand.dtd)
|
||||
branding/locale/brand.properties (locale/en-US/brand.properties)
|
||||
|
|
|
@ -26,6 +26,11 @@
|
|||
<!ENTITY reloadCmd.label "Reload">
|
||||
<!ENTITY linknewtab.label "Open link in New Tab">
|
||||
|
||||
<!-- menu urlabr view options -->
|
||||
|
||||
<!ENTITY decksb.label "Search By Tag" >
|
||||
<!ENTITY decksearch.label "Search Mode" >
|
||||
|
||||
<!-- toolbar view options -->
|
||||
|
||||
<!ENTITY zoom.label "Zoom" >
|
||||
|
|
|
@ -224,4 +224,23 @@ caption {
|
|||
list-style-image: url("chrome://minimo/skin/rssfavicon.png");
|
||||
}
|
||||
|
||||
/*
|
||||
* urlbar selector icons, these are extensions
|
||||
* and should be placed somewhere else.
|
||||
*/
|
||||
|
||||
#urlbar-deck {
|
||||
|
||||
}
|
||||
|
||||
#urlbar-deck.sb {
|
||||
list-style-image: url("chrome://minimo/skin/extensions/icon-delicious.png");
|
||||
}
|
||||
|
||||
#urlbar-deck.search {
|
||||
list-style-image: url("chrome://minimo/skin/extensions/icon-google.png");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче