Calling Javascript after Preview Button has been pressed
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:
In class.form.php I found "public function Button" where the button is defined.
In post.php (controllers) I found:
FetchView uses a "$ViewHandler", that uses "Gdn::Factory".
And here I get stucked.
Could somebody experienced help me please?
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?
0
Comments
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.