External.menuArguments image index

  • Thread starter Thread starter my_wan
  • Start date Start date
  • Tags Tags
    Image Index
AI Thread Summary
A developer has created a DLL that adds JavaScript plugins to the Internet Explorer right-click menu, allowing users to perform various actions like copying the alt text of images to the clipboard. Initially, the script was set to retrieve the alt text from the first image on the page, but the developer sought help to correctly identify the right-clicked image. They successfully resolved the issue by using the event's source element to access the alt attribute. The DLL currently includes functions for opening arxiv.org entries, searching selected text on Dictionary.com, Google, and Wikipedia, as well as performing site-specific searches. The developer plans to enhance the functionality by adding clipboard defaults when no text is selected. Further suggestions for additional functions are welcomed.
my_wan
Messages
868
Reaction score
3
I've created a DLL that contains JavaScript plugins for the IE right click menu like this;
http://img407.imageshack.us/my.php?image=20165640mt5.jpg
I haven't restricted display to the proper context in the registry yet.

In the Alt Text entry I have a small script that looks like;
Code:
var altV = external.menuArguments.document.getElementsByTagName('img')[0].attributes('alt').value;
window.clipboardData.setData('Text', altV);

It simply copies the alt text of an image resource to the clipboard. The problem is that I'm not sure how to retrieve the proper image index of the right clicked image for the script. As you will notice it is simply set to ('img')[0] now which is just the first image on the page.

I would appreciate any suggestions on how to best retrieve the index of the right clicked image.

Any suggestions on more functions to put into the DLL would also be nice.

Functions so far:

arxiv.org
Simply take the selected text of an arxiv.org identify such as 0710.0364 and opens a new page to http://arxiv.org/abs/0710.0364.

Dictionary.com
Simply takes selected text such as Widget and opens a new page on http://dictionary.reference.com/browse/Widget

Google
Searches selected text in a new google window.

Site Search
Takes selected text, or if null the clipboard text, and does a google site search of that site in a new window, i.e., http://www.google.com/search?q=site:www.physicsforums.com+Widget

Wiki
Takes selected text and opens the wiki page for it, i.e., http://en.wikipedia.org/wiki/Widget

I'll be adding clipboard default when selection is null to most functions.

Thanks
 
Technology news on Phys.org
I got the image index. This worked;
var altV = external.menuArguments.event.srcElement.attributes('alt').value;

Still trying to think of more functions.

Thanks.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
3
Views
2K
Replies
4
Views
5K
Replies
2
Views
5K
Replies
6
Views
3K
Replies
104
Views
6K
Replies
4
Views
3K
  • Sticky
Replies
0
Views
4K
Back
Top