Tracking for change events in citation-templates

Bug: T221305
Change-Id: I4aa099ae1f7a6a2bb49b28c6d1452d077ffa61b7
This commit is contained in:
David Lynch 2019-07-22 11:46:57 -05:00
parent 797b80748d
commit ba9b0c280b

View file

@ -85,6 +85,8 @@ ve.ui.MWCitationDialog.prototype.initialize = function ( data ) {
// HACK: Use the same styling as single-mode transclusion dialog - this should be generalized // HACK: Use the same styling as single-mode transclusion dialog - this should be generalized
this.$content.addClass( 've-ui-mwTransclusionDialog-single' ); this.$content.addClass( 've-ui-mwTransclusionDialog-single' );
this.$content.on( 'change', this.onInputChange.bind( this ) );
}; };
/** /**
@ -97,6 +99,8 @@ ve.ui.MWCitationDialog.prototype.getSetupProcess = function ( data ) {
this.inDialog = data.inDialog; this.inDialog = data.inDialog;
this.citationTemplate = data.template; this.citationTemplate = data.template;
this.citationTitle = data.title; this.citationTitle = data.title;
this.trackedCitationInputChange = false;
}, this ) }, this )
.next( function () { .next( function () {
this.updateTitle(); this.updateTitle();
@ -245,6 +249,18 @@ ve.ui.MWCitationDialog.prototype.getTeardownProcess = function ( data ) {
}, this ); }, this );
}; };
/**
* Handle change events on the transclusion inputs
*
* @param {jQuery.Event} ev The browser event
*/
ve.ui.MWCitationDialog.prototype.onInputChange = function () {
if ( !this.trackedCitationInputChange ) {
ve.track( 'activity.' + this.constructor.static.name, { action: 'manual-template-input' } );
this.trackedCitationInputChange = true;
}
};
/* Registration */ /* Registration */
ve.ui.windowFactory.register( ve.ui.MWCitationDialog ); ve.ui.windowFactory.register( ve.ui.MWCitationDialog );