mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 19:21:39 +00:00
3dc9cff2c2
- Move page issue view components that do not modify the DOM during during construction to PageIssueLearnMoreLink.js and PageIssueLink.js. PascalCase is used optimistically for filenaming in the hopes that these functions can become something like a JSX component. A "new" function prefix is used in the meantime. - Move page issue view logic that munges the existing DOM to pageIssueFormatter.js. Substitute "create" prefixes for insert so that clients won't forget that calling the function is a modify operation. Alternative naming welcome but it shouldn't be confused with more idealistic components that do not depend on DOM state for construction. - Consolidate createPageIssueBanner() and createPageIssueBannerMultiple() into insertPageIssueBanner() as the code was quite similar and were it a true component, it would probably be a single component. All new files appear under page/ to keep their distinction from the overlay code clear. Some view logic remains in pageIssues.js but it shall be difficult to isolate. Bug: T212376 Change-Id: Iccce709c34fa8de5a28a5a00098add5775e3dc9a
15 lines
379 B
JavaScript
15 lines
379 B
JavaScript
( function ( M ) {
|
|
/**
|
|
* Creates a "read more" button with given text.
|
|
* @param {string} msg
|
|
* @return {JQuery}
|
|
*/
|
|
function newPageIssueLearnMoreLink( msg ) {
|
|
return $( '<span>' )
|
|
.addClass( 'ambox-learn-more' )
|
|
.text( msg );
|
|
}
|
|
|
|
M.define( 'skins.minerva.scripts/page-issues/page/PageIssueLearnMoreLink', newPageIssueLearnMoreLink );
|
|
}( mw.mobileFrontend ) );
|