mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Merge "Realtime Preview: add event tracking to triggered events"
This commit is contained in:
commit
2f1e4604ee
|
@ -269,5 +269,17 @@
|
|||
mw.hook( 'ext.WikiEditor.realtimepreview.disable' ).add( function () {
|
||||
logEditFeature( 'preview', 'preview-realtime-off' );
|
||||
} );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.stop' ).add( function () {
|
||||
logEditFeature( 'preview', 'preview-realtime-error-stopped' );
|
||||
} );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadError' ).add( function () {
|
||||
logEditFeature( 'preview', 'preview-realtime-reload-error' );
|
||||
} );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadHover' ).add( function () {
|
||||
logEditFeature( 'preview', 'preview-realtime-reload-hover' );
|
||||
} );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadManual' ).add( function () {
|
||||
logEditFeature( 'preview', 'preview-realtime-reload-manual' );
|
||||
} );
|
||||
|
||||
}() );
|
||||
|
|
|
@ -40,6 +40,7 @@ function ManualWidget( realtimePreview, reloadHoverButton ) {
|
|||
if ( this.enabled ) {
|
||||
this.doRealtimePreview();
|
||||
}
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadManual' ).fire( this );
|
||||
}.bind( realtimePreview )
|
||||
} );
|
||||
this.$element.append( this.$icon, $reloadLabel, $reloadButton );
|
||||
|
|
|
@ -36,6 +36,7 @@ function RealtimePreview() {
|
|||
this.manualWidget.toggle( true );
|
||||
}
|
||||
this.doRealtimePreview();
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadError' ).fire( this );
|
||||
}.bind( this )
|
||||
} );
|
||||
|
||||
|
@ -53,6 +54,8 @@ function RealtimePreview() {
|
|||
if ( this.enabled ) {
|
||||
this.doRealtimePreview( true );
|
||||
}
|
||||
// Let other things happen after refreshing.
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.reloadHover' ).fire( this );
|
||||
}.bind( this )
|
||||
} );
|
||||
|
||||
|
@ -304,6 +307,7 @@ RealtimePreview.prototype.checkResponseTimes = function ( time ) {
|
|||
if ( ( totalResponseTime / this.responseTimes.length ) > this.configData.realtimeDisableDuration ) {
|
||||
this.inManualMode = true;
|
||||
this.manualWidget.toggle( true );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.stop' ).fire( this );
|
||||
}
|
||||
|
||||
this.responseTimes.shift();
|
||||
|
|
Loading…
Reference in a new issue