mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 08:14:33 +00:00
Only do client-side instrumentation on action=edit/action=submit
So we don't break the tests Bug: T93119 Change-Id: Ib0545f581fd2a845b893a046ab7aa7161e27180e
This commit is contained in:
parent
9d2092b25c
commit
4d54fa4471
|
@ -550,29 +550,31 @@ if ( !context || typeof context === 'undefined' ) {
|
|||
context.fn.trigger( 'resize', event );
|
||||
} );
|
||||
|
||||
mw.wikiEditor.logEditEvent( 'ready', {
|
||||
editingSessionId: $( '#editform input#editingStatsId' ).val()
|
||||
} );
|
||||
$( '#editform' ).submit( function () {
|
||||
context.submitting = true;
|
||||
} );
|
||||
this.onUnloadFallback = window.onunload;
|
||||
window.onunload = function () {
|
||||
var fallbackResult;
|
||||
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' ) {
|
||||
mw.wikiEditor.logEditEvent( 'ready', {
|
||||
editingSessionId: $( '#editform input#editingStatsId' ).val()
|
||||
} );
|
||||
$( '#editform' ).submit( function () {
|
||||
context.submitting = true;
|
||||
} );
|
||||
this.onUnloadFallback = window.onunload;
|
||||
window.onunload = function () {
|
||||
var fallbackResult;
|
||||
|
||||
if ( this.onUnloadFallback ) {
|
||||
fallbackResult = this.onUnloadFallback();
|
||||
}
|
||||
if ( this.onUnloadFallback ) {
|
||||
fallbackResult = this.onUnloadFallback();
|
||||
}
|
||||
|
||||
if ( !context.submitting ) {
|
||||
mw.wikiEditor.logEditEvent( 'abort', {
|
||||
editingSessionId: $( '#editform input#editingStatsId' ).val(),
|
||||
// TODO: abort.type
|
||||
} );
|
||||
}
|
||||
if ( !context.submitting ) {
|
||||
mw.wikiEditor.logEditEvent( 'abort', {
|
||||
editingSessionId: $( '#editform input#editingStatsId' ).val(),
|
||||
// TODO: abort.type
|
||||
} );
|
||||
}
|
||||
|
||||
return fallbackResult;
|
||||
};
|
||||
return fallbackResult;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* API Execution */
|
||||
|
|
Loading…
Reference in a new issue