}
}
+ // If we are looking at a css/js user subpage, purge the action=raw.
+ if ( $this->isJsSubpage() ) {
+ $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/javascript' );
+ } elseif ( $this->isCssSubpage() ) {
+ $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/css' );
+ }
+
wfRunHooks( 'TitleSquidURLs', array( $this, &$urls ) );
return $urls;
}
if ( $moveOverRedirect ) {
$newid = $nt->getArticleID();
+ $newcontent = $newpage->getContent();
# Delete the old redirect. We don't save it to history since
# by definition if we've got here it's rather uninteresting.
# a conflict on the unique namespace+title index...
$dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
- $newpage->doDeleteUpdates( $newid );
+ $newpage->doDeleteUpdates( $newid, $newcontent );
}
# Save a null revision in the page's history notifying of the move
}
}
-win.redirectToFragment = function ( fragment ) {
+/**
+ * Legacy function to scroll to an id while viewing the page over a redirect.
+ * Superseeded by module 'mediawiki.action.view.redirectToFragment' in version 1.23.
+ * Kepted because cache can contain still inline script calls to this function.
+ * Should be removed in version 1.24.
+ * @deprecated since 1.23 Use mediawiki.action.view.redirectToFragment instead
+ */
+mw.log.deprecate( win, 'redirectToFragment', function ( fragment ) {
var webKitVersion,
match = navigator.userAgent.match( /AppleWebKit\/(\d+)/ );
if ( match ) {
} );
}
}
-};
+}, 'Use the module mediawiki.action.view.redirectToFragment instead.' );
/**
* User-agent sniffing.
return s;
};
- win.importStylesheet = function( page ) {
- return win.importStylesheetURI( mw.config.get( 'wgScript' ) + '?action=raw&ctype=text/css&title=' + mw.util.wikiUrlencode( page ) );
+ win.importStylesheet = function ( page ) {
+ var uri = mw.config.get( 'wgScript' ) + '?title=' +
+ mw.util.wikiUrlencode( page ) +
+ '&action=raw&ctype=text/css';
+ return win.importStylesheetURI( uri );
};
win.importStylesheetURI = function( url, media ) {