Merge "Fix issue with options dialog when media viewer has been reopened"

This commit is contained in:
jenkins-bot 2014-10-23 14:58:54 +00:00 committed by Gerrit Code Review
commit 5b4af66668
5 changed files with 14 additions and 7 deletions

View file

@ -114,7 +114,7 @@
"multimediaviewer-download-attribution-cta": "Show me how",
"multimediaviewer-attr-plain": "Plain",
"multimediaviewer-attr-html": "HTML",
"multimediaviewer-options-tooltip": "Settings: Disable or enable previews",
"multimediaviewer-options-tooltip": "Enable or disable Media Viewer",
"multimediaviewer-options-dialog-header": "Disable Media Viewer?",
"multimediaviewer-options-text-header": "Skip this viewing feature for all files.",
"multimediaviewer-options-text-body": "You can enable it later through the file details page.",

View file

@ -109,7 +109,9 @@
'embed-select-menu-html-large': 'User switched to the large thumbnail size on html.',
'use-this-file-close': 'User closed the dialog to use this file.',
'download-open': 'User opened the dialog to download this file.',
'download-close': 'User closed the dialog to download this file.'
'download-close': 'User closed the dialog to download this file.',
'options-open': 'User opened the enable/disable dialog.',
'options-close': 'User either canceled an enable/disable action or closed a confirmation window.'
};
/**

View file

@ -48,8 +48,12 @@
this.$options = $( '<div>' )
.text( ' ' )
.prop( 'title', mw.message( 'multimediaviewer-options-tooltip' ) )
.addClass( 'mw-mmv-options-button' );
.prop( 'title', mw.message( 'multimediaviewer-options-tooltip' ).text() )
.addClass( 'mw-mmv-options-button' )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'se' )
} );
this.$download = $( '<div>' )
.addClass( 'mw-mmv-download-button' )
@ -244,6 +248,7 @@
CBP.unattach = function () {
this.$download.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
this.$reuse.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
this.$options.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
this.$close.tipsy( 'hide' );
this.$fullscreen.tipsy( 'hide' );
};

View file

@ -119,7 +119,7 @@
this.sandbox.stub( mw.loader, 'using' );
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] )['throws']( 'EventLogging is missing' );
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] ).throwsException( 'EventLogging is missing' );
promise = durationLogger.loadDependencies();
@ -129,7 +129,7 @@
mw.loader.using.restore();
this.sandbox.stub( mw.loader, 'using' );
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] )['throws']( 'EventLogging is missing' );
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] ).throwsException( 'EventLogging is missing' );
promise = durationLogger.loadDependencies();

View file

@ -150,7 +150,7 @@
} );
QUnit.asyncTest( 'UserInfo fake test', 4, function ( assert ) {
var api = { get: this.sandbox.stub()['throws']( 'API was invoked' ) },
var api = { get: this.sandbox.stub().throwsException( 'API was invoked' ) },
username = 'Catrope',
repoInfo = {},
userInfoProvider = new mw.mmv.provider.UserInfo( api, { useApi: false } );