temp workaround for 23669: don't go to url on middle mouse clicks

if we're over a text field or area, because the event was probably
already handled by the editor and we shouldn't have gotten it at all.
Code from joki, r=me.
This commit is contained in:
akkana%netscape.com 2006-09-14 05:44:05 +00:00
Родитель 549e5879ac
Коммит 252da28272
2 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -1263,15 +1263,20 @@ function BrowserEditBookmarks()
return url;
}
function browserLoadClipboardURL()
function browserLoadClipboardURL(target)
{
var url = readFromClipboard();
dump ("URL on clipboard: '" + url + "'; length = " + url.length + "\n");
if (url.length > 0)
if (!((target.tagName.toUpperCase() == "INPUT"
&& (target.type == "" || target.type.toUpperCase() == "TEXT"))
|| target.tagName.toUpperCase() == "TEXTAREA"))
{
var urlBar = document.getElementById("urlbar");
urlBar.value = url;
BrowserLoadURL();
var url = readFromClipboard();
dump ("URL on clipboard: '" + url + "'; length = " + url.length + "\n");
if (url.length > 0)
{
var urlBar = document.getElementById("urlbar");
urlBar.value = url;
BrowserLoadURL();
}
}
}

Просмотреть файл

@ -412,7 +412,7 @@ Contributor(s): ______________________________________. -->
<splitter id="sidebar-splitter" chromeclass="extrachrome" />
<box id="appcontent" align="vertical" flex="100%"
onclick="if (event.button==2) browserLoadClipboardURL();"
onclick="if (event.button==2) browserLoadClipboardURL(event.target);"
ondragover="return DragOverContentArea(event);"
ondragdrop="return DropOnContentArea(event);">