Index: trunk/extensions/GeeQuBox/GeeQuBox.php |
— | — | @@ -21,12 +21,25 @@ |
22 | 22 | $wgExtensionCredits['parserhook'][] = array( |
23 | 23 | 'path' => __FILE__, |
24 | 24 | 'name' => 'GeeQuBox', |
25 | | - 'version' => '0.01', |
| 25 | + 'version' => '0.02', |
26 | 26 | 'author' => array( '[http://www.mediawiki.org/wiki/User:Clausekwis David Raison]' ), |
27 | 27 | 'url' => 'http://www.mediawiki.org/wiki/Extension:GeeQuBox', |
28 | 28 | 'descriptionmsg' => 'geequbox-desc' |
29 | 29 | ); |
30 | 30 | |
| 31 | +// see http://www.mediawiki.org/wiki/ResourceLoader/Documentation/Using_with_extensions |
| 32 | +$wgResourceModules['ext.GeeQuBox'] = array( |
| 33 | + // JavaScript and CSS styles. To combine multiple file, just list them as an array. |
| 34 | + 'scripts' => 'js/jquery.lightbox-0.5.min.js', |
| 35 | + 'styles' => 'css/jquery.lightbox-0.5.css', |
| 36 | + |
| 37 | + // ResourceLoader needs to know where your files are; specify your |
| 38 | + // subdir relative to "extensions" or $wgExtensionAssetsPath |
| 39 | + 'localBasePath' => dirname( __FILE__ ), |
| 40 | + 'remoteExtPath' => 'GeeQuBox' |
| 41 | +); |
| 42 | + |
| 43 | + |
31 | 44 | // defaults |
32 | 45 | $wgGqbDefaultWidth = 640; |
33 | 46 | |
— | — | @@ -83,11 +96,9 @@ |
84 | 97 | global $wgExtensionAssetsPath; |
85 | 98 | |
86 | 99 | $eDir = $wgExtensionAssetsPath .'/GeeQuBox/'; |
87 | | - $this->_page->includeJQuery(); |
88 | | - $this->_page->addScript( '<script type="text/javascript" src="'. $eDir .'js/jquery.lightbox-0.5.min.js"></script>' . PHP_EOL ); |
89 | | - $this->_page->addExtensionStyle( $eDir . '/css/jquery.lightbox-0.5.css', 'screen' ); |
| 100 | + $this->_page->addModules( 'ext.GeeQuBox' ); |
90 | 101 | $this->_page->addInlineScript('$j(document).ready(function(){ |
91 | | - $j("div.gallerybox a.image").lightBox({ |
| 102 | + $j("li.gallerybox a.image").lightBox({ |
92 | 103 | imageLoading: "'. $eDir .'images/lightbox-ico-loading.gif", |
93 | 104 | imageBtnClose: "'. $eDir .'images/lightbox-btn-close.gif", |
94 | 105 | imageBtnPrev: "'. $eDir .'images/lightbox-btn-prev.gif", |