Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4117896
skins.citizen.preferences.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
skins.citizen.preferences.js
View Options
/**
* Clientprefs names theme differently from Citizen, we will need to translate it
* TODO: Migrate to clientprefs fully on MW 1.43
*/
/**
* Load client preferences based on the existence of 'citizen-preferences__card' element.
*/
function
loadClientPreferences
()
{
const
clientPreferenceId
=
'citizen-preferences-content'
;
const
clientPreferenceExists
=
document
.
getElementById
(
clientPreferenceId
)
!==
null
;
if
(
clientPreferenceExists
)
{
const
clientPreferences
=
require
(
/** @type {string} */
(
'./clientPreferences.js'
)
);
const
clientPreferenceConfig
=
(
require
(
'./clientPreferences.json'
)
);
clientPreferences
.
render
(
`#
${
clientPreferenceId
}
`
,
clientPreferenceConfig
);
}
}
/**
* Set up the listen for preferences button
*
* @return {void}
*/
function
listenForButtonClick
()
{
const
details
=
document
.
getElementById
(
'citizen-preferences-details'
);
if
(
!
details
)
{
return
;
}
details
.
addEventListener
(
'click'
,
loadClientPreferences
,
{
once
:
true
}
);
}
listenForButtonClick
();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 02:24 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4d/b7/40a8a79e4f29d6ebf03e4ffa9b93
Default Alt Text
skins.citizen.preferences.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment