mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
DesktopArticleTarget: Generate the original page title if needed
When switching from the old wikitext editor to VE, we stored "editing..." as the original page title. Then restored that when saving / switching to "read". Instead, detect if we're on top of the classic editor, and use the pagename message to make a plausibly-correct title. Bug: T126077 Change-Id: Ib0289de71c3ae947ca0a3e45fe1e620378689c35
This commit is contained in:
parent
16c5d489fc
commit
b1aed096cb
|
@ -384,6 +384,7 @@
|
|||
"mediawiki.util"
|
||||
],
|
||||
"messages": [
|
||||
"pagetitle",
|
||||
"creating",
|
||||
"editing",
|
||||
"lastmodifiedat",
|
||||
|
|
|
@ -64,7 +64,16 @@ ve.init.mw.DesktopArticleTarget = function VeInitMwDesktopArticleTarget( config
|
|||
mw.config.get( 'wgAction' ) === 'view' &&
|
||||
currentUri.query.diff === undefined
|
||||
);
|
||||
this.originalDocumentTitle = document.title;
|
||||
|
||||
if ( $( '#wpTextbox1' ).length ) {
|
||||
// We're loading on top of the classic wikitext editor, so we don't
|
||||
// know the "proper" page title. But we can fake it with information
|
||||
// we have.
|
||||
this.originalDocumentTitle = ve.msg( 'pagetitle', mw.Title.newFromText( mw.config.get( 'wgPageName' ) ).getPrefixedText() );
|
||||
} else {
|
||||
this.originalDocumentTitle = document.title;
|
||||
}
|
||||
|
||||
this.tabLayout = mw.config.get( 'wgVisualEditorConfig' ).tabLayout;
|
||||
this.events = new ve.init.mw.ArticleTargetEvents( this );
|
||||
this.$originalContent = $( '<div>' ).addClass( 've-init-mw-desktopArticleTarget-originalContent' );
|
||||
|
|
Loading…
Reference in a new issue