Add live-preview logging

Log on every click (by any means, including accesskey) of the
main editing preview button.

Bug: T290521
Change-Id: I67d821445c5e39034bcb121beccf17a765a311ed
This commit is contained in:
Sam Wilson 2021-11-03 13:33:38 +08:00
parent 10a35cc513
commit a2cccc57af

View file

@ -178,8 +178,15 @@
} );
} );
}
var $form = $textarea.closest( 'form' );
if ( mw.user.options.get( 'uselivepreview' ) ) {
$form.find( '#wpPreview' ).on( 'click', function () {
logEditFeature( 'preview', 'preview-live' );
} );
}
var submitting;
$textarea.closest( 'form' ).on( 'submit', function () {
$form.on( 'submit', function () {
submitting = true;
} );
var onUnloadFallback = window.onunload;