зеркало из https://github.com/mozilla/pjs.git
Focusing urlbar should select contents (37587). r=brade sr=ben
This commit is contained in:
Родитель
9307037990
Коммит
3f1af9615a
|
@ -107,7 +107,7 @@ pref("browser.search.powermode", 0);
|
|||
// (note: must be a string representation of a float or it'll default to 0.0)
|
||||
pref("browser.search.basic.min_ver", "0.0");
|
||||
pref("browser.urlbar.autocomplete.enabled", true);
|
||||
pref("browser.urlbar.clickSelectsAll",false);
|
||||
pref("browser.urlbar.clickSelectsAll", true);
|
||||
|
||||
pref("browser.history.last_page_visited", "");
|
||||
pref("browser.history_expire_days", 9);
|
||||
|
|
|
@ -51,6 +51,8 @@ pref("middlemouse.scrollbarPosition", true);
|
|||
// Clipboard behavior
|
||||
pref("clipboard.autocopy", true);
|
||||
|
||||
pref("browser.urlbar.clickSelectsAll", false);
|
||||
|
||||
// autocomplete keyboard grab workaround
|
||||
pref("autocomplete.grab_during_popup", true);
|
||||
pref("autocomplete.ungrab_during_mode_switch", true);
|
||||
|
|
|
@ -31,6 +31,7 @@ var gBrandBundle;
|
|||
var gNavigatorRegionBundle;
|
||||
var gBrandRegionBundle;
|
||||
var gLastValidURL = "";
|
||||
var gClickSelectsAll = -1;
|
||||
|
||||
var pref = Components.classes["@mozilla.org/preferences;1"]
|
||||
.getService(Components.interfaces.nsIPref);
|
||||
|
@ -1303,18 +1304,20 @@ function getNewThemes()
|
|||
loadURI(gBrandRegionBundle.getString("getNewThemesURL"));
|
||||
}
|
||||
|
||||
function URLBarMouseupHandler(aEvent)
|
||||
function URLBarFocusHandler(aEvent)
|
||||
{
|
||||
if (aEvent.button == 0 && pref.GetBoolPref("browser.urlbar.clickSelectsAll")) {
|
||||
var selectionLen = gURLBar.selectionEnd - gURLBar.selectionStart;
|
||||
if (selectionLen == 0)
|
||||
if (gURLBar) {
|
||||
if (gClickSelectsAll == -1)
|
||||
gClickSelectsAll = pref.GetBoolPref("browser.urlbar.clickSelectsAll");
|
||||
if (gClickSelectsAll)
|
||||
gURLBar.setSelectionRange(0, gURLBar.textLength);
|
||||
}
|
||||
}
|
||||
|
||||
function URLBarBlurHandler(aEvent)
|
||||
{
|
||||
if (pref.GetBoolPref("browser.urlbar.clickSelectsAll"))
|
||||
// XXX why the hell do we have to do this?
|
||||
if (gClickSelectsAll)
|
||||
gURLBar.setSelectionRange(0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -164,8 +164,7 @@ Contributor(s): ______________________________________. -->
|
|||
tooltip="aTooltip" tooltiptext="&locationBar.tooltip;"
|
||||
ontextcommand="return handleURLBarCommand(userAction);"
|
||||
ontextrevert="return handleURLBarRevert();"
|
||||
onmouseup="URLBarMouseupHandler(event);"
|
||||
onkeyup="URLBarKeyupHandler(event);"
|
||||
onfocus="URLBarFocusHandler(event);"
|
||||
onblur="URLBarBlurHandler(event);">
|
||||
<image id="page-proxy-button" allowevents="true"
|
||||
ondraggesture="PageProxyDragGesture(event);"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче