MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 730: Line 730:
});
});


// Check if div with class "mw-search-results-info" exists
    if ($('.mw-search-results-info').length) {
        // Select the child <p> element and check its content
        var $paragraph = $('.mw-search-results-info > p');
        var currentText = $paragraph.text().trim();
       
        // Check if the current text is not "There were no results matching the query."
        if (currentText !== "There were no results matching the query.") {
            // Overwrite the content with "Search results"
            $paragraph.text('Search results');
        }
    }
      
      
     // Object to store encountered titles
     // Object to store encountered titles

Navigation menu