*/
protected function outputTimeout() {
$this->getOutput()->addHTML(
- '<div class="mw-changeslist-timeout">' .
+ '<div class="mw-changeslist-empty mw-changeslist-timeout">' .
$this->msg( 'recentchanges-timeout' )->parse() .
'</div>'
);
$outputPage->addHTML(
Html::errorBox( $this->msg( 'allpagesbadtitle' )->parse() )
);
-
return false;
}
}
protected function outputNoResults() {
- if ( $this->getTargetTitle() === false ) {
+ $targetTitle = $this->getTargetTitle();
+ if ( $targetTitle === false ) {
$this->getOutput()->addHTML(
- '<div class="mw-changeslist-notargetpage">' .
+ '<div class="mw-changeslist-empty mw-changeslist-notargetpage">' .
$this->msg( 'recentchanges-notargetpage' )->parse() .
'</div>'
);
+ } elseif ( !$targetTitle || $targetTitle->isExternal() ) {
+ $this->getOutput()->addHTML(
+ '<div class="mw-changeslist-empty mw-changeslist-invalidtargetpage">' .
+ $this->msg( 'allpagesbadtitle' )->parse() .
+ '</div>'
+ );
} else {
parent::outputNoResults();
}
'recentchanges-timeout',
'recentchanges-network',
'recentchanges-notargetpage',
+ 'allpagesbadtitle',
'quotation-marks',
],
'dependencies' => [
info.noResultsDetails = 'NO_RESULTS_TIMEOUT';
} else if ( $root.find( '.mw-changeslist-notargetpage' ).length ) {
info.noResultsDetails = 'NO_RESULTS_NO_TARGET_PAGE';
+ } else if ( $root.find( '.mw-changeslist-invalidtargetpage' ).length ) {
+ info.noResultsDetails = 'NO_RESULTS_INVALID_TARGET_PAGE';
} else {
info.noResultsDetails = 'NO_RESULTS_NORMAL';
}
{
$topSection: $topSection,
$filtersContainer: $( '.rcfilters-container' ),
- $changesListContainer: $( [
- '.mw-changeslist',
- '.mw-changeslist-empty',
- '.mw-changeslist-timeout',
- '.mw-changeslist-notargetpage'
- ].join( ', ' ) ),
+ $changesListContainer: $( '.mw-changeslist, .mw-changeslist-empty' ),
$formContainer: $initialFieldset
}
);
}
}
- // Temporarily hide any specific 'no result' message while we load rcfilters.
- .mw-changeslist-empty,
- .mw-changeslist-timeout,
- .mw-changeslist-notargetpage {
+ // Temporarily hide the empty results section while we load rcfilters.
+ .mw-changeslist-empty {
+ display: none;
+ }
+
+ .errorbox {
display: none;
}
.text( mw.msg( this.getMsgKeyForNoResults( noResultsDetails ) ) )
);
- this.$element.removeClass( 'mw-changeslist-timeout' );
- this.$element.removeClass( 'mw-changeslist-notargetpage' );
+ // remove all classes matching mw-changeslist-*
+ this.$element.removeClass( function ( elementIndex, allClasses ) {
+ return allClasses
+ .split( ' ' )
+ .filter( function ( className ) {
+ return className.indexOf( 'mw-changeslist-' ) === 0;
+ } )
+ .join( ' ' );
+ } );
}
this.$element.append( $message );
NO_RESULTS_NORMAL: 'recentchanges-noresult',
NO_RESULTS_TIMEOUT: 'recentchanges-timeout',
NO_RESULTS_NETWORK_ERROR: 'recentchanges-network',
- NO_RESULTS_NO_TARGET_PAGE: 'recentchanges-notargetpage'
+ NO_RESULTS_NO_TARGET_PAGE: 'recentchanges-notargetpage',
+ NO_RESULTS_INVALID_TARGET_PAGE: 'allpagesbadtitle'
};
return reasonMsgKeyMap[ reason ];
};