mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-14 11:15:33 +00:00
Define stable and internal APIs
Bug: T348081 Change-Id: I2ca9f27802e5ff1e0738300e2595ea419d49a431
This commit is contained in:
parent
111201d910
commit
922475be6b
|
@ -184,6 +184,12 @@ module.exports = function webABTest( props, token, forceInit ) {
|
||||||
// Send data to WikimediaEvents to log A/B test initialization if the subject
|
// Send data to WikimediaEvents to log A/B test initialization if the subject
|
||||||
// has been sampled into the experiment.
|
// has been sampled into the experiment.
|
||||||
if ( isInSample() ) {
|
if ( isInSample() ) {
|
||||||
|
/**
|
||||||
|
* @event mediawiki.web_AB_test_enrollment
|
||||||
|
* @internal for use by WikimediaEvents only.
|
||||||
|
* @property {string} context
|
||||||
|
* @property {string} action
|
||||||
|
*/
|
||||||
mw.hook( WEB_AB_TEST_ENROLLMENT_HOOK ).fire( {
|
mw.hook( WEB_AB_TEST_ENROLLMENT_HOOK ).fire( {
|
||||||
group: getBucket(),
|
group: getBucket(),
|
||||||
experimentName: props.name
|
experimentName: props.name
|
||||||
|
|
|
@ -10,6 +10,12 @@ const
|
||||||
* @param {string} direction the scroll direction
|
* @param {string} direction the scroll direction
|
||||||
*/
|
*/
|
||||||
function firePageTitleScrollHook( direction ) {
|
function firePageTitleScrollHook( direction ) {
|
||||||
|
/**
|
||||||
|
* @event vector.page_title_scroll
|
||||||
|
* @internal for use by WikimediaEvents only.
|
||||||
|
* @property {string} context
|
||||||
|
* @property {string} action
|
||||||
|
*/
|
||||||
if ( direction === 'down' ) {
|
if ( direction === 'down' ) {
|
||||||
mw.hook( SCROLL_TITLE_HOOK ).fire( {
|
mw.hook( SCROLL_TITLE_HOOK ).fire( {
|
||||||
context: SCROLL_TITLE_CONTEXT_BELOW
|
context: SCROLL_TITLE_CONTEXT_BELOW
|
||||||
|
|
|
@ -223,6 +223,10 @@ const setupTableOfContents = ( tocElement, bodyContent, initSectionObserverFn )
|
||||||
} );
|
} );
|
||||||
mw.hook( 'wikipage.tableOfContents' ).add( function ( sections ) {
|
mw.hook( 'wikipage.tableOfContents' ).add( function ( sections ) {
|
||||||
tableOfContents.reloadTableOfContents( sections ).then( function () {
|
tableOfContents.reloadTableOfContents( sections ).then( function () {
|
||||||
|
/**
|
||||||
|
* @stable for use in gadgets and extensions
|
||||||
|
* @since 1.40
|
||||||
|
*/
|
||||||
mw.hook( 'wikipage.tableOfContents.vector' ).fire( sections );
|
mw.hook( 'wikipage.tableOfContents.vector' ).fire( sections );
|
||||||
updateElements();
|
updateElements();
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue