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,6 +375,7 @@ class HTMLOutputter extends XMLOutputter
|
||||
|
||||
function inlineScript($code, $type='text/javascript')
|
||||
{
|
||||
if(Event::handle('StartInlineScriptElement', array($this,&$code,&$type))) {
|
||||
$this->elementStart('script', array('type' => $type));
|
||||
if($type == 'text/javascript') {
|
||||
$this->raw('/*<![CDATA[*/ '); // XHTML compat
|
||||
@ -384,6 +385,8 @@ class HTMLOutputter extends XMLOutputter
|
||||
$this->raw(' /*]]>*/'); // XHTML compat
|
||||
}
|
||||
$this->elementEnd('script');
|
||||
Event::handle('EndInlineScriptElement', array($this,$code,$type));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user