Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4116842
pageIssueFormatter.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
pageIssueFormatter.js
View Options
(
function
()
{
const
newPageIssueLink
=
require
(
'./PageIssueLink.js'
);
const
newPageIssueLearnMoreLink
=
require
(
'./PageIssueLearnMoreLink.js'
);
/**
* Modifies the `issue` DOM to create a banner designed for single / multiple issue templates,
* and handles event-binding for that issues overlay.
*
* @param {IssueSummary} issue
* @param {string} msg
* @param {string} overlayUrl
* @param {Object} overlayManager
* @param {boolean} [multiple]
*/
function
insertPageIssueBanner
(
issue
,
msg
,
overlayUrl
,
overlayManager
,
multiple
)
{
const
$learnMoreEl
=
newPageIssueLearnMoreLink
(
msg
);
const
$issueContainer
=
multiple
?
issue
.
$el
.
parents
(
'.mbox-text-span, .mbox-text-div'
)
:
issue
.
$el
.
find
(
'.mbox-text'
);
const
$clickContainer
=
multiple
?
issue
.
$el
.
parents
(
'.mbox-text'
)
:
issue
.
$el
;
$issueContainer
.
prepend
(
issue
.
issue
.
iconElement
);
$issueContainer
.
prepend
(
$learnMoreEl
);
$clickContainer
.
on
(
'click'
,
()
=>
{
overlayManager
.
router
.
navigate
(
overlayUrl
);
return
false
;
}
);
}
/**
* Modifies the page DOM to insert a page-issue notice below the title of the page,
* containing a link with a message like "this page has issues".
* Used on category namespaces, or when page-issue banners have been disabled.
*
* @param {string} labelText
* @param {string} section
*/
function
insertPageIssueNotice
(
labelText
,
section
)
{
const
$link
=
newPageIssueLink
(
labelText
);
$link
.
attr
(
'href'
,
'#/issues/'
+
section
);
// eslint-disable-next-line no-jquery/no-global-selector
$link
.
insertAfter
(
$
(
'h1.mw-first-heading'
)
);
}
module
.
exports
=
{
insertPageIssueBanner
,
insertPageIssueNotice
};
}()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 01:52 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7f/1e/ffad27a71397e87ad210704b1e41
Default Alt Text
pageIssueFormatter.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment