Results 1 to 9 of 9

Thread: JavaScript RightContext : A REAL right click context menu

  1. #1
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile JavaScript RightContext : A REAL right click context menu

    1) CODE TITLE: RightContext

    2) AUTHOR NAME/NOTES: Harel Malka

    3) DESCRIPTION:

    RightContext is a supercharged right click context menu. I created it to answer a few requirements I had of context menus which I could not find anywhere else; mainly provide the *correct* contextualized menu items depending on what was right clicked. So now when you click a name link for example, the context menu can provide you with links relating to the contact’s email, phone, address etc.
    RightContext generates unique context menus that are built based on the DOM element clicked using special attributes embedded in the element’s Html. The attributes are custom generated and can be anything.
    Menu items can include [tags] referencing those attributes, which will cause them to be transformed to contain the actual values when the menu is constructed (i.e., when an element is right clicked.)

    Features include:

    * Menu items that link somewhere
    * Menu items that perform a custom javascript function
    * Menu items that display hardcoded text
    * Menu items that retrieve text via a remote ‘ajax’ call
    * Menu item separators
    * Image icons for menu items
    * Supports multiple different menus that can be called depending on the element clicked
    * All menu items can contain [tags] which are transformed at runtime to the values embedded in the clicked element
    * Conditional evaluation of menu items. An item can show or not show depending on a specified condition in the menu template (new in v0.2.3)
    * CSS based look and feel
    * Unobtrusive standalone javascript: no additional js framework required.


    4) URL TO CODE:

    http://www.harelmalka.com/?p=60
    Demo at:
    http://www.harelmalka.com/rightcontext

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Very interesting. It overrides a useful function, but it seems applicable for an internet 'application' setting.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    That would be handy, but for the tendency of new browsers to disallow overriding of the context menu.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Which "new" browsers?
    Clearly, it's an invasion of defaults, but with a legitimate use, seems like it would be useful.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Opera, Konqueror, Firefox, Netscape, and, I think, Safari, to name a few.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Overiding defaults

    Hi,
    Thanks for the comments.
    It only overrides the browser right menu button for the elements you want the context menus form.
    As for the browser defaults, I had Firefox 2 installed without the context menu disabled, though I hear about people who have it so as their default.
    It doesn't seem possible to read that setting from javascript, but the script will degrade nicely if it's not allowed.

    Harel

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Definitely doesn't work in Opera.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Yes, It does not work in Opera

    Though I'll work on fixing that problem shortly.
    Harel

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Good luck with that.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •