Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | <?php } |
91 | 91 | if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?> |
92 | 92 | <!-- Head Scripts --> |
93 | | - <?php $this->html('headscripts') ?> |
| 93 | +<?php $this->html('headscripts') ?> |
94 | 94 | </head> |
95 | 95 | <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?> |
96 | 96 | <?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?> |
Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -554,5 +554,9 @@ |
555 | 555 | Can be used to set custom CSS/JS |
556 | 556 | $out: OutputPage object |
557 | 557 | |
| 558 | +'AjaxAddScript': Called in output page just before the initialisation |
| 559 | +of the javascript ajax engine. The hook is only called when ajax |
| 560 | +is enabled ( $wgUseAjax = true; ). |
| 561 | + |
558 | 562 | More hooks might be available but undocumented, you can execute |
559 | 563 | ./maintenance/findhooks.php to find hidden one. |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | # To add an http-equiv meta tag, precede the name with "http:" |
71 | 71 | function addMeta( $name, $val ) { array_push( $this->mMetatags, array( $name, $val ) ); } |
72 | 72 | function addKeyword( $text ) { array_push( $this->mKeywords, $text ); } |
73 | | - function addScript( $script ) { $this->mScripts .= $script; } |
| 73 | + function addScript( $script ) { $this->mScripts .= "\t\t".$script; } |
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Add a self-contained script tag with the given contents |
— | — | @@ -549,6 +549,9 @@ |
550 | 550 | |
551 | 551 | if ( $wgUseAjax ) { |
552 | 552 | $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js?$wgStyleVersion\"></script>\n" ); |
| 553 | + |
| 554 | + wfRunHooks( 'AjaxAddScript', array( &$this ) ); |
| 555 | + |
553 | 556 | if( $wgAjaxSearch ) { |
554 | 557 | $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxsearch.js\"></script>\n" ); |
555 | 558 | $this->addScript( "<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", sajax_onload);</script>\n" ); |