Index: trunk/extensions/SlimboxThumbs/SlimboxThumbs.php |
— | — | @@ -108,12 +108,13 @@ |
109 | 109 | /* Add javacsripts and stylesheets */ |
110 | 110 | function efSBTAddScripts( $out ) { |
111 | 111 | global $slimboxThumbsFilesDir, $hasGallery; |
112 | | - // we don't want to load jQuery if there's no gallery here |
113 | | - if ( !$hasGallery ) return false; |
| 112 | + |
| 113 | + // We don't want to load jQuery if there's no gallery here. |
| 114 | + //if ( !$hasGallery ) return false; |
114 | 115 | |
115 | 116 | $out->addScript( '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>' . "\n" ); |
116 | 117 | $out->addScript( '<script type="text/javascript" src="' . $slimboxThumbsFilesDir . '/js/slimbox2.js"></script>' . "\n" ); |
117 | | - $out->addStyle( $slimboxThumbsFilesDir . '/css/slimbox2.css', 'screen' ); |
| 118 | + $out->addExtensionStyle( $slimboxThumbsFilesDir . '/css/slimbox2.css', 'screen' ); |
118 | 119 | |
119 | 120 | // use thumb.php to resize pictures if browser window is smaller than the picture itself |
120 | 121 | $out->addInlineScript( '$(document).ready(function(){ |
Index: trunk/extensions/SlimboxThumbs/SlimboxThumbs_Settings.php |
— | — | @@ -17,4 +17,8 @@ |
18 | 18 | $slimboxDefaultWidth = 680; |
19 | 19 | |
20 | 20 | # Path of the Slimbox directory (string). |
21 | | -$slimboxThumbsFilesDir = dirname( __FILE__ ) . '/slimbox'; |
\ No newline at end of file |
| 21 | +$useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
| 22 | +$slimboxThumbsFilesDir = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SlimboxThumbs'; |
| 23 | +unset( $useExtensionPath ); |
| 24 | + |
| 25 | +$slimboxThumbsFilesDir .= '/slimbox'; |
\ No newline at end of file |