Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4120192
init.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
init.js
View Options
const
Vue
=
require
(
'vue'
),
{
createPinia
}
=
require
(
'pinia'
),
App
=
require
(
'./components/App.vue'
),
config
=
require
(
'./config.json'
);
/**
* Initialize the command palette
*
* @return {void}
*/
function
initApp
()
{
const
teleportTarget
=
require
(
'mediawiki.page.ready'
).
teleportTarget
;
// We can't mount directly to the teleportTarget or it will break OOUI overlays
const
overlay
=
document
.
createElement
(
'div'
);
overlay
.
classList
.
add
(
'citizen-command-palette-overlay'
);
teleportTarget
.
appendChild
(
overlay
);
const
app
=
Vue
.
createMwApp
(
App
,
{},
config
);
const
pinia
=
createPinia
();
app
.
use
(
pinia
);
const
commandPalette
=
app
.
mount
(
overlay
);
registerButton
(
commandPalette
);
}
/**
* Setup the button to open the command palette
* This is very hacky, but it works for now.
*
* @param {Vue} commandPalette
* @return {void}
*/
function
registerButton
(
commandPalette
)
{
const
details
=
document
.
getElementById
(
'citizen-search-details'
);
// Remove the search card from the DOM so it won't be triggered by the button
document
.
getElementById
(
'citizen-search__card'
)
?
.
remove
();
details
.
open
=
false
;
details
.
addEventListener
(
'click'
,
()
=>
{
commandPalette
.
open
();
}
);
}
initApp
();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 03:53 (6 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
72/07/854239d8a1d1e76d9c8b0f17924c
Default Alt Text
init.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment