Автор: Nero2002
Дата сообщения: 07.02.2009 22:41
Нарисовал работающий jc_link.htm для FlashGet 1.73. В последнее время с "родным" htm начали появляться ошибки вида Объект не найден: srcEvent.clientX.
[more]
<script TYPE="text/javascript" LANGUAGE="JavaScript1.2">
function AddUrl(Url,Info)
{
var COMObj=new ActiveXObject("JetCar.Netscape");
if(COMObj)
{
COMObj.AddUrl(Url,Info,external.menuArguments.document.Url);
}
}
function OnContextMenu()
{
var srcEvent=external.menuArguments.event;
var EventElement;
if(typeof(srcEvent.clientX) == "undefined")
{
EventElement = external.menuArguments.document.elementFromPoint (srcEvent.pointerX, srcEvent.pointerY);
} else {
EventElement = external.menuArguments.document.elementFromPoint (srcEvent.clientX, srcEvent.clientY);
}
var srcAnchor;
if (srcEvent.type=="MenuExtAnchor")
{
srcAnchor=EventElement;
do
{
srcAnchor=srcAnchor.parentElement;
}
while (typeof(srcAnchor)=="HTMLAnchorElement");
AddUrl(srcAnchor.href,srcAnchor.innerText);
}
else if (srcEvent.type=="MenuExtImage")
{
if (typeof(EventElement)=="HTMLAreaElement")
{
AddUrl(EventElement.href,EventElement.Alt);
} else {
var srcImage=EventElement;
var srcAnchor=srcImage.parentElement;
do
{
srcAnchor=srcAnchor.parentElement;
if (typeof(srcAnchor)=="undefined")
{
AddUrl(srcImage.href,srcImage.Alt);
return;
}
}
while (typeof(srcAnchor)=="HTMLAnchorElement")
{
AddUrl(srcAnchor.href,srcImage.Alt);
}
}
}
else if (srcEvent.type=="MenuExtUnknown")
{
srcAnchor=EventElement;
if(srcAnchor != null && srcAnchor.tagName != null && srcAnchor.tagName.toLowerCase() == "a")
{
AddUrl(EventElement.href,EventElement.innerText);
} else {
while(srcAnchor != null && srcAnchor.tagName != null && srcAnchor.tagName.toLowerCase() != "a")
{
srcAnchor=srcAnchor.parentElement;
if(srcAnchor != null && srcAnchor.tagName != null && srcAnchor.tagName.toLowerCase() == "a")
{
AddUrl(srcAnchor.href,srcAnchor.innerText);
return;
}
}
}
if(EventElement != null && EventElement.tagName != null)
{
AddUrl(EventElement.href,EventElement.innerText);
}
}
}
OnContextMenu();
</script>
[/more]