Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6014901
editfont.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
editfont.js
View Options
/*!
* JavaScript for Special:Preferences: editfont field enhancements.
*/
mw
.
hook
(
'htmlform.enhance'
).
add
(
(
$root
)
=>
{
const
$target
=
$root
.
find
(
'#mw-input-wpeditfont'
);
if
(
// This preference could theoretically be disabled ($wgHiddenPrefs)
!
$target
.
length
||
$target
.
closest
(
'.mw-htmlform-autoinfuse-lazy'
).
length
)
{
return
;
}
const
widget
=
OO
.
ui
.
infuse
(
$target
);
// Style options
widget
.
dropdownWidget
.
menu
.
items
.
forEach
(
(
item
)
=>
{
// The following classes are used here:
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
item
.
$label
.
addClass
(
'mw-editfont-'
+
item
.
getData
()
);
}
);
let
lastValue
;
function
updateLabel
(
value
)
{
// Style selected item label
// The following classes are used here:
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
widget
.
dropdownWidget
.
$label
.
removeClass
(
'mw-editfont-'
+
lastValue
)
.
addClass
(
'mw-editfont-'
+
value
);
lastValue
=
value
;
}
widget
.
on
(
'change'
,
updateLabel
);
updateLabel
(
widget
.
getValue
()
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 4 2026, 10:59 (5 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0d/26/b4b147d85a4ecba5f9778b40a2e9
Default Alt Text
editfont.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment