forked from GNUsocial/gnu-social
Add 2 new events: StartInlineScriptElement and EndInlineScriptElement
This commit is contained in:
parent
847013db69
commit
7ddf911f5d
10
EVENTS.txt
10
EVENTS.txt
@ -595,3 +595,13 @@ EndScriptElement: After a <script...> element is written
|
||||
- $action
|
||||
- $src
|
||||
- $type
|
||||
|
||||
StartInlineScriptElement: Before a <script...> element is written
|
||||
- $action
|
||||
- &$code
|
||||
- &$type
|
||||
|
||||
EndInlineScriptElement: After a <script...> element is written
|
||||
- $action
|
||||
- $code
|
||||
- $type
|
||||
|
@ -375,15 +375,18 @@ class HTMLOutputter extends XMLOutputter
|
||||
|
||||
function inlineScript($code, $type='text/javascript')
|
||||
{
|
||||
$this->elementStart('script', array('type' => $type));
|
||||
if($type == 'text/javascript') {
|
||||
$this->raw('/*<![CDATA[*/ '); // XHTML compat
|
||||
if(Event::handle('StartInlineScriptElement', array($this,&$code,&$type))) {
|
||||
$this->elementStart('script', array('type' => $type));
|
||||
if($type == 'text/javascript') {
|
||||
$this->raw('/*<![CDATA[*/ '); // XHTML compat
|
||||
}
|
||||
$this->raw($code);
|
||||
if($type == 'text/javascript') {
|
||||
$this->raw(' /*]]>*/'); // XHTML compat
|
||||
}
|
||||
$this->elementEnd('script');
|
||||
Event::handle('EndInlineScriptElement', array($this,$code,$type));
|
||||
}
|
||||
$this->raw($code);
|
||||
if($type == 'text/javascript') {
|
||||
$this->raw(' /*]]>*/'); // XHTML compat
|
||||
}
|
||||
$this->elementEnd('script');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user