Skip to content

Commit

Permalink
Add modules to skin.json and hook for search vue
Browse files Browse the repository at this point in the history
Rebased from commit "Update" b82e2a4

Bug: #21
Change-Id: Icac717f530a63e11b0e5ab20892b499abc5d1251
  • Loading branch information
lakejason0 authored and winstonsung committed Apr 29, 2024
1 parent d4a1fe7 commit 98946e1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
16 changes: 16 additions & 0 deletions includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,25 @@

namespace MediaWiki\Skins\Lakeus;

use Config;
# use MediaWiki\Config\Config; // Namespaced in 1.41.0
use MediaWiki\Preferences\Hook\GetPreferencesHook;
# use MediaWiki\ResourceLoader\Context; // Namespaced in 1.39.0
use ResourceLoaderContext;

class Hooks implements GetPreferencesHook {
/**
* @param ResourceLoaderContext $context
* @param Config $config
* @return $wgLakeusWvuiSearchOptions
*/
public function getSnapwikiskinWvuiSearchResourceLoaderConfig(
ResourceLoaderContext $context,
Config $config
) {
return $config->get( 'LakeusWvuiSearchOptions' );
}

/**
* @see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Hooks/GetPreferences
* @param User $user
Expand Down
2 changes: 1 addition & 1 deletion resources/skins.lakeus.search/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<wvui-typeahead-search
id="searchform"
id="p-search"
ref="searchForm"
:client="getClient"
:domain="domain"
Expand Down
20 changes: 20 additions & 0 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,26 @@
"lakeus-theme-designer-text-color-sticky-toc-number",
"lakeus-theme-designer-danger-zone"
]
},
"skins.lakeus.search": {
"dependencies": [
"mediawiki.Uri",
"wvui"
],
"es6": true,
"packageFiles": [
"resources/skins.lakeus.search/skins.lakeus.search.js",
"resources/skins.lakeus.search/App.vue",
{
"name": "resources/skins.lakeus.search/config.json",
"callback": "MediaWiki\\Skins\\Lakeus\\Hooks::getLakeusWvuiSearchResourceLoaderConfig"
}
],
"messages": [
"searchbutton",
"searchresults",
"searchsuggest-containing"
]
}
},
"ResourceModuleSkinStyles": {
Expand Down

0 comments on commit 98946e1

Please sign in to comment.