Index: trunk/extensions/CleanChanges/CleanChanges.php |
— | — | @@ -50,3 +50,14 @@ |
51 | 51 | $wgHooks['SpecialRecentChangesPanel'][] = 'CCFilters::trailerForm'; |
52 | 52 | } |
53 | 53 | } |
| 54 | + |
| 55 | +$resourcePaths = array( |
| 56 | + 'localBasePath' => dirname( __FILE__ ), |
| 57 | + 'remoteExtPath' => 'CleanChanges' |
| 58 | +); |
| 59 | + |
| 60 | +// Client-side resource modules |
| 61 | +$wgResourceModules['ext.cleanchanges'] = array( |
| 62 | + 'scripts' => 'cleanchanges.js', |
| 63 | +) + $resourcePaths; |
| 64 | + |
Index: trunk/extensions/CleanChanges/cleanchanges.js |
— | — | @@ -1,25 +1,21 @@ |
2 | | -/* |
3 | | - * Adapted from monobook, with possibility to set display to block or inline. |
4 | | - */ |
5 | | -function toggleVisibilityE(_levelId, _otherId, _linkId, _type) { |
6 | | - var thisLevel = document.getElementById(_levelId); |
7 | | - var otherLevel = document.getElementById(_otherId); |
8 | | - var linkLevel = document.getElementById(_linkId); |
9 | | - if (thisLevel.style.display == 'none') { |
10 | | - thisLevel.style.display = _type; |
11 | | - otherLevel.style.display = 'none'; |
12 | | - linkLevel.style.display = 'inline'; |
13 | | - } else { |
14 | | - thisLevel.style.display = 'none'; |
15 | | - otherLevel.style.display = 'inline'; |
16 | | - linkLevel.style.display = 'none'; |
| 2 | +(function ( $ ) { |
| 3 | + window.toggleVisibilityE = function ( _levelId, _otherId, _linkId, _type ) { |
| 4 | + var thisLevel = document.getElementById( _levelId ); |
| 5 | + var otherLevel = document.getElementById( _otherId ); |
| 6 | + var linkLevel = document.getElementById( _linkId ); |
| 7 | + if (thisLevel.style.display == 'none') { |
| 8 | + thisLevel.style.display = _type; |
| 9 | + otherLevel.style.display = 'none'; |
| 10 | + linkLevel.style.display = 'inline'; |
| 11 | + } else { |
| 12 | + thisLevel.style.display = 'none'; |
| 13 | + otherLevel.style.display = 'inline'; |
| 14 | + linkLevel.style.display = 'none'; |
| 15 | + } |
17 | 16 | } |
18 | | -} |
| 17 | + |
| 18 | + window.showUserInfo = function ( sourceVar, targetId ) { |
| 19 | + $( '#' + targetId ).html( mw.config.get( sourceVar ) ); |
| 20 | + } |
19 | 21 | |
20 | | -/* |
21 | | - * Simple function to add user information inline. |
22 | | - */ |
23 | | -function showUserInfo( sourceVar, targetId ) { |
24 | | - var targetElement = document.getElementById(targetId); |
25 | | - targetElement.innerHTML = eval( sourceVar ); |
26 | | -} |
| 22 | +} )( jQuery ); |
\ No newline at end of file |
Index: trunk/extensions/CleanChanges/CleanChanges_body.php |
— | — | @@ -28,8 +28,8 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | if ( $list instanceof NCL ) { |
32 | | - global $wgOut, $wgExtensionAssetsPath; |
33 | | - $wgOut->addScriptFile( "$wgExtensionAssetsPath/CleanChanges/cleanchanges.js" ); |
| 32 | + global $wgOut; |
| 33 | + $wgOut->addModules( 'ext.cleanchanges' ); |
34 | 34 | } |
35 | 35 | |
36 | 36 | /* If some list was specified, stop processing */ |