Index: trunk/extensions/Cite/modules/ext.cite/ext.cite.js |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +( function($) { |
| 3 | + $( function() { |
| 4 | + $j('.biblio-cite-link,sup.reference a').tooltip({ |
| 5 | + bodyHandler: function() { |
| 6 | + return $j( document.getElementById( this.hash.substr(1) ) ) |
| 7 | + .html(); |
| 8 | + }, |
| 9 | + showURL : false |
| 10 | + } ); |
| 11 | + } ); |
| 12 | + |
| 13 | +} )(jQuery); |
Property changes on: trunk/extensions/Cite/modules/ext.cite/ext.cite.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 14 | + native |
Index: trunk/extensions/Cite/Cite.php |
— | — | @@ -18,7 +18,9 @@ |
19 | 19 | */ |
20 | 20 | |
21 | 21 | $wgHooks['ParserFirstCallInit'][] = 'wfCite'; |
| 22 | +$wgHooks['BeforePageDisplay'][] = 'wfCiteBeforePageDisplay'; |
22 | 23 | |
| 24 | + |
23 | 25 | $wgExtensionCredits['parserhook'][] = array( |
24 | 26 | 'path' => __FILE__, |
25 | 27 | 'name' => 'Cite', |
— | — | @@ -57,4 +59,34 @@ |
58 | 60 | return Cite::setHooks( $parser ); |
59 | 61 | } |
60 | 62 | |
| 63 | +// Resources |
| 64 | +$citeResourceTemplate = array( |
| 65 | + 'localBasePath' => dirname(__FILE__) . '/modules', |
| 66 | + 'remoteExtPath' => 'Cite/modules' |
| 67 | +); |
| 68 | + |
| 69 | +$wgResourceModules['ext.cite'] = $citeResourceTemplate + array( |
| 70 | + 'styles' => array(), |
| 71 | + 'scripts' => 'ext.cite/ext.cite.js', |
| 72 | + 'position' => 'bottom', |
| 73 | + 'dependencies' => array( |
| 74 | + 'jquery.tooltip', |
| 75 | + ), |
| 76 | +); |
| 77 | + |
| 78 | +$wgResourceModules['jquery.tooltip'] = $citeResourceTemplate + array( |
| 79 | + 'styles' => 'jquery.tooltip/jquery.tooltip.css', |
| 80 | + 'scripts' => 'jquery.tooltip/jquery.tooltip.js', |
| 81 | + 'position' => 'bottom', |
| 82 | +); |
| 83 | + |
| 84 | +function wfCiteBeforePageDisplay() { |
| 85 | + global $wgOut; |
| 86 | + |
| 87 | + $wgOut->addModules( 'ext.cite' ); |
| 88 | + |
| 89 | + return true; |
| 90 | +} |
| 91 | + |
| 92 | + |
61 | 93 | /**#@-*/ |