Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4121287
pageIssuesOverlay.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
pageIssuesOverlay.js
View Options
const
Overlay
=
require
(
'mobile.startup'
).
Overlay
;
const
IssueList
=
require
(
'./IssueList.js'
);
const
KEYWORD_ALL_SECTIONS
=
'all'
;
const
namespaceIds
=
mw
.
config
.
get
(
'wgNamespaceIds'
);
const
NS_MAIN
=
namespaceIds
[
''
];
const
NS_CATEGORY
=
namespaceIds
.
category
;
/**
* Overlay for displaying page issues
*
* @ignore
* @param {IssueSummary[]} issues List of page issue
* summaries for display.
* @param {string} section
* @param {number} namespaceID
* @return {Overlay}
*/
function
pageIssuesOverlay
(
issues
,
section
,
namespaceID
)
{
// Note only the main namespace is expected to make use of section issues, so the
// heading will always be minerva-meta-data-issues-section-header regardless of
// namespace.
const
headingText
=
section
===
'0'
||
section
===
KEYWORD_ALL_SECTIONS
?
getNamespaceHeadingText
(
namespaceID
)
:
mw
.
msg
(
'minerva-meta-data-issues-section-header'
);
const
overlay
=
new
Overlay
(
{
className
:
'overlay overlay-issues'
,
heading
:
'<strong>'
+
headingText
+
'</strong>'
}
);
overlay
.
$el
.
find
(
'.overlay-content'
).
append
(
new
IssueList
(
issues
).
$el
);
return
overlay
;
}
/**
* Obtain a suitable heading for the issues overlay based on the namespace
*
* @private
* @param {number} namespaceID is the namespace to generate heading for
* @return {string} heading for overlay
*/
function
getNamespaceHeadingText
(
namespaceID
)
{
switch
(
namespaceID
)
{
case
NS_CATEGORY
:
return
mw
.
msg
(
'mobile-frontend-meta-data-issues-categories'
);
case
NS_MAIN
:
return
mw
.
msg
(
'mobile-frontend-meta-data-issues'
);
default
:
return
''
;
}
}
module
.
exports
=
pageIssuesOverlay
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 04:32 (18 h, 12 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e6/79/f433dcc7840bcf19855b7cac949f
Default Alt Text
pageIssuesOverlay.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment