Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | 'embedPlayerIframeStyle'=> array_merge( $baseExtensionResource, array( |
52 | 52 | 'styles' => 'resources/embedPlayerIframe.css', |
53 | 53 | ) ), |
54 | | - 'ext.tmh.transcodetable' => array_merge($baseExtensionResource, array( |
| 54 | + 'ext.tmh.transcodetable' => array_merge( $baseExtensionResource, array( |
55 | 55 | 'scripts' => 'resources/ext.tmh.transcodetable.js', |
56 | 56 | 'styles' => 'resources/transcodeTable.css', |
57 | 57 | 'messages'=> array( |
— | — | @@ -61,13 +61,13 @@ |
62 | 62 | 'timedmedia-reset-confirm' |
63 | 63 | ) |
64 | 64 | ) ), |
65 | | - "mw.MediaWikiPlayerSupport" => array_merge($baseExtensionResource, array( |
| 65 | + "mw.MediaWikiPlayerSupport" => array_merge( $baseExtensionResource, array( |
66 | 66 | 'scripts' => 'resources/mw.MediaWikiPlayerSupport.js', |
67 | | - 'loaderScripts' => 'resources/mw.MediaWikiPlayer.loader.js', |
68 | | - 'dependencies'=> array( |
69 | | - 'mw.Api' |
70 | | - ) |
| 67 | + 'dependencies'=> array( 'mw.Api' ) |
71 | 68 | ) ), |
| 69 | + "mw.MediaWikiPlayer.loader" => array_merge( $baseExtensionResource, array( |
| 70 | + 'loaderScripts' => 'resources/mw.MediaWikiPlayer.loader.js', |
| 71 | + ) ), |
72 | 72 | ); |
73 | 73 | // Setup a hook for iframe embed handling: |
74 | 74 | $wgHooks['ArticleFromTitle'][] = 'TimedMediaIframeOutput::iframeHook'; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | // If the player is done loading ( does not guarantee playability ) |
156 | 156 | // for example if there is an error playerReady is still set to true once |
157 | 157 | // no more loading is to be done |
158 | | - 'playerReady' : false, |
| 158 | + 'playerReadyFlag' : false, |
159 | 159 | |
160 | 160 | // Stores the loading errors |
161 | 161 | 'loadError' : false, |
— | — | @@ -693,7 +693,7 @@ |
694 | 694 | // Hide / remove track container |
695 | 695 | _this.$interface.find( '.track' ).remove(); |
696 | 696 | // We have to re-bind hoverIntent ( has to happen in this scope ) |
697 | | - if( !this.useNativePlayerControls() && _this.controls && _this.controlBuilder.isOverlayControls() ){ |
| 697 | + if( ! _this.useNativePlayerControls() && _this.controls && _this.controlBuilder.isOverlayControls() ){ |
698 | 698 | _this.controlBuilder.showControlBar(); |
699 | 699 | _this.$interface.hoverIntent({ |
700 | 700 | 'sensitivity': 4, |
— | — | @@ -961,7 +961,7 @@ |
962 | 962 | }, 0); |
963 | 963 | |
964 | 964 | // Update the playerReady flag |
965 | | - this.playerReady = true; |
| 965 | + this.playerReadyFlag = true; |
966 | 966 | // trigger the player ready event; |
967 | 967 | $(this).trigger('playerReady'); |
968 | 968 | |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaElement.js |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | // Set via user-preference |
185 | 185 | $.each( playableSources, function( inx, source ){ |
186 | 186 | var mimeType =source.mimeType; |
187 | | - if ( mw.EmbedTypes.getMediaPlayers().preference[ 'format_preference' ] == mimeType ) { |
| 187 | + if ( $.cookie( 'EmbedPlayer.FormatPreference' ) == mimeType ) { |
188 | 188 | mw.log( 'MediaElement::autoSelectSource: Set via preference: ' + source.mimeType ); |
189 | 189 | return setSelectedSource( source ); |
190 | 190 | } |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css |
— | — | @@ -104,10 +104,12 @@ |
105 | 105 | top: 0; |
106 | 106 | width: 8px; |
107 | 107 | cursor: pointer; |
108 | | - -moz-border-radius:5px 5px 5px 5px; |
| 108 | + -moz-border-radius:5px 5px 5px 5px !important; |
| 109 | + border-radius:5px 5px 5px 5px !important; |
109 | 110 | } |
110 | 111 | .k-player .ui-corner-all { |
111 | | - -moz-border-radius:5px 5px 5px 5px; |
| 112 | + -moz-border-radius:5px 5px 5px 5px !important; |
| 113 | + border-radius:5px 5px 5px 5px !important; |
112 | 114 | } |
113 | 115 | .k-player .time-disp { |
114 | 116 | border: medium none; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/mw.PlayerSkinKskin.js |
— | — | @@ -59,7 +59,6 @@ |
60 | 60 | 'top' : '0px', |
61 | 61 | 'bottom' : ( ctrlObj.getHeight() + 2 ) + 'px' |
62 | 62 | } ); |
63 | | - |
64 | 63 | // Note safari can't display video overlays with text: |
65 | 64 | // see bug https://bugs.webkit.org/show_bug.cgi?id=48379 |
66 | 65 | |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js |
— | — | @@ -28,6 +28,12 @@ |
29 | 29 | |
30 | 30 | // Default control bar height |
31 | 31 | height: mw.getConfig( 'EmbedPlayer.ControlsHeight' ), |
| 32 | + |
| 33 | + // Minimal width for interface overlay: |
| 34 | + minInterfaceWidth: 300, |
| 35 | + |
| 36 | + // Minimal height for interface overlay: |
| 37 | + minInterfaceHeight: 200, |
32 | 38 | |
33 | 39 | // Default supported components is merged with embedPlayer set of supported types |
34 | 40 | supportedComponents: { |
— | — | @@ -69,14 +75,11 @@ |
70 | 76 | */ |
71 | 77 | init: function( embedPlayer ) { |
72 | 78 | this.embedPlayer = embedPlayer; |
73 | | - |
74 | 79 | // Check for skin overrides for controlBuilder |
75 | 80 | var skinClass = embedPlayer.skinName.substr(0,1).toUpperCase() + embedPlayer.skinName.substr( 1 ); |
76 | 81 | if ( mw['PlayerSkin' + skinClass ] ) { |
77 | | - |
78 | | - // Clone as to not override prototype with the skin config |
79 | | - var _this = $.extend( true, { }, this, mw['PlayerSkin' + skinClass ] ); |
80 | | - return _this; |
| 82 | + // Clone as to not override prototype with the skin overrides |
| 83 | + return $.extend( true, { }, this, mw['PlayerSkin' + skinClass ] );; |
81 | 84 | } |
82 | 85 | // Return the controlBuilder Object: |
83 | 86 | return this; |
— | — | @@ -87,12 +90,6 @@ |
88 | 91 | * @return {Number} control bar height |
89 | 92 | */ |
90 | 93 | getHeight: function(){ |
91 | | - // Check if the configuration was updated |
92 | | - // Probably will break things to set control bar height config late |
93 | | - // but try to support it anyway |
94 | | - if( mw.getConfig( 'EmbedPlayer.ControlsHeight' ) != this.height ){ |
95 | | - this.height = mw.getConfig( 'EmbedPlayer.ControlsHeight' ) ; |
96 | | - } |
97 | 94 | return this.height; |
98 | 95 | }, |
99 | 96 | |
— | — | @@ -339,9 +336,8 @@ |
340 | 337 | * doFullScreenPlayer to enable fullscreen mode |
341 | 338 | * restoreWindowPlayer to restore window mode |
342 | 339 | */ |
343 | | - toggleFullscreen: function( forceClose ) { |
| 340 | + toggleFullscreen: function( ) { |
344 | 341 | var _this = this; |
345 | | - |
346 | 342 | // Do normal in-page fullscreen handling: |
347 | 343 | if( this.fullscreenMode ){ |
348 | 344 | this.restoreWindowPlayer(); |
— | — | @@ -710,14 +706,16 @@ |
711 | 707 | * Get minimal width for interface overlay |
712 | 708 | */ |
713 | 709 | getOverlayWidth: function( ) { |
714 | | - return ( this.embedPlayer.getPlayerWidth() < 300 )? 300 : this.embedPlayer.getPlayerWidth(); |
| 710 | + return ( this.embedPlayer.getPlayerWidth() < this.minInterfaceWidth ) ? |
| 711 | + this.minInterfaceWidth : this.embedPlayer.getPlayerWidth(); |
715 | 712 | }, |
716 | 713 | |
717 | 714 | /** |
718 | 715 | * Get minimal height for interface overlay |
719 | 716 | */ |
720 | 717 | getOverlayHeight: function( ) { |
721 | | - return ( this.embedPlayer.getPlayerHeight() < 200 )? 200 : this.embedPlayer.getPlayerHeight(); |
| 718 | + return ( this.embedPlayer.getPlayerHeight() < this.minInterfaceHeight )? |
| 719 | + this.minInterfaceHeight : this.embedPlayer.getPlayerHeight(); |
722 | 720 | }, |
723 | 721 | |
724 | 722 | /** |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | var areSelectedPlayersReady = function(){ |
15 | 15 | var playersLoaded = true; |
16 | 16 | $(playerSelect).each(function(inx, player){ |
17 | | - if( ! $( player ).get(0).playerReady ){ |
| 17 | + if( ! $( player ).get(0).playerReadyFlag ){ |
18 | 18 | playersLoaded = false; |
19 | 19 | return false; |
20 | 20 | } |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaPlayers.js |
— | — | @@ -15,9 +15,6 @@ |
16 | 16 | // The list of players supported |
17 | 17 | players : null, |
18 | 18 | |
19 | | - // Store per mime-type prefrences for players |
20 | | - preference : { }, |
21 | | - |
22 | 19 | // Stores the default set of players for a given mime type |
23 | 20 | defaultPlayers : { }, |
24 | 21 | |
— | — | @@ -27,7 +24,6 @@ |
28 | 25 | */ |
29 | 26 | init: function() { |
30 | 27 | this.players = new Array(); |
31 | | - this.loadPreferences(); |
32 | 28 | |
33 | 29 | // set up default players order for each library type |
34 | 30 | this.defaultPlayers['video/x-flv'] = ['Kplayer', 'Vlc']; |
— | — | @@ -61,8 +57,6 @@ |
62 | 58 | return ; |
63 | 59 | } |
64 | 60 | } |
65 | | - |
66 | | - |
67 | 61 | // Add the player: |
68 | 62 | this.players.push( player ); |
69 | 63 | }, |
— | — | @@ -116,8 +110,10 @@ |
117 | 111 | { |
118 | 112 | // Check for prior preference for this mime type |
119 | 113 | for ( var i = 0; i < mimePlayers.length; i++ ) { |
120 | | - if ( mimePlayers[i].id == this.preference[mimeType] ) |
| 114 | + if ( mimePlayers[i].id == $.cookie( 'EmbedPlayer.PlayerPreference.' + mimeType ) ){ |
| 115 | + mw.log( "mw.MediaPlayers:: setPlayer via cookie:: " + mimeType + ' playerId: ' + mimePlayers[i].id ); |
121 | 116 | return mimePlayers[i]; |
| 117 | + } |
122 | 118 | } |
123 | 119 | // Otherwise just return the first compatible player |
124 | 120 | // (it will be chosen according to the defaultPlayers list |
— | — | @@ -134,8 +130,7 @@ |
135 | 131 | * mimeFormat Prefered format |
136 | 132 | */ |
137 | 133 | setFormatPreference : function ( mimeFormat ) { |
138 | | - this.preference['formatPreference'] = mimeFormat; |
139 | | - $.cookie( 'EmbedPlayer.Preference', JSON.stringify( this.preference) ); |
| 134 | + $.cookie( 'EmbedPlayer.FormatPreference', mimeFormat ); |
140 | 135 | }, |
141 | 136 | |
142 | 137 | /** |
— | — | @@ -152,11 +147,14 @@ |
153 | 148 | if ( this.players[i].id == playerId ) { |
154 | 149 | selectedPlayer = this.players[i]; |
155 | 150 | mw.log( 'EmbedPlayer::setPlayerPreference: choosing ' + playerId + ' for ' + mimeType ); |
156 | | - this.preference[ mimeType ] = playerId; |
157 | | - $.cookie( 'EmbedPlayer.Preference', JSON.stringify( this.preference ) ); |
| 151 | + // Update the reference cookie |
| 152 | + $.cookie( 'EmbedPlayer.PlayerPreference.' + mimeType, playerId); |
158 | 153 | break; |
159 | 154 | } |
160 | 155 | } |
| 156 | + // Also update the format Preference: |
| 157 | + this.setFormatPreference( mimeType ); |
| 158 | + |
161 | 159 | // Update All the player instances on the page |
162 | 160 | if ( selectedPlayer ) { |
163 | 161 | $('.mwEmbedPlayer').each(function(inx, playerTarget ){ |
— | — | @@ -168,17 +166,6 @@ |
169 | 167 | } |
170 | 168 | }); |
171 | 169 | } |
172 | | - }, |
173 | | - |
174 | | - /** |
175 | | - * Loads the user preference settings from a cookie |
176 | | - */ |
177 | | - loadPreferences : function ( ) { |
178 | | - this.preference = { }; |
179 | | - // See if we have a cookie set to a clientSupported type: |
180 | | - if( $.cookie( 'EmbedPlayer.Preference' ) ) { |
181 | | - this.preference = JSON.parse( $.cookie( 'EmbedPlayer.Preference' ) ); |
182 | | - } |
183 | 170 | } |
184 | 171 | }; |
185 | 172 | |
Index: trunk/extensions/TimedMediaHandler/resources/mw.MediaWikiPlayer.loader.js |
— | — | @@ -5,5 +5,4 @@ |
6 | 6 | $.merge( dependencySet, ['mw.MediaWikiPlayerSupport'] ); |
7 | 7 | } |
8 | 8 | }); |
9 | | - |
10 | 9 | } )( window.mediaWiki, jQuery ); |
\ No newline at end of file |
Index: trunk/extensions/TimedMediaHandler/resources/mw.MediaWikiPlayerSupport.js |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | * |
107 | 107 | * TODO parse the resource page template |
108 | 108 | * |
109 | | - * @parm {String} resourceHTML Resource wiki text page contents |
| 109 | + * @param {String} resourceHTML Resource wiki text page contents |
110 | 110 | */ |
111 | 111 | function doCreditLine( resourceHTML, articleUrl ){ |
112 | 112 | // Get the title string ( again a "Title" like js object could help out here. ) |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery/jquery.mwEmbedUtil.js |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Shortcut to a themed button Should be depreciated for $.button |
27 | | - * bellow |
| 27 | + * below |
28 | 28 | */ |
29 | 29 | $.btnHtml = function( msg, styleClass, iconId, opt ) { |
30 | 30 | if ( !opt ) |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php |
— | — | @@ -15,15 +15,13 @@ |
16 | 16 | 'messageFile' => 'MwEmbedSupport.i18n.php', |
17 | 17 | ), |
18 | 18 | "jquery.loadingSpinner" => array( |
19 | | - 'scripts' => 'jquery.loadingSpinner/jquery.loadingSpinner.js', |
20 | | - 'styles' => 'jquery.loadingSpinner/loadingSpinner.css' |
| 19 | + 'scripts' => array( |
| 20 | + 'jquery.loadingSpinner/spinner.js', |
| 21 | + 'jquery.loadingSpinner/jquery.loadingSpinner.js', |
| 22 | + ) |
21 | 23 | ), |
22 | 24 | 'mw.MwEmbedSupport.style' => array( |
23 | | - // NOTE we add the loadingSpinner.css as a work around to the resource loader register |
24 | | - // of modules as "ready" even though only the "script" part of the module was included. |
25 | | - 'styles'=> array( 'skins/common/MwEmbedCommonStyle.css', |
26 | | - 'jquery.loadingSpinner/loadingSpinner.css' |
27 | | - ), |
| 25 | + 'styles'=> array( 'skins/common/MwEmbedCommonStyle.css' ), |
28 | 26 | 'skinStyles' => array( |
29 | 27 | /* shared jQuery ui skin styles */ |
30 | 28 | 'darkness' => 'skins/jquery.ui.themes/darkness/jquery-ui-1.7.2.css', |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/loadingSpinner.css |
— | — | @@ -1,9 +0,0 @@ |
2 | | -.loadingSpinner { |
3 | | - background-image: url('loadingDots.png'); |
4 | | - width: 32px; |
5 | | - height: 32px; |
6 | | -} |
7 | | -.absoluteOverlaySpinner { |
8 | | - position : absolute; |
9 | | - z-index: 3; |
10 | | -} |
\ No newline at end of file |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/loadingSpokes.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/loadingDots.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/jquery.loadingSpinner.js |
— | — | @@ -2,26 +2,50 @@ |
3 | 3 | /** |
4 | 4 | * Set a given selector html to the loading spinner: |
5 | 5 | */ |
6 | | - $.fn.loadingSpinner = function( ) { |
7 | | - var _this = this; |
8 | | - if ( _this ) { |
9 | | - $( _this ).html( |
10 | | - $( '<div />' ) |
11 | | - .addClass( "loadingSpinner" ) |
12 | | - ); |
13 | | - var i =0; |
14 | | - var interval = setInterval( function(){ |
15 | | - if( _this && $( _this ).find('.loadingSpinner').length ){ |
16 | | - var offset = i*32; |
17 | | - $( _this ).find('.loadingSpinner').css('background-position','0 ' + offset + 'px'); |
18 | | - if(i >= 7) i = 0; |
19 | | - i++; |
20 | | - } else { |
21 | | - clearInterval( interval ); |
| 6 | + $.fn.loadingSpinner = function( options ) { |
| 7 | + // empty the target: |
| 8 | + $(this).empty(); |
| 9 | + |
| 10 | + // If we have LoadingSpinner.ImageUrl use that: |
| 11 | + if( mw.getConfig('LoadingSpinner.ImageUrl') ) { |
| 12 | + this.each(function() { |
| 13 | + var $this = $(this).empty(); |
| 14 | + var thisSpinner = $this.data('spinner'); |
| 15 | + if (thisSpinner) { |
| 16 | + $this.data('spinner', null); |
| 17 | + delete thisSpinner; |
22 | 18 | } |
23 | | - }, 70 ); |
| 19 | + if (opts !== false) { |
| 20 | + var $loadingSpinner = $('<img />').attr("src", mw.getConfig('LoadingSpinner.ImageUrl')).load(function() { |
| 21 | + // Set spinner position based on image dimension |
| 22 | + $( this ).css({ |
| 23 | + 'margin-top': '-' + (this.height/2) + 'px', |
| 24 | + 'margin-left': '-' + (this.width/2) + 'px' |
| 25 | + }); |
| 26 | + }); |
| 27 | + thisSpinner = $this.append($loadingSpinner); |
| 28 | + } |
| 29 | + }); |
| 30 | + return this; |
24 | 31 | } |
25 | | - return _this; |
| 32 | + |
| 33 | + // Else, use Spin.js |
| 34 | + if(!options) |
| 35 | + options = {}; |
| 36 | + options = $.extend( {'color' : '#eee', 'shadow': true }, options); |
| 37 | + this.each(function() { |
| 38 | + var $this = $(this).empty(); |
| 39 | + var thisSpinner = $this.data('spinner'); |
| 40 | + if (thisSpinner) { |
| 41 | + thisSpinner.stop(); |
| 42 | + delete thisSpinner; |
| 43 | + } |
| 44 | + if (options !== false) { |
| 45 | + thisSpinner = new Spinner($.extend({color: $this.css('color')}, options)).spin(this); |
| 46 | + } |
| 47 | + }); |
| 48 | + // correct the position: |
| 49 | + return this; |
26 | 50 | }; |
27 | 51 | /** |
28 | 52 | * Add an absolute overlay spinner useful for cases where the |
— | — | @@ -40,7 +64,8 @@ |
41 | 65 | var $spinner = $('<div />') |
42 | 66 | .addClass('absoluteOverlaySpinner') |
43 | 67 | .loadingSpinner() |
44 | | - .css({ |
| 68 | + .css({ |
| 69 | + 'position' : 'absolute', |
45 | 70 | 'top' : posTop + 'px', |
46 | 71 | 'left' : posLeft + 'px' |
47 | 72 | }); |
— | — | @@ -48,4 +73,5 @@ |
49 | 74 | return $spinner; |
50 | 75 | }; |
51 | 76 | |
52 | | -} )( jQuery ); |
\ No newline at end of file |
| 77 | +} )( jQuery ); |
| 78 | + |