Merge "Add "zoom" but really just view-file"

This commit is contained in:
jenkins-bot 2014-06-11 02:38:52 +00:00 committed by Gerrit Code Review
commit 114890cc43
8 changed files with 152 additions and 5 deletions

View file

@ -705,6 +705,10 @@ $wgResourceModules += array(
'mmv.ui',
'oojs',
),
'messages' => array(
'multimediaviewer-viewfile-link',
),
),
'mmv.logger' => $wgMediaViewerResourceTemplate + array(

View file

@ -54,6 +54,7 @@
"multimediaviewer-fileusage-local-section": "On this site",
"multimediaviewer-fileusage-global-section": "On other sites",
"multimediaviewer-reuse-link": "Use this file",
"multimediaviewer-viewfile-link": "View original file",
"multimediaviewer-reuse-loading-placeholder": "Loading…",
"multimediaviewer-share-tab": "Share",
"multimediaviewer-embed-tab": "Embed",

View file

@ -877,6 +877,10 @@
} else {
return $.Deferred().reject();
}
} ).on( 'mmv-viewfile.mmvp', function () {
viewer.imageInfoProvider.get( viewer.currentImageFileTitle ).done( function ( imageInfo ) {
document.location = imageInfo.url;
} );
} );
};

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="100%"
height="100%"
viewBox="-1.2 0 23 22.2"
id="svg2"
xml:space="preserve"><metadata
id="metadata50"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs48" />
<path
d="M 2.3,3.3 V 18 c 0,0.3 0.2,0.5 0.5,0.5 h 18.1 c 0.3,0 0.5,-0.2 0.5,-0.5 V 3.3 C 21.4,3 21.2,2.8 20.9,2.8 H 2.8 C 2.5,2.8 2.3,3.1 2.3,3.3 z m 17,10.1 h -15 l 4.5,-5.8 0.7,-0.3 4.2,4.5 2.2,-1.3 3.4,2.9 0,0 0,0 z"
id="path5_4_"
style="stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<path
d="m -1,5.7 v 15.8 c 0,0.2 0.2,0.4 0.4,0.4 H 20.6 V 19.8 H 1.5 C 1.3,19.8 1.1,19.6 1.1,19.4 V 5.7 H -1 z"
id="polygon7_4_"
style="stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<path
d="m -1,5.7 v 15 c 0,0.2 0.2,0.4 0.4,0.4 H 20.6 V 19.4 H 1.5 C 1.3,19.4 1.1,19.2 1.1,19 V 5.7 H -1 z"
id="polygon7_6_"
style="fill:#ffffff;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<polygon
points="8.8,7.6 9.5,7.3 13.7,11.8 16,10.5 19.4,13.4 4.4,13.4 "
id="polygon42"
style="opacity:0.5" />
<path
d="M 20.9,2.8 H 2.8 C 2.5,2.8 2.3,3 2.3,3.3 V 17 c 0,0.3 0.2,0.5 0.5,0.5 h 18.1 c 0.3,0 0.5,-0.2 0.5,-0.5 V 3.3 C 21.4,3.1 21.2,2.8 20.9,2.8 z M 4.4,13.4 8.9,7.6 9.6,7.3 l 4.2,4.5 2.2,-1.3 3.4,2.9 h -15 z"
id="path44"
style="fill:#ffffff;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="100%"
height="100%"
viewBox="-1.2 0 23 22.2"
id="svg2"
xml:space="preserve"><metadata
id="metadata50"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs48" />
<path
d="M -1,3.3 V 18 c 0,0.3 0.2,0.5 0.5,0.5 h 18.1 c 0.3,0 0.5,-0.2 0.5,-0.5 V 3.3 C 18.1,3 17.9,2.8 17.6,2.8 H -0.5 C -0.8,2.8 -1,3.1 -1,3.3 z M 16,13.4 H 1 l 4.5,-5.8 0.7,-0.3 4.2,4.5 2.2,-1.3 3.4,2.9 0,0 0,0 z"
id="path5_4_"
style="stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<path
d="m 21.4,5.7 v 15.8 c 0,0.2 -0.2,0.4 -0.4,0.4 H -0.2 v -2.1 h 19.1 c 0.2,0 0.4,-0.2 0.4,-0.4 V 5.7 h 2.1 z"
id="polygon7_4_"
style="stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<path
d="m 21.4,5.7 v 15 c 0,0.2 -0.2,0.4 -0.4,0.4 H -0.2 v -1.7 h 19.1 c 0.2,0 0.4,-0.2 0.4,-0.4 V 5.7 h 2.1 z"
id="polygon7_6_"
style="fill:#ffffff;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
<polygon
points="16,10.5 19.4,13.4 4.4,13.4 8.8,7.6 9.5,7.3 13.7,11.8 "
transform="translate(-3.3,0)"
id="polygon42"
style="opacity:0.5" />
<path
d="M 17.6,2.8 H -0.5 C -0.8,2.8 -1,3 -1,3.3 V 17 c 0,0.3 0.2,0.5 0.5,0.5 h 18.1 c 0.3,0 0.5,-0.2 0.5,-0.5 V 3.3 C 18.1,3.1 17.9,2.8 17.6,2.8 z M 1.1,13.4 5.6,7.6 6.3,7.3 l 4.2,4.5 2.2,-1.3 3.4,2.9 h -15 z"
id="path44"
style="fill:#ffffff;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -36,6 +36,14 @@
this.$close = $closeButton;
this.$fullscreen = $fullscreenButton;
this.$viewFile = $( '<div>' )
.text( ' ' )
.prop( 'title', mw.message( 'multimediaviewer-viewfile-link' ).text() )
.addClass( 'mw-mmv-viewfile' )
.click( function () {
$( document ).trigger( 'mmv-viewfile' );
} );
this.$next = $( '<div>' )
.addClass( 'mw-mmv-next-image disabled' )
.html( '&nbsp;' );
@ -50,7 +58,8 @@
this.$buttons = this.$close
.add( this.$fullscreen )
.add( this.$next )
.add( this.$prev );
.add( this.$prev )
.add( this.$viewFile );
this.$buttons.appendTo( this.$container );

View file

@ -1,3 +1,4 @@
@import "../mmv.globals";
@import "../mmv.mixins";
@navbutton-width: 18px;
@ -5,6 +6,7 @@
.mw-mmv-close,
.mw-mmv-fullscreen,
.mw-mmv-viewfile,
.mw-mmv-next-image,
.mw-mmv-prev-image {
cursor: pointer;
@ -23,17 +25,23 @@
.mw-mmv-close.hidden,
.mw-mmv-fullscreen.hidden,
.mw-mmv-viewfile.hidden,
.mw-mmv-next-image.hidden,
.mw-mmv-prev-image.hidden {
display: none;
}
.cursor-hidden {
.mw-mmv-close, .mw-mmv-fullscreen, .mw-mmv-next-image, .mw-mmv-prev-image {
.mw-mmv-close,
.mw-mmv-fullscreen,
.mw-mmv-viewfile,
.mw-mmv-next-image,
.mw-mmv-prev-image {
cursor: none;
}
}
.mw-mmv-viewfile,
.mw-mmv-close,
.mw-mmv-fullscreen {
right: @buttons-offset;
@ -73,9 +81,25 @@
height: 22px;
}
.jq-fullscreened .mw-mmv-fullscreen {
.mw-mmv-viewfile {
bottom: (@buttons-offset + @metadatabar-drag-height + @metadatabar-top-content-height);
/* @embed */
background-image: url(img/mw-defullscreen-ltr.svg);
background-image: url(img/mw-open-control-ltr.svg);
width: 23px;
height: 23px;
margin-bottom: 14px;
}
.jq-fullscreened {
.mw-mmv-fullscreen {
/* @embed */
background-image: url(img/mw-defullscreen-ltr.svg);
}
.mw-mmv-viewfile {
display: none;
}
}
.mw-mmv-next-image {

View file

@ -202,7 +202,7 @@
restoreScrollTo();
} );
QUnit.test( 'isAnyActiveButtonHovered', 20, function ( assert ) {
QUnit.test( 'isAnyActiveButtonHovered', 25, function ( assert ) {
var lightbox = new mw.mmv.LightboxInterface();
stubScrollTo();