In T346944 we've renamed the element ID #page-actions in Minerva to #p-views. This is to match other skins and to improve support for gadgets and extensionse in the mobile skin. It adds support for the mw.util.addPortletLink function.
This will cause some disruption to skins but provides a a stable interface going forward.
$( '#page-actions' ).append( $( '<li>' ).attr( { id: 'page-actions-export-epub', class: 'page-actions-menu__list-item', } ).append( $( '<a>' ).attr( { id: 'ca-export-epub', class: 'export-epub mw-ui-icon mw-ui-icon-element', href: '//tools.wmflabs.org/wsexport/tool/book.php?lang=th&format=epub&page=' + mw.config.get( 'wgPageName' ), title: 'ดาวน์โหลดรุ่น EPUB ของหน้านี้' } ).append("Download EPUB") ) );
can be replaced with
mw.util.addPortletLink( 'p-views', 'https://tools.wmflabs.org/wsexport/tool/book.php?lang=ca&format=epub&page=' + mw.config.get( 'wgPageName' ), 'ePub', 'ca-export-epub' ); mw.util.addCSS('#ca-export-epub .minerva-icon { background-image: url(..); }');
Required actions
- Use addPortletLink for adding menu items. Define icon.
- Remove #page-actions selectors where possible. Extensions/skins ideally should not style code that they do not define.
- Replace any #page-actions selectors with #p-views or #p-views,#page-actions where required.
Impacted code
https://codesearch.wmcloud.org/deployed/?q=%23page-actions%28%27%7C+%29&files=&excludeFiles=&repos=
https://global-search.toolforge.org/?q=%5C%23page-actions®ex=1&namespaces=8&title=%28Gadget%7CMobile%7CMinerva%29.* (29) [not a complete list]