Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5947193
autoinfuse.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
autoinfuse.js
View Options
/*
* HTMLForm enhancements:
* Infuse some OOUI HTMLForm fields (those which benefit from always being infused).
*/
mw
.
hook
(
'htmlform.enhance'
).
add
(
(
$root
)
=>
{
let
$oouiNodes
=
$root
.
find
(
'.mw-htmlform-autoinfuse'
);
$oouiNodes
=
$oouiNodes
.
filter
(
function
()
{
return
!
$
(
this
).
closest
(
'.mw-htmlform-autoinfuse-lazy'
).
length
;
}
);
if
(
$oouiNodes
.
length
)
{
// The modules are preloaded (added server-side in HTMLFormField, and the individual fields
// which need extra ones), but this module doesn't depend on them. Wait until they're loaded.
const
modules
=
[
'mediawiki.htmlform.ooui'
];
$oouiNodes
.
each
(
function
()
{
const
data
=
$
(
this
).
data
(
'mw-modules'
);
if
(
data
)
{
// We can trust this value, 'data-mw-*' attributes are banned from user content in Sanitizer
const
extraModules
=
data
.
split
(
','
);
modules
.
push
(
...
extraModules
);
}
}
);
mw
.
loader
.
using
(
modules
).
done
(
()
=>
{
$oouiNodes
.
each
(
function
()
{
OO
.
ui
.
infuse
(
this
);
}
);
}
);
}
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 2 2026, 20:33 (6 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/87/ab43cd4c03cdad04ef52ea8da922
Default Alt Text
autoinfuse.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment