mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-15 03:23:51 +00:00
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:
parent
d0cbc88d98
commit
ab8947fca2
|
@ -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 ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue