vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom JavaScript and Quick Edit (https://vborg.vbsupport.ru/showthread.php?t=197010)

Pat-D 11-23-2008 09:01 AM

Custom JavaScript and Quick Edit
 
I have a custom tag, implemented as plugin since the basic BBcode doesn't do it, that needs a JavaScript function call for full functionality.
Works just fine on new posts, page reloads, ...

However, the initialization JavaScript function is not called when the post is modified via Quick Edit (inline Ajax / Edit).

Is there some way around that problem?

Lynne 11-23-2008 04:53 PM

Put the javascript in the showthread template?

Pat-D 11-23-2008 05:28 PM

By now, I don't even think this is a VB problem, but, rather, a browser feature.

The plugin gets something like
[bb] ... content ... [/bb]
and returns something like
Code:

<div id="myID"> ... modified content ... </div>
<script type="text/javascript">myFunction("myID")</script>

And, well, that script never runs when the post is updated "inline".


Is there an Ajax callback?
Or some decent place to put an extra call without the need to edit any .js files?

Lynne 11-23-2008 06:47 PM

A decent place to put your javascript function "myFunction"? As I said before, if you say it's missing in the showthread, then why not insert it into the SHOWTHREAD template?

Pat-D 11-25-2008 03:23 PM

What I would need is something like "Hook: ajax_complete", but on the browser end, not server side.


All times are GMT. The time now is 10:21 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.01690 seconds
  • Memory Usage 1,709KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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