vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Javascript links in popup menus! (https://vborg.vbsupport.ru/showthread.php?t=115025)

mousi 05-07-2006 10:00 PM

Javascript links in popup menus!
 
What is this hack?
Have you ever noticed that when there are links in the popup menus that use javascript, you must click on the text for the link to work? For example try "Quick Links->Open Buddy List" in this forum. If you just click on the td area and not on the text, the popup window doesn't show up.

You can fix this with this hack!

Modification:
1)Open ./clientscript/vbulletin_menu.js

2)Find:
Code:

tds[i].onclick = vB_Popup_Events.prototype.menuoption_onclick_link;
3)Replace it with:
Code:

var alphas = fetch_tags(tds[i], 'a');
if (alphas[0].onclick) {
        tds[i].onclick = alphas[0].onclick;
} else {
        tds[i].onclick = vB_Popup_Events.prototype.menuoption_onclick_link;
}

That's it. Now if you have a link like the following in a popup, it will work if you click on the entire td area:
Code:

<td class="vbmenu_option"><a href="#" onclick="doSomething();">Something</a></td>
This is my first hack. It's not something big, but I think it's usefull. If you like it please click Install.

Ahsin1 05-08-2006 01:49 AM

Screen Shots?

mousi 05-08-2006 03:41 AM

Quote:

Originally Posted by Ahsin1
Screen Shots?

Added one

yinyang 05-08-2006 04:18 AM

demo?

mousi 05-08-2006 04:30 AM

Not available demo right now... I will update later

Boofo 05-08-2006 06:14 AM

Can't you just do the label tags for this? ;)

mousi 05-08-2006 06:24 AM

Quote:

Originally Posted by Boofo
Can't you just do the label tags for this? ;)

Hmmm... I didn't understand this! What do you mean? Do what with label tags?

htscpl 05-08-2006 03:33 PM

*** installs ***

Not sure if it works or not. Most of my popup menus already had click on the box feature. In the 'User CP' is where I wanted it to work but those are not popups so not sure ??

Snake 05-08-2006 06:47 PM

Thanks man!

mousi 05-08-2006 08:49 PM

Quote:

Originally Posted by htscpl
*** installs ***

Not sure if it works or not. Most of my popup menus already had click on the box feature. In the 'User CP' is where I wanted it to work but those are not popups so not sure ??

These are not that kind of links. They are just simple <a href="something.php"> links. I know those worked fine ;)


All times are GMT. The time now is 02:25 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02439 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete