After [33821], when dynamically updating the document title text of the Comments List Table page, operate only on the fragment that contains the comment count. This prevents us from including other numbers that may be present in the other title parts (site title, etc).

See #33414.

Built from https://develop.svn.wordpress.org/trunk@33982


git-svn-id: http://core.svn.wordpress.org/trunk@33951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-10 01:03:25 +00:00
parent 0f3f7160e4
commit bbbbf11961
3 changed files with 13 additions and 5 deletions

View File

@ -138,15 +138,23 @@ setCommentsList = function() {
}; };
updateHtmlTitle = function ( diff ) { updateHtmlTitle = function ( diff ) {
var newTitle, regExMatch, titleCount; var newTitle, regExMatch, titleCount, commentFrag;
titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' ); titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' );
// count funcs operate on a $'d element // count funcs operate on a $'d element
titleDiv = titleDiv || $( '<div />' ); titleDiv = titleDiv || $( '<div />' );
newTitle = adminTitle; newTitle = adminTitle;
titleDiv.html( document.title ); commentFrag = titleRegEx.exec( document.title );
if ( commentFrag ) {
commentFrag = commentFrag[0];
titleDiv.html( commentFrag );
titleCount = getCount( titleDiv ) + diff; titleCount = getCount( titleDiv ) + diff;
} else {
titleDiv.html( 0 );
titleCount = diff;
}
if ( titleCount >= 1 ) { if ( titleCount >= 1 ) {
updateCount( titleDiv, titleCount ); updateCount( titleDiv, titleCount );
regExMatch = titleRegEx.exec( document.title ); regExMatch = titleRegEx.exec( document.title );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-33981'; $wp_version = '4.4-alpha-33982';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.