Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/resources/MediaWikiPlayerSupport.js |
— | — | @@ -205,10 +205,21 @@ |
206 | 206 | } |
207 | 207 | }); |
208 | 208 | |
209 | | - $( embedPlayer ).bind('GetShareIframeCode', function(event, callback){ |
210 | | - if( data-mwprovider ) |
| 209 | + $( embedPlayer ).bind('GetShareIframeSrc', function(event, callback){ |
211 | 210 | // Check the embedPlayer title key: |
212 | | - iframeSrc = $( embedPlayer).attr( 'data-mwtitle') |
| 211 | + var title = $( embedPlayer).attr( 'data-mwtitle'); |
| 212 | + // TODO Check the provider key and use that hosts title page entry point! |
| 213 | + var provider = $( embedPlayer).attr( 'data-mwprovider'); |
| 214 | + |
| 215 | + var iframeUrl = false; |
| 216 | + if( mw.getConfig('wgServer') && mw.getConfig('wgArticlePath') ){ |
| 217 | + iframeUrl = mw.getConfig('wgServer') + |
| 218 | + mw.getConfig('wgArticlePath').replace( /\$1/, 'File:' + |
| 219 | + unescape( embedPlayer.apiTitleKey ).replace( /^(File:|Image:)/ , '' ) ) + |
| 220 | + '?' + mw.getConfig( 'Mw.AppendWithJS' ) + '&embedplayer=yes'; |
| 221 | + } |
| 222 | + |
| 223 | + callback( iframeUrl ); |
213 | 224 | }); |
214 | 225 | }; |
215 | 226 | |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery/jquery.triggerQueueCallback.js |
— | — | @@ -10,8 +10,8 @@ |
11 | 11 | * With triggerQueueCallback() master callback is not called until all the |
12 | 12 | * binded events have run their local callbacks. |
13 | 13 | * |
14 | | - * This is useful in cases where you have multiple modules that need to asyncrusly load |
15 | | - * something at a given binded time. |
| 14 | + * This is useful in cases where you have multiple modules that need to do asynchronous loads |
| 15 | + * before issuing the a callback. |
16 | 16 | * |
17 | 17 | * @param {string} |
18 | 18 | * triggerName Name of trigger to be run |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/mwEmbedSupport.js |
— | — | @@ -398,7 +398,7 @@ |
399 | 399 | */ |
400 | 400 | mw.addDialog = function ( options ) { |
401 | 401 | // Remove any other dialog |
402 | | - $j( '#mwTempLoaderDialog' ).remove(); |
| 402 | + $j( '#mweDialog' ).remove(); |
403 | 403 | |
404 | 404 | if( !options){ |
405 | 405 | options = {}; |
— | — | @@ -421,7 +421,7 @@ |
422 | 422 | $j( 'body' ).append( |
423 | 423 | $j('<div />') |
424 | 424 | .attr( { |
425 | | - 'id' : "mwTempLoaderDialog", |
| 425 | + 'id' : "mweDialog", |
426 | 426 | 'title' : options.title |
427 | 427 | }) |
428 | 428 | .css({ |
— | — | @@ -455,16 +455,16 @@ |
456 | 456 | ], |
457 | 457 | uiRequest |
458 | 458 | ], function() { |
459 | | - $j( '#mwTempLoaderDialog' ).dialog( options ); |
| 459 | + $j( '#mweDialog' ).dialog( options ); |
460 | 460 | } ); |
461 | | - return $j( '#mwTempLoaderDialog' ); |
| 461 | + return $j( '#mweDialog' ); |
462 | 462 | }; |
463 | 463 | |
464 | 464 | /** |
465 | 465 | * Close the loader dialog created with addLoaderDialog |
466 | 466 | */ |
467 | 467 | mw.closeLoaderDialog = function() { |
468 | | - $j( '#mwTempLoaderDialog' ).dialog( 'destroy' ).remove(); |
| 468 | + $j( '#mweDialog' ).dialog( 'destroy' ).remove(); |
469 | 469 | }; |
470 | 470 | |
471 | 471 | // MOVE TO jquery.client |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.i18n.php |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | 'timedmedia-more' => 'More…', |
30 | 30 | 'timedmedia-dismiss' => 'Close', |
31 | 31 | 'timedmedia-download' => 'Download file', |
| 32 | + 'timedmedia-play-media' => 'Play media', |
32 | 33 | 'timedmedia-desc-link' => 'About this file', |
33 | 34 | 'timedmedia-oggThumb-version' => 'OggHandler requires oggThumb version $1 or later.', |
34 | 35 | 'timedmedia-oggThumb-failed' => 'oggThumb failed to create the thumbnail.', |
Index: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php |
— | — | @@ -42,18 +42,22 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | function toHtml( $options = array() ) { |
46 | | - global $wgVideoTagOut; |
| 46 | + global $wgVideoTagOut, $wgMinimumVideoPlayerSize, $wgOut; |
47 | 47 | |
48 | 48 | wfLoadExtensionMessages( 'TimedMediaHandler' ); |
49 | 49 | if ( count( func_get_args() ) == 2 ) { |
50 | 50 | throw new MWException( __METHOD__ .' called in the old style' ); |
51 | 51 | } |
52 | | - |
53 | | - return $this->getXmlTagOutput( |
54 | | - $this->getMediaAttr(), |
55 | | - $this->getMediaSources(), |
56 | | - $this->getLocalTextSources() |
57 | | - ); |
| 52 | + |
| 53 | + // Check if the video is too small to play inline ( instead do a pop-up dialog ) |
| 54 | + if( $this->width <= $wgMinimumVideoPlayerSize && $this->isVideo ){ |
| 55 | + // Make sure we add the popUpThum module |
| 56 | + $wgOut->addModules( 'PopUpMediaTransform' ); |
| 57 | + $wgOut->addModuleStyles( 'PopUpMediaTransform' ); |
| 58 | + return $this->getImagePopUp(); |
| 59 | + } else { |
| 60 | + return $this->getXmlMediaTagOutput(); |
| 61 | + } |
58 | 62 | } |
59 | 63 | // XXX migrate this to the mediawiki XML class as 'tagSet' helper function |
60 | 64 | static function xmlTagSet( $tagName, $tagSet ){ |
— | — | @@ -67,25 +71,63 @@ |
68 | 72 | return $s; |
69 | 73 | } |
70 | 74 | |
| 75 | + function getImagePopUp(){ |
| 76 | + return Xml::tags( 'div' , array( |
| 77 | + 'id' => "ogg_thumbplayer_" . TimedMediaTransformOutput::$serial++, |
| 78 | + 'class' => 'PopUpMediaTransform', |
| 79 | + 'style' => "width:" . intval( $this->width ) . "px;height:" . |
| 80 | + intval( $this->getPlayerHeight() ) . "px", |
| 81 | + 'data-videopayload' => $this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ), |
| 82 | + ), |
| 83 | + Xml::tags( 'img', array( |
| 84 | + 'style' => 'width:100%;height:100%;', |
| 85 | + 'src' => $this->getPosterUrl(), |
| 86 | + ),'') |
| 87 | + . |
| 88 | + // For javascript disabled browsers provide a link to the asset: |
| 89 | + Xml::tags( 'a', array( |
| 90 | + 'href'=> $this->file->getUrl(), |
| 91 | + 'title' => wfMsg( 'timedmedia-play-media' ) |
| 92 | + ), '<b></b>'. // why is the a child tag escaped unless there is an html string prefix? |
| 93 | + Xml::tags( 'div', array( |
| 94 | + 'class' => 'play-btn-large' |
| 95 | + ), '') |
| 96 | + ) |
| 97 | + ); |
| 98 | + } |
| 99 | + |
71 | 100 | /** |
| 101 | + * Get target popup player size |
| 102 | + * If player is smaller than threshold return size based on wgDefaultUserOptions ) |
| 103 | + */ |
| 104 | + function getPopupPlayerSize(){ |
| 105 | + global $wgDefaultUserOptions, $wgMinimumVideoPlayerSize, $wgImageLimits; |
| 106 | + // Get the max width from the enabled transcode settings: |
| 107 | + $maxImageSize = WebVideoTranscode::getMaxSizeWebStream(); |
| 108 | + return WebVideoTranscode::getMaxSizeTransform( $this->file, $maxImageSize); |
| 109 | + } |
| 110 | + |
| 111 | + /** |
72 | 112 | * Call mediaWiki xml helper class to build media tag output from |
73 | 113 | * supplied arrays |
74 | 114 | */ |
75 | | - function getXmlTagOutput( $mediaAttr, $mediaSources, $textSources ){ |
| 115 | + function getXmlMediaTagOutput( $sizeOverride = array() ){ |
76 | 116 | // Try to get the first source src attribute ( usually this should be the source file ) |
| 117 | + $mediaSources = $this->getMediaSources(); |
77 | 118 | $firstSource = current( reset( $mediaSources ) ); |
78 | | - if( !$firstSource['url']){ |
| 119 | + if( !$firstSource['url'] ){ |
79 | 120 | // XXX media handlers don't seem to work with exceptions.. |
80 | 121 | return 'Error missing media source'; |
81 | | - } |
| 122 | + }; |
| 123 | + |
82 | 124 | // Build the video tag output: |
83 | | - $s = Xml::tags( $this->getTagName(), $mediaAttr, |
| 125 | + $s = Xml::tags( $this->getTagName(), $this->getMediaAttr( $sizeOverride ), |
84 | 126 | |
85 | 127 | // The set of media sources: |
86 | 128 | self::xmlTagSet( 'source', $mediaSources ) . |
87 | 129 | |
88 | 130 | // Timed text: |
89 | | - self::xmlTagSet( 'track', $textSources ) . |
| 131 | + self::xmlTagSet( 'track', $this->getLocalTextSources() ) . |
90 | 132 | |
91 | 133 | // Fallback text displayed for browsers without js and without video tag support: |
92 | 134 | /// XXX note we may want to replace this with an image and download link play button |
— | — | @@ -94,16 +136,18 @@ |
95 | 137 | return $s; |
96 | 138 | } |
97 | 139 | |
98 | | - function getMediaAttr(){ |
| 140 | + function getMediaAttr( $sizeOverride = false ){ |
99 | 141 | global $wgVideoPlayerSkin ; |
100 | 142 | // Normalize values |
101 | 143 | $length = floatval( $this->length ); |
102 | 144 | $offset = floatval( $this->offset ); |
103 | | - $width = intval( $this->width ); |
104 | 145 | |
| 146 | + $width = ( $sizeOverride )? $sizeOverride[0] : intval( $this->width ); |
| 147 | + $height = ( $sizeOverride )? $sizeOverride[1]: $this->getPlayerHeight(); |
| 148 | + |
105 | 149 | $mediaAttr = array( |
106 | 150 | 'id' => "ogg_player_" . TimedMediaTransformOutput::$serial++, |
107 | | - 'style' => "width:{$width}px;height:" . $this->getPlayerHeight(). "px", |
| 151 | + 'style' => "width:{$width}px;height:{$height}px", |
108 | 152 | 'poster' => $this->getPosterUrl(), |
109 | 153 | 'alt' => $this->file->getTitle()->getText(), |
110 | 154 | |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.php |
— | — | @@ -37,15 +37,10 @@ |
38 | 38 | $wgAutoloadClasses['WebVideoTranscode'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscode.php"; |
39 | 39 | $wgAutoloadClasses['WebVideoTranscodeJob'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscodeJob.php"; |
40 | 40 | |
41 | | -// Register the Timed Media Handler javascript resources ( mwEmbed modules ) |
| 41 | +// Register the Timed Media Handler javascript resources ( MwEmbed modules ) |
42 | 42 | MwEmbedResourceManager::register( 'extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer' ); |
43 | 43 | MwEmbedResourceManager::register( 'extensions/TimedMediaHandler/MwEmbedModules/TimedText' ); |
44 | 44 | |
45 | | -// MwEmbed module configuration: |
46 | | -$wgMwEmbedModuleConfig['EmbedPlayer.DirectFileLinkWarning'] = true; |
47 | | -$wgMwEmbedModuleConfig['TimedText.ShowInterface'] = 'always'; |
48 | | - |
49 | | - |
50 | 45 | // Localization |
51 | 46 | $wgExtensionMessagesFiles['TimedMediaHandler'] = "$timedMediaDir/TimedMediaHandler.i18n.php"; |
52 | 47 | $wgExtensionMessagesFiles['TimedMediaHandlerMagic'] = "$timedMediaDir/TimedMediaHandler.i18n.magic.php"; |
— | — | @@ -75,6 +70,19 @@ |
76 | 71 | |
77 | 72 | /******************* CONFIGURATION STARTS HERE **********************/ |
78 | 73 | |
| 74 | +/*** MwEmbed module configuration: *********************************/ |
| 75 | +// Show a warning to the user if they are not using an html5 browser with high quality ogg support |
| 76 | +$wgMwEmbedModuleConfig['EmbedPlayer.DirectFileLinkWarning'] = true; |
| 77 | + |
| 78 | +// The text interface should always be shown |
| 79 | +// ( even if there are no text tracks for that asset at render time ) |
| 80 | +$wgMwEmbedModuleConfig['TimedText.ShowInterface'] = 'always'; |
| 81 | + |
| 82 | +/*** end MwEmbed module configuration: ******************************/ |
| 83 | + |
| 84 | +// The minimum size for an embed video player: |
| 85 | +$wgMinimumVideoPlayerSize = 200; |
| 86 | + |
79 | 87 | // Set the supported ogg codecs: |
80 | 88 | $wgMediaVideoTypes = array( 'Theora', 'VP8' ); |
81 | 89 | $wgMediaAudioTypes = array( 'Vorbis', 'Speex', 'FLAC' ); |
— | — | @@ -94,7 +102,6 @@ |
95 | 103 | // Location of the FFmpeg binary ( used to encode WebM and for thumbnails ) |
96 | 104 | $wgFFmpegLocation = '/usr/bin/ffmpeg'; |
97 | 105 | |
98 | | - |
99 | 106 | /** |
100 | 107 | * Default enabled transcodes |
101 | 108 | * |
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | ) . '/' . |
117 | 117 | $file->getName() . '.' . |
118 | 118 | $transcodeKey ; |
119 | | -} |
| 119 | + } |
120 | 120 | |
121 | 121 | static public function getTargetEncodePath( &$file, $transcodeKey ){ |
122 | 122 | // TODO probably should use some other temporary non-web accessible location for |
— | — | @@ -124,7 +124,19 @@ |
125 | 125 | $ext = strtolower( pathinfo( "$filePath", PATHINFO_EXTENSION ) ); |
126 | 126 | return "{$filePath}.queue.{$ext}"; |
127 | 127 | } |
128 | | - |
| 128 | + /** |
| 129 | + * Get the max size of the web stream ( constant bitrate ) |
| 130 | + */ |
| 131 | + static public function getMaxSizeWebStream(){ |
| 132 | + global $wgEnabledTranscodeSet; |
| 133 | + $maxSize = 0; |
| 134 | + foreach( $wgEnabledTranscodeSet as $transcodeKey ){ |
| 135 | + if( isset( self::$derivativeSettings[$transcodeKey]['videoBitrate'] ) ){ |
| 136 | + $maxSize = self::$derivativeSettings[$transcodeKey]['maxSize']; |
| 137 | + } |
| 138 | + } |
| 139 | + return $maxSize; |
| 140 | + } |
129 | 141 | /** |
130 | 142 | * Static function to get the set of video assets |
131 | 143 | * |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php |
— | — | @@ -11,7 +11,8 @@ |
12 | 12 | // Register TimedMediaHandler Hooks |
13 | 13 | static function register(){ |
14 | 14 | global $wgParserOutputHooks, $wgHooks, $wgJobClasses, $wgJobExplitRequestTypes, |
15 | | - $wgMediaHandlers, $wgExcludeFromThumbnailPurge, $wgTimedMediaHandlerFileExtensions; |
| 15 | + $wgMediaHandlers, $wgResourceModules, $wgExcludeFromThumbnailPurge, |
| 16 | + $wgTimedMediaHandlerFileExtensions; |
16 | 17 | |
17 | 18 | // Setup media Handlers: |
18 | 19 | $wgMediaHandlers['application/ogg'] = 'OggHandler'; |
— | — | @@ -28,6 +29,18 @@ |
29 | 30 | $wgJobExplitRequestTypes+= array( |
30 | 31 | 'webVideoTranscode' |
31 | 32 | ); |
| 33 | + |
| 34 | + // Add the PopUpMediaTransform module ( specific to timedMedia handler ( no support in mwEmbed modules ) |
| 35 | + $wgResourceModules+= array( |
| 36 | + 'PopUpMediaTransform' => array( |
| 37 | + 'scripts' => 'resources/PopUpThumbVideo.js', |
| 38 | + 'styles' => 'resources/PopUpThumbVideo.css', |
| 39 | + 'localBasePath' => dirname( __FILE__ ), |
| 40 | + 'remoteExtPath' => 'TimedMediaHandler', |
| 41 | + ) |
| 42 | + ); |
| 43 | + |
| 44 | + |
32 | 45 | // Exclude transcoded assets from normal thumbnail purging |
33 | 46 | // ( a mantaince script could handle transcode asset purging) |
34 | 47 | $wgExcludeFromThumbnailPurge += $wgTimedMediaHandlerFileExtensions; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js |
— | — | @@ -1620,12 +1620,35 @@ |
1621 | 1621 | getShareIframeObject: function(){ |
1622 | 1622 | // allow modules to generate the iframe: |
1623 | 1623 | var iframeEmbedCode ={}; |
1624 | | - $( this ).trigger( 'GetShareIframeCode', [ iframeEmbedCode ] ); |
1625 | | - if( iframeEmbedCode.code ){ |
1626 | | - return frameEmbedCode.code; |
1627 | | - } |
| 1624 | + var iframeUrl = false |
| 1625 | + $( this ).trigger( 'GetShareIframeSrc', function( localIframeSrc ){ |
| 1626 | + if( iframeUrl){ |
| 1627 | + mw.log("Error multiple modules binding GetShareIframeSrc" ); |
| 1628 | + } |
| 1629 | + iframeUrl = localIframeSrc; |
| 1630 | + }); |
| 1631 | + |
| 1632 | + if( !iframeUrl ){ |
| 1633 | + iframeUrl = this.getIframeSourceUrl() |
| 1634 | + } |
1628 | 1635 | |
1629 | | - // old style embed: |
| 1636 | + // Set up embedFrame src path |
| 1637 | + var embedCode = '<iframe src="' + mw.html.escape( iframeUrl ) + '" '; |
| 1638 | + |
| 1639 | + // Set width / height of embed object |
| 1640 | + embedCode += 'width="' + this.getPlayerWidth() +'" '; |
| 1641 | + embedCode += 'height="' + this.getPlayerHeight() + '" '; |
| 1642 | + embedCode += 'frameborder="0" '; |
| 1643 | + |
| 1644 | + // Close up the embedCode tag: |
| 1645 | + embedCode+='></iframe>'; |
| 1646 | + |
| 1647 | + // Return the embed code |
| 1648 | + return embedCode; |
| 1649 | + }, |
| 1650 | + |
| 1651 | + getIframeSourceUrl: function(){ |
| 1652 | + // Point to raw files: |
1630 | 1653 | var iframeUrl = mw.getMwEmbedPath() + 'mwEmbedFrame.php?'; |
1631 | 1654 | var params = {'src[]':[]}; |
1632 | 1655 | |
— | — | @@ -1634,7 +1657,7 @@ |
1635 | 1658 | for( var i=0; i < this.mediaElement.sources.length; i++ ){ |
1636 | 1659 | var source = this.mediaElement.sources[i]; |
1637 | 1660 | if( source.src ) { |
1638 | | - params['src[]'].push(mw.absoluteUrl( source.src )); |
| 1661 | + params['src[]'].push(mw.absoluteUrl( source.src )); |
1639 | 1662 | } |
1640 | 1663 | } |
1641 | 1664 | // Output the poster attr |
— | — | @@ -1652,22 +1675,9 @@ |
1653 | 1676 | params['data-durationhint'] = parseFloat( this.duration ); |
1654 | 1677 | } |
1655 | 1678 | iframeUrl += $j.param( params ); |
1656 | | - |
1657 | | - // Set up embedFrame src path |
1658 | | - var embedCode = '<iframe src="' + mw.html.escape( iframeUrl ) + '" '; |
1659 | | - |
1660 | | - // Set width / height of embed object |
1661 | | - embedCode += 'width="' + this.getPlayerWidth() +'" '; |
1662 | | - embedCode += 'height="' + this.getPlayerHeight() + '" '; |
1663 | | - embedCode += 'frameborder="0" '; |
1664 | | - |
1665 | | - // Close up the embedCode tag: |
1666 | | - embedCode+='></iframe>'; |
1667 | | - |
1668 | | - // Return the embed code |
1669 | | - return embedCode; |
| 1679 | + return iframeUrl; |
1670 | 1680 | }, |
1671 | | - |
| 1681 | + |
1672 | 1682 | /** |
1673 | 1683 | * Get the share embed Video tag code |
1674 | 1684 | */ |
Index: trunk/extensions/TimedMediaHandler/resources/jquery.popUpThumbVideo.js |
— | — | @@ -1,13 +0,0 @@ |
2 | | -/** |
3 | | -* Simple script to add pop-up video dialog link support for video thumbnails |
4 | | -*/ |
5 | | -( function( mw, $ ) { |
6 | | - |
7 | | - $.fn.popUpVideoLink( options ){ |
8 | | - $j(this).click(function(){ |
9 | | - // Spawn a new dialog window with the video asset |
10 | | - |
11 | | - }) |
12 | | - } |
13 | | - |
14 | | -} )( mediaWiki, jQuery ); |
\ No newline at end of file |
Index: trunk/extensions/TimedMediaHandler/resources/player_big_play_button.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/TimedMediaHandler/resources/player_big_play_button.png |
___________________________________________________________________ |
Added: svn:executable |
15 | 1 | + * |
Added: svn:mime-type |
16 | 2 | + application/octet-stream |
Index: trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.css |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +.PopUpMediaTransform a .play-btn-large{ |
| 3 | + position : absolute; |
| 4 | + top: 50%; |
| 5 | + left : 50%; |
| 6 | + width: 70px; |
| 7 | + height: 53px; |
| 8 | + margin-left: -35px; |
| 9 | + margin-top: -25px; |
| 10 | + background-image:url('player_big_play_button.png'); |
| 11 | +} |
| 12 | +.PopUpMediaTransform a .play-btn-large :hover{ |
| 13 | + background-image:url('player_big_play_button_hover.png'); |
| 14 | +} |
| 15 | +.PopUpMediaTransform { |
| 16 | + position : relative; |
| 17 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.css |
___________________________________________________________________ |
Added: svn:mime-type |
1 | 18 | + text/plain |
Index: trunk/extensions/TimedMediaHandler/resources/player_big_play_button_hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/TimedMediaHandler/resources/player_big_play_button_hover.png |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 19 | + application/octet-stream |
Index: trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.js |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +/** |
| 3 | +* Simple script to add pop-up video dialog link support for video thumbnails |
| 4 | +*/ |
| 5 | +( function( mw, $ ) { |
| 6 | + |
| 7 | + $(document).ready(function(){ |
| 8 | + $('.PopUpMediaTransform').each(function(){ |
| 9 | + var _parent = this; |
| 10 | + $(this).find('a').click( function(){ |
| 11 | + var $video = $( unescape( $(_parent).attr('data-videopayload') ) ); |
| 12 | + mw.addDialog({ |
| 13 | + 'width' : parseInt( $video.css('width') ) + 25, |
| 14 | + 'height' : parseInt( $video.css('height') ) + 45, |
| 15 | + 'title' : $video.attr('data-mwtitle'), |
| 16 | + 'content' : $video |
| 17 | + }) |
| 18 | + .find('video').embedPlayer(); |
| 19 | + // don't follow file link |
| 20 | + return false; |
| 21 | + }); |
| 22 | + |
| 23 | + }); |
| 24 | + }); |
| 25 | + |
| 26 | +} )( mediaWiki, jQuery ); |
\ No newline at end of file |
Property changes on: trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 27 | + native |
Added: svn:mime-type |
2 | 28 | + text/plain |