Index: trunk/extensions/Drafts/Drafts.php |
— | — | @@ -38,6 +38,9 @@ |
39 | 39 | // Shortcut to this extension directory |
40 | 40 | $dir = dirname( __FILE__ ) . '/'; |
41 | 41 | |
| 42 | +# Bump the version number every time you change any of the .css/.js files |
| 43 | +$wgDraftsStyleVersion = 1; |
| 44 | + |
42 | 45 | // Seconds of inactivity after change before autosaving |
43 | 46 | // Use the value 0 to disable autosave |
44 | 47 | $egDraftsAutoSaveWait = 120; |
Index: trunk/extensions/Drafts/Drafts.hooks.php |
— | — | @@ -230,12 +230,13 @@ |
231 | 231 | * Add ajax support script |
232 | 232 | */ |
233 | 233 | public static function addJS( $out ) { |
234 | | - global $wgScriptPath; |
235 | | - |
| 234 | + global $wgScriptPath, $wgJsMimeType, $wgDraftsStyleVersion; |
| 235 | + |
236 | 236 | // FIXME: assumes standard dir structure |
237 | 237 | // Add javascript to support ajax draft saving |
238 | | - $out->addScriptFile( $wgScriptPath . '/extensions/Drafts/Drafts.js' ); |
239 | | - |
| 238 | + $out->addInlineScript( "var wgDraftsStyleVersion = \"$wgDraftsStyleVersion\";\n" ); |
| 239 | + $out->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Drafts/Drafts.js?$wgDraftsStyleVersion\"></script>\n" ); |
| 240 | + |
240 | 241 | // Continue |
241 | 242 | return true; |
242 | 243 | } |
— | — | @@ -245,18 +246,18 @@ |
246 | 247 | * Add ajax support script |
247 | 248 | */ |
248 | 249 | public static function addCSS( $out ) { |
249 | | - global $wgScriptPath; |
250 | | - |
| 250 | + global $wgScriptPath, $wgDraftsStyleVersion; |
| 251 | + |
251 | 252 | // FIXME: assumes standard dir structure |
252 | 253 | // Add css for various styles |
253 | 254 | $out->addLink( |
254 | 255 | array( |
255 | 256 | 'rel' => 'stylesheet', |
256 | 257 | 'type' => 'text/css', |
257 | | - 'href' => $wgScriptPath . '/extensions/Drafts/Drafts.css', |
| 258 | + 'href' => "$wgScriptPath/extensions/Drafts/Drafts.css?$wgDraftsStyleVersion", |
258 | 259 | ) |
259 | 260 | ); |
260 | | - |
| 261 | + |
261 | 262 | // Continue |
262 | 263 | return true; |
263 | 264 | } |