bug 233205 Pressing Ctrl+Enter does not remove trailing spaces, patch by Patrick McCormick (patrick@meer.net), r=me

git-svn-id: svn://10.0.0.236/trunk@157123 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mconnor%myrealbox.com
2004-05-30 15:51:02 +00:00
parent 7297f133b2
commit 8157f0c8b5

View File

@@ -1396,19 +1396,28 @@ function canonizeUrl(aTriggeringEvent, aPostDataRef)
// Prevent suffix when already exists www , http , /
if (!/^(www|http)|\/\s*$/i.test(url)) {
var suffix = null;
if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
aTriggeringEvent.ctrlKey && 'shiftKey' in aTriggeringEvent &&
aTriggeringEvent.shiftKey)
// Tack http://www. and .org on.
url = "http://www." + url + ".org/";
suffix = ".org/";
else if (aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
aTriggeringEvent.ctrlKey)
// Tack www. and .com on.
url = "http://www." + url + ".com/";
suffix = ".com/";
else if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent &&
aTriggeringEvent.shiftKey)
// Tack www. and .org on.
url = "http://www." + url + ".net/";
suffix = ".net/";
if (suffix != null) {
// trim leading/trailing spaces (bug 233205)
url = url.replace( /^\s+/, "");
url = url.replace( /\s+$/, "");
// Tack www. and suffix on.
url = "http://www." + url + suffix;
}
}
gURLBar.value = getShortcutOrURI(url, aPostDataRef);