mw.ViewPageTarget.init: Fix pageExists/isViewPage behaviour

"Let me clarify this for you" - Timo

Follows-up 1984c3ca46.

Bug: 49000
Change-Id: Ia094aa9aae1da1ba11dbaef827e305cbcf08f9b4
This commit is contained in:
Ed Sanders 2013-08-01 23:50:33 +01:00 committed by Krinkle
parent 1984c3ca46
commit 87bfe3ee09

View file

@ -53,13 +53,12 @@
conf = mw.config.get( 'wgVisualEditorConfig' );
uri = new mw.Uri();
// For non-article pages, no information about page existence is exposed to
// For special pages, no information about page existence is exposed to
// mw.config, so we assume it exists TODO: fix this in core.
pageExists = !!mw.config.get( 'wgArticleId' ) || !mw.config.get( 'wgIsArticle' );
pageExists = !!mw.config.get( 'wgArticleId' ) || mw.config.get( 'wgNamespaceNumber' ) < 0;
viewUri = new mw.Uri( mw.util.wikiGetlink( mw.config.get( 'wgRelevantPageName' ) ) );
veEditUri = viewUri.clone().extend( { 'veaction': 'edit' } );
isViewPage = (
mw.config.get( 'wgAction' ) === 'view' &&
mw.config.get( 'wgIsArticle' ) &&
!( 'diff' in uri.query )
);