Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4126625
index.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
index.js
View Options
const
types
=
require
(
'./types.json'
);
// Load Popups when touch events are not available in the browser (e.g. not a mobile device).
const
isTouchDevice
=
'ontouchstart'
in
document
.
documentElement
;
let
supportNotQueries
;
try
{
supportNotQueries
=
document
.
body
.
matches
(
'div:not(.foo,.bar)'
);
supportNotQueries
=
true
;
}
catch
(
e
)
{
supportNotQueries
=
false
;
}
if
(
!
isTouchDevice
&&
supportNotQueries
)
{
mw
.
loader
.
using
(
types
.
concat
(
[
'ext.popups.main'
]
)
).
then
(
function
()
{
// Load custom popup types
types
.
forEach
(
function
(
moduleName
)
{
const
module
=
require
(
moduleName
);
// Check the module exists. A module can export undefined or null if
// it does not want to be registered (for example where registration may
// depend on something that can only be checked at runtime.
// For example the Math module shouldn't register itself if there are no Math
// equations on the page.
if
(
module
)
{
mw
.
popups
.
register
(
module
);
}
}
);
// For now this API is limited to extensions/skins as we have not had a chance to
// consider the implications of gadgets having access to this function and dealing with
// challenges such as selector overlap.
delete
mw
.
popups
.
register
;
}
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 08:11 (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5e/09/d058bc86444f2439eb4115c201b9
Default Alt Text
index.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment