[MediaWiki-commits] [Gerrit] Open the download panel when an image is right clicked - change (mediawiki...MultimediaViewer)

2015-01-07 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Open the download panel when an image is right clicked
..


Open the download panel when an image is right clicked

Many users right-click on images as a way to download them.Due to this,
they may get a scaled-down version which is used for display purposes and
also not given guidance on how to attribute.

Bug: T75999
Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
---
M resources/mmv/ui/mmv.ui.canvas.js
M resources/mmv/ui/mmv.ui.dialog.js
2 files changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mmv/ui/mmv.ui.canvas.js 
b/resources/mmv/ui/mmv.ui.canvas.js
index 33d6029..c8b5622 100644
--- a/resources/mmv/ui/mmv.ui.canvas.js
+++ b/resources/mmv/ui/mmv.ui.canvas.js
@@ -214,9 +214,14 @@
}
} );
 
+   // open the download panel on right clicking the image
this.$image.on( 'mousedown.mmv-canvas', function ( e ) {
if ( e.which === 3 ) {
mw.mmv.actionLogger.log( 'right-click-image' );
+   if ( !canvas.downloadOpen ) {
+   $( document ).trigger( 
'mmv-download-open', e );
+   e.stopPropagation();
+   }
}
} );
};
diff --git a/resources/mmv/ui/mmv.ui.dialog.js 
b/resources/mmv/ui/mmv.ui.dialog.js
index e3ce8ac..53118f6 100644
--- a/resources/mmv/ui/mmv.ui.dialog.js
+++ b/resources/mmv/ui/mmv.ui.dialog.js
@@ -132,7 +132,8 @@
// Don't close the dialog if the click inside a dialog 
or on an navigation arrow
if ( $clickTarget.closest( dialog.$dialog ).length
|| $clickTarget.closest( '.mw-mmv-next-image' ).length
-   || $clickTarget.closest( '.mw-mmv-prev-image' ).length 
) {
+   || $clickTarget.closest( '.mw-mmv-prev-image' ).length 
+   || e.which === 3 ) {
return;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Namit 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Open the download panel when an image is right clicked - change (mediawiki...MultimediaViewer)

2014-12-31 Thread Namit (Code Review)
Namit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182353

Change subject: Open the download panel when an image is right clicked
..

Open the download panel when an image is right clicked

Many users right-click on images as a way to download them.Due to this,
they may get a scaled-down version which is used for display purposes and
also not given guidance on how to attribute.

Bug: T75999
Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
---
M resources/mmv/ui/mmv.ui.canvas.js
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/53/182353/1

diff --git a/resources/mmv/ui/mmv.ui.canvas.js 
b/resources/mmv/ui/mmv.ui.canvas.js
index 1a45ee1..7812af5 100644
--- a/resources/mmv/ui/mmv.ui.canvas.js
+++ b/resources/mmv/ui/mmv.ui.canvas.js
@@ -213,6 +213,19 @@
} );
}
} );
+
+   // don't open the context menu on right clicking the image
+   this.$image.bind( 'contextmenu', function ( e ) {
+   return false;
+   } );
+
+   // open the download panel on right clicking the image
+   this.$image.mousedown( function ( e ) {
+   if ( e.button === 2 ) {
+   $( document ).trigger( 'mmv-download-open', e );
+   e.stopPropagation();
+   }
+   } );
};
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30655a0dda4430b494a393f1fa708fce6ca6fafe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Namit 

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