Add revision ids of js/css pages to URLs to have them auto-reloaded by users' browsers when they are changed on the wiki

This commit is contained in:
Liangent 2010-06-09 10:15:57 +00:00
parent d0cbc88d98
commit ab8947fca2

View file

@ -202,12 +202,12 @@ function wfApplyGadgetCode( $code, $out, &$done ) {
if ( !$t ) continue;
if ( preg_match( '/\.js/', $codePage ) ) {
$u = $t->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType );
$u = $t->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType . '&' . $t->getLatestRevID() );
//switched to addScriptFile call to support scriptLoader
$out->addScriptFile( $u );
}
else if ( preg_match( '/\.css/', $codePage ) ) {
$u = $t->getLocalURL( 'action=raw&ctype=text/css' );
$u = $t->getLocalURL( 'action=raw&ctype=text/css&' . $t->getLatestRevID() );
$out->addScript( Html::linkedStyle( $u ) );
}
}