Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Are there javascript callbacks I can hook into after submitting comments?
dave_stewart
New
I'd like to run the syntaxhighlighter.all() after comments are edited to convert pre tags to highlighted code.
Is there something I can hook into? I'd rather not go down the setTimeout (hack) route.
Thanks,
Dave
Is there something I can hook into? I'd rather not go down the setTimeout (hack) route.
Thanks,
Dave
0
Comments
http://vanillaforums.org/discussion/16067/is-there-a-way-to-make-discussion-marked-as-favorite-after-a-post
But I still consider it a bit hacky, as my solution was this:
SyntaxHighlighter.update()
is a wrapper function I added to SyntaxHighlighter with some jQuery initialization code to go through all page pre tags and get them ready for syntax highlighting.Is there a way in vanilla to add global hooks? I'd rather add the following to all pages, which is clientside so no need to extend multiple PHP files, and will attach itself to any new form elements created on clicks and so forth: Cheers,
Dave
Calling livequery() will most always work and you can ensure the js query is included in the page with:
Thanks!
this
reference to tell you what item was just added so you can just call the highlighter on$(this)
.SyntaxHighlighter.highlight();
does just the one pre.