diff --git a/mozilla/minimo/chrome/content/minimo.js b/mozilla/minimo/chrome/content/minimo.js index 0156dea57b8..139ebf9f6a2 100755 --- a/mozilla/minimo/chrome/content/minimo.js +++ b/mozilla/minimo/chrome/content/minimo.js @@ -41,6 +41,9 @@ const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; var gBookmarksDoc=null; var gURLBar = null; +var gClickSelectsAll = true; +var gIgnoreFocus = false; +var gIgnoreClick = false; var gBrowserStatusHandler; var gSelectedTab=null; var gFullScreen=false; @@ -239,6 +242,8 @@ function MiniNavStartup() try { gURLBar = document.getElementById("urlbar"); + gURLBar.setAttribute("completedefaultindex", "true"); + var currentTab=getBrowser().selectedTab; browserInit(currentTab); gSelectedTab=currentTab; @@ -1076,11 +1081,31 @@ function URLBarEntered() return true; } -function URLBarFocusHandler() + +function URLBarFocusHandler(aEvent, aElt) { + if (gIgnoreFocus) + gIgnoreFocus = false; + else if (gClickSelectsAll) + aElt.select(); + + gURLBar.setAttribute("open", "true"); gURLBar.showHistoryPopup(); } +function URLBarMouseDownHandler(aEvent, aElt) +{ + gIgnoreFocus = true; + gIgnoreClick = false; + aElt.setSelectionRange(0, 0); +} + +function URLBarClickHandler(aEvent, aElt) +{ + if (!gIgnoreClick && aElt.selectionStart == aElt.selectionEnd) + aElt.select(); +} + var gRotationDirection = true; function BrowserScreenRotate() diff --git a/mozilla/minimo/chrome/content/minimo.xul b/mozilla/minimo/chrome/content/minimo.xul index bd853986a4c..178dcb8baec 100755 --- a/mozilla/minimo/chrome/content/minimo.xul +++ b/mozilla/minimo/chrome/content/minimo.xul @@ -132,15 +132,16 @@ - + ontextentered="return URLBarEntered();" + onfocus="URLBarFocusHandler(event, this);" + onmousedown="URLBarMouseDownHandler(event, this);" + onclick="URLBarClickHandler(event, this);">