External.menuArguments image index

In summary, the person created a DLL that contains JavaScript plugins for the IE right click menu. They haven't restricted display to the proper context in the registry yet. Functions so far include taking selected text and opening a new page, and searching selected text on Google.
  • #1
my_wan
868
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
  • #2
I got the image index. This worked;
var altV = external.menuArguments.event.srcElement.attributes('alt').value;

Still trying to think of more functions.

Thanks.
 
  • #3


I would suggest exploring the use of document object models (DOMs) in your JavaScript code to retrieve the proper image index. DOMs provide a structured representation of the HTML document and allow for easier manipulation of elements within the document. You could potentially use methods such as getElementsByTagName() or getElementsByClassName() to retrieve the index of the right clicked image.

In terms of additional functions for your DLL, I would suggest considering incorporating functionality for scientific databases or research tools. For example, you could create a function that takes selected text and searches for related articles in a specific scientific journal or database. This could be useful for researchers looking to quickly access relevant information.

Overall, your DLL seems to have some useful functions for researchers and I would encourage you to continue exploring and expanding its capabilities.
 

1. What does the "External.menuArguments image index" refer to?

The "External.menuArguments image index" refers to a property that is used in the creation of context menus in web browsers. It allows developers to specify the index of an image in the context menu, which can then be used to perform certain actions on the image.

2. How is the "External.menuArguments image index" different from other menu arguments?

The "External.menuArguments image index" is specific to images in context menus, whereas other menu arguments may refer to different types of content or actions. This property is only available in certain browsers, such as Internet Explorer and Firefox, and is not a standard feature of all web browsers.

3. Can the "External.menuArguments image index" be used to manipulate images on a webpage?

No, the "External.menuArguments image index" is a read-only property and cannot be used to directly manipulate images on a webpage. Its main purpose is to provide developers with information about the image, such as its index, so that they can perform actions on it through other means.

4. How can I access the "External.menuArguments image index" in my code?

To access the "External.menuArguments image index" in your code, you can use the "menuArguments" property of the context menu event. This will return an object that contains information about the context menu, including the "image index" property.

5. Are there any alternatives to using the "External.menuArguments image index" in context menus?

Yes, there are alternative methods for creating context menus and performing actions on images. For example, you can use JavaScript to get the image element and perform actions on it, or you can use CSS to style the context menu. However, the "External.menuArguments image index" can be a useful tool for developers who want to access specific information about the image in the context menu.

Similar threads

Replies
17
Views
2K
  • Programming and Computer Science
Replies
4
Views
4K
  • Feedback and Announcements
Replies
3
Views
1K
  • Programming and Computer Science
Replies
6
Views
2K
  • Computing and Technology
Replies
3
Views
2K
  • Programming and Computer Science
Replies
2
Views
4K
  • Computing and Technology
Replies
3
Views
1K
  • Astronomy and Astrophysics
Replies
4
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • High Energy, Nuclear, Particle Physics
Replies
7
Views
1K
Back
Top