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.

Calling Javascript after Preview Button has been pressed

edited September 2009 in Vanilla 2.0 - 2.8
I'm using jsMath installed on my server to parse latex syntax (marked as $x^2$) in vanilla2beta environment. To render latex syntax in the preview window, I need to call the jsMath-javascript again.

The Problem: I cannot find the appropriate php-file / line where to inject the javascript code.


* What I discovered so far:

The Preview button is initiated by:
echo $this->Form->Button('Preview');

In class.form.php I found "public function Button" where the button is defined.

In post.php (controllers) I found:
if ($this->_DeliveryType == DELIVERY_TYPE_ALL) { $this->AddAsset('Content', $this->FetchView('preview')); } else { $this->View = 'preview'; }

FetchView uses a "$ViewHandler", that uses "Gdn::Factory".
And here I get stucked.

Could somebody experienced help me please?

Comments

  • MarkMark Vanilla Staff
    is jsmath a jquery class or function? I'm unfamiliar with it.

    The preview window appears in the screen, so any javascript already in the page should be accessible from within the preview html. If it was jquery, it sounds like a time when you'd use jquery's "live" method to make sure that the js gets applied to elements if they are added to the page after the page finishes loading.
Sign In or Register to comment.