jenkins-bot has submitted this change and it was merged.

Change subject: Measure sitename clicks too
......................................................................


Measure sitename clicks too

Change-Id: Iad105fbc9d257db895660d7afac77294e7907f7a
---
M MultimediaViewer.php
M resources/ext.multimediaViewer/ext.multimediaViewer.js
2 files changed, 22 insertions(+), 2 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MultimediaViewer.php b/MultimediaViewer.php
index 9a64be5..ac743ee 100644
--- a/MultimediaViewer.php
+++ b/MultimediaViewer.php
@@ -211,7 +211,7 @@
                $wgResourceModules['schema.MediaViewer'] = array(
                        'class' => 'ResourceLoaderSchemaModule',
                        'schema' => 'MediaViewer',
-                       'revision' => 6055641,
+                       'revision' => 6066908,
                );
 
                $wgResourceModules['ext.multimediaViewer']['dependencies'][] = 
'ext.eventLogging';
diff --git a/resources/ext.multimediaViewer/ext.multimediaViewer.js 
b/resources/ext.multimediaViewer/ext.multimediaViewer.js
index 52ac58c..6b8dc9b 100755
--- a/resources/ext.multimediaViewer/ext.multimediaViewer.js
+++ b/resources/ext.multimediaViewer/ext.multimediaViewer.js
@@ -46,7 +46,8 @@
                        'enlarge-link-click': 'User clicked on enlarge link to 
open lightbox.',
                        'fullscreen-link-click': 'User clicked on fullscreen 
button in lightbox.',
                        'defullscreen-link-click': 'User clicked on button to 
return to normal lightbox view.',
-                       'close-link-click': 'User clicked on the lightbox close 
button.'
+                       'close-link-click': 'User clicked on the lightbox close 
button.',
+                       'site-link-click': 'User clicked on the link to the 
file description page.'
                };
 
        function MultimediaViewer() {
@@ -295,10 +296,29 @@
        };
 
        MMVP.initializeRepoLink = function () {
+               var viewer = this;
+
                this.ui.$repo = $( '<a>' )
                        .addClass( 'mw-mlb-repo' )
                        .prop( 'href', '#' );
 
+               this.ui.$repo.click( function ( e ) {
+                       var $link = $( this );
+                       viewer.log( 'site-link-click' );
+                       // If the user is navigating away, we have to add a 
timeout to fix that.
+                       if ( e.altKey || e.shiftKey || e.ctrlKey || e.metaKey ) 
{
+                               // Just ignore this case - either they're 
opening in a new
+                               // window and the logging will work, or they're 
not trying to
+                               // navigate away from the page and we should 
leave them alone.
+                               return;
+                       }
+
+                       e.preventDefault();
+                       setTimeout( function () {
+                               window.location.href = $link.prop( 'href' );
+                       }, 500 );
+               } );
+
                this.ui.$repoLi = $( '<li>' )
                        .addClass( 'mw-mlb-repo-li' )
                        .addClass( 'empty' )

-- 
To view, visit https://gerrit.wikimedia.org/r/92445
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iad105fbc9d257db895660d7afac77294e7907f7a
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to