mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
feat(search): ✨ add suggestion to edit page
This commit is contained in:
parent
969f4f0d3d
commit
3d31d08021
|
@ -30,6 +30,7 @@
|
|||
"citizen-search-fulltext-empty": "Search for text within pages",
|
||||
|
||||
"citizen-search-mediasearch-empty": "Search for media",
|
||||
"citizen-search-editpage": "Edit or create page",
|
||||
"citizen-search-empty-desc": "Type to start searching",
|
||||
"citizen-search-noresults-title": "Uh oh! No results for $1",
|
||||
"citizen-search-noresults-desc": "Maybe try the options above?",
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
"citizen-search-fulltext-empty": "Helper text for Fulltext search",
|
||||
|
||||
"citizen-search-mediasearch-empty": "Helper text for MediaSearch",
|
||||
"citizen-search-editpage": "Helper text for edit and create page suggestion",
|
||||
"citizen-search-empty-desc": "Helper text in the search suggestion when there are no search query",
|
||||
"citizen-search-noresults-title": "Title in the search suggestion when there are no search results",
|
||||
"citizen-search-noresults-desc": "Description in the search suggestion when there are no search results",
|
||||
|
|
|
@ -455,16 +455,25 @@ function updateTypeaheadItems() {
|
|||
// Fulltext search
|
||||
itemGroupData.items.push( {
|
||||
// id: 'fulltext',
|
||||
link: `${config.wgScriptPath}/index.php?title=Special:Search&fulltext=1&search=`,
|
||||
link: `${config.wgScriptPath}/index.php?title=Special:Search&fulltext=1&search=${searchQuery.valueHtml}`,
|
||||
icon: 'articleSearch',
|
||||
msg: 'citizen-search-fulltext-empty'
|
||||
} );
|
||||
|
||||
// Edit/create page
|
||||
// TODO: Check if user has right, and whether the page exists
|
||||
itemGroupData.items.push( {
|
||||
// id: 'editpage',
|
||||
link: `${config.wgScriptPath}/index.php?title=${searchQuery.valueHtml}&action=edit`,
|
||||
icon: 'edit',
|
||||
msg: 'citizen-search-editpage'
|
||||
} );
|
||||
|
||||
// MediaSearch
|
||||
if ( config.isMediaSearchExtensionEnabled ) {
|
||||
itemGroupData.items.push( {
|
||||
// id: 'mediasearch',
|
||||
link: `${config.wgScriptPath}/index.php?title=Special:MediaSearch&type=image&search=`,
|
||||
link: `${config.wgScriptPath}/index.php?title=Special:MediaSearch&type=image&search=${searchQuery.valueHtml}`,
|
||||
icon: 'imageGallery',
|
||||
msg: 'citizen-search-mediasearch-empty'
|
||||
} );
|
||||
|
@ -482,7 +491,7 @@ function updateTypeaheadItems() {
|
|||
itemGroupData.items.forEach( ( item, index ) => {
|
||||
const toolEl = document.getElementById( `citizen-typeahead-tool-${index}` );
|
||||
htmlHelper.updateItemElement( toolEl, {
|
||||
link: `${item.link}${searchQuery.valueHtml}`,
|
||||
link: item.link,
|
||||
title: searchQuery.value,
|
||||
/* eslint-disable-next-line mediawiki/msg-doc */
|
||||
label: mw.message( item.msg )
|
||||
|
|
Loading…
Reference in a new issue