Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4120146
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
isReferencePreviewsEnabled
=
require
(
'./isReferencePreviewsEnabled.js'
);
const
{
initReferencePreviewsInstrumentation
,
LOGGING_SCHEMA
}
=
require
(
'./referencePreviewsInstrumentation.js'
);
const
createReferenceGateway
=
require
(
'./createReferenceGateway.js'
);
const
renderFn
=
require
(
'./createReferencePreview.js'
);
const
{
TYPE_REFERENCE
,
FETCH_DELAY_REFERENCE_TYPE
}
=
require
(
'./constants.js'
);
const
referencePreviewsState
=
isReferencePreviewsEnabled
(
mw
.
user
,
mw
.
popups
.
isEnabled
,
mw
.
config
);
const
gateway
=
createReferenceGateway
();
// For tracking baseline stats in the Cite extension https://phabricator.wikimedia.org/T353798
// FIXME: This might be obsolete when the code moves to the Cite extension and the tracking there
// can check that state differently.
mw
.
config
.
set
(
'wgCiteReferencePreviewsVisible'
,
!!
referencePreviewsState
);
mw
.
trackSubscribe
(
'Popups.SettingChange'
,
(
data
)
=>
{
if
(
data
.
previewType
===
TYPE_REFERENCE
)
{
mw
.
track
(
LOGGING_SCHEMA
,
data
);
}
}
);
module
.
exports
=
referencePreviewsState
!==
null
?
{
type
:
TYPE_REFERENCE
,
selector
:
'#mw-content-text .reference a[ href*="#" ]'
,
delay
:
FETCH_DELAY_REFERENCE_TYPE
,
gateway
,
renderFn
,
init
:
()
=>
{
initReferencePreviewsInstrumentation
();
}
}
:
null
;
// Expose private methods for QUnit tests
if
(
typeof
QUnit
!==
'undefined'
)
{
module
.
exports
=
{
private
:
{
createReferenceGateway
:
require
(
'./createReferenceGateway.js'
),
createReferencePreview
:
require
(
'./createReferencePreview.js'
),
isReferencePreviewsEnabled
:
require
(
'./isReferencePreviewsEnabled.js'
)
}
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 03:52 (6 d, 10 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
99/25/d8b282b3bbabd2cecf14336cef27
Default Alt Text
index.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment