Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6038598
skins.vector.search.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
skins.vector.search.js
View Options
/** @module search */
const
Vue
=
require
(
'vue'
),
App
=
require
(
'./App.vue'
),
config
=
require
(
'./config.json'
);
/**
* @param {Element} searchBox
* @return {void}
*/
function
initApp
(
searchBox
)
{
const
searchForm
=
searchBox
.
querySelector
(
'.cdx-search-input'
),
titleInput
=
/** @type {HTMLInputElement|null} */
(
searchBox
.
querySelector
(
'input[name=title]'
)
),
search
=
/** @type {HTMLInputElement|null} */
(
searchBox
.
querySelector
(
'input[name=search]'
)
),
searchPageTitle
=
titleInput
&&
titleInput
.
value
,
searchContainer
=
searchBox
.
querySelector
(
'.vector-typeahead-search-container'
);
if
(
!
searchForm
||
!
search
||
!
titleInput
)
{
throw
new
Error
(
'Attempted to create Vue search element from an incompatible element.'
);
}
// @ts-ignore MediaWiki-specific function
Vue
.
createMwApp
(
App
,
Object
.
assign
(
{
id
:
searchForm
.
id
,
autocapitalizeValue
:
search
.
getAttribute
(
'autocapitalize'
),
autofocusInput
:
search
===
document
.
activeElement
,
action
:
searchForm
.
getAttribute
(
'action'
),
searchAccessKey
:
search
.
getAttribute
(
'accessKey'
),
searchPageTitle
:
searchPageTitle
,
searchTitle
:
search
.
getAttribute
(
'title'
),
searchPlaceholder
:
search
.
getAttribute
(
'placeholder'
),
searchQuery
:
search
.
value
,
autoExpandWidth
:
searchBox
?
searchBox
.
classList
.
contains
(
'vector-search-box-auto-expand-width'
)
:
false
// Pass additional config from server.
},
config
)
)
.
mount
(
searchContainer
);
}
/**
* @param {Document} document
* @return {void}
*/
function
main
(
document
)
{
document
.
querySelectorAll
(
'.vector-search-box'
)
.
forEach
(
initApp
);
}
main
(
document
);
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Oct 4 2026, 20:02 (5 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
40/8b/5a949e904d54593d9b63f31a61cc
Default Alt Text
skins.vector.search.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment