Index: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | } |
58 | 58 | |
59 | 59 | function getTagName(){ |
60 | | - return ( $this->isVideo )? 'video' : 'audio'; |
| 60 | + return ( $this->isVideo ) ? 'video' : 'audio'; |
61 | 61 | } |
62 | 62 | |
63 | 63 | function toHtml( $options = array() ) { |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/TimedText.config.php |
— | — | @@ -12,9 +12,10 @@ |
13 | 13 | "TimedText.ShowInterface" => "auto", |
14 | 14 | |
15 | 15 | /** |
16 | | - * If the "add timed text" link / interface should be exposed |
| 16 | + * If the "add timed text" link / interface should be exposed |
| 17 | + * allows usere to upload text files to the wiki |
17 | 18 | */ |
18 | | - 'TimedText.showAddTextLink' => true, |
| 19 | + 'TimedText.showAddTextLink' => false, |
19 | 20 | |
20 | 21 | // The category for listing videos that need transcription: |
21 | 22 | 'TimedText.NeedsTranscriptCategory' => 'Videos needing subtitles' |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/TimedText.loader.js |
— | — | @@ -19,23 +19,20 @@ |
20 | 20 | } ); |
21 | 21 | |
22 | 22 | /** |
23 | | - * Check if we should load the timedText interface or not. |
| 23 | + * Check timedText is active for a given embedPlayer |
| 24 | + * @param {object} embedPlayer The player to be checked for timedText properties |
24 | 25 | */ |
25 | 26 | mw.isTimedTextSupported = function( embedPlayer ) { |
26 | 27 | if( mw.getConfig( 'TimedText.ShowInterface' ) == 'always' ) { |
27 | 28 | return true; |
28 | 29 | } |
29 | | - // Do a module check for timed Text support ( note this module check is synchronous ) |
30 | | - var supportsTimedText = false; |
31 | | - $( embedPlayer ).trigger('SupportsTimedText', function( moduleSupportsTimedText) { |
32 | | - if( moduleSupportsTimedText ){ |
33 | | - supportsTimedText = true; |
34 | | - } |
35 | | - }); |
| 30 | + // Do a module check for timed Text support ( module must add data property 'SupportsTimedText' ) |
| 31 | + $( embedPlayer ).trigger('SupportsTimedText' ); |
36 | 32 | |
37 | | - if( supportsTimedText ){ |
| 33 | + if( $( embedPlayer ).data( 'SupportsTimedText' ) ){ |
38 | 34 | return true; |
39 | 35 | } |
| 36 | + |
40 | 37 | // Check for standard 'track' attribute: |
41 | 38 | if ( $( embedPlayer ).find( 'track' ).length != 0 ) { |
42 | 39 | return true; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/resources/mw.TimedText.js |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | } |
130 | 130 | |
131 | 131 | // Load user preferences config: |
132 | | - var preferenceConfig = $.cookie( 'TimedText.Prefrences' ); |
| 132 | + var preferenceConfig = $.cookie( 'TimedText.Preferences' ); |
133 | 133 | if( preferenceConfig !== null ) { |
134 | 134 | this.config = JSON.parse( preferenceConfig ); |
135 | 135 | } |
— | — | @@ -762,14 +762,15 @@ |
763 | 763 | showTimedTextEditUI: function( mode ) { |
764 | 764 | var _this = this; |
765 | 765 | // Show a loader: |
766 | | - mw.addLoaderDialog( gM( 'mwe-timedtext-loading-text-edit' )); |
| 766 | + mw.addLoaderDialog( gM( 'mwe-timedtext-loading-text-edit' ) ); |
767 | 767 | // Load the timedText edit interface |
768 | | - mw.load( 'TimedText.Edit', function() { |
| 768 | + mw.load( 'mw.TimedTextEdit', function() { |
769 | 769 | if( ! _this.editText ) { |
770 | 770 | _this.editText = new mw.TimedTextEdit( _this ); |
771 | 771 | } |
772 | 772 | // Close the loader: |
773 | 773 | mw.closeLoaderDialog(); |
| 774 | + // Show the upload text ui: |
774 | 775 | _this.editText.showUI(); |
775 | 776 | }); |
776 | 777 | }, |
— | — | @@ -869,8 +870,8 @@ |
870 | 871 | var _this = this; |
871 | 872 | if( layoutMode != _this.config.layout ) { |
872 | 873 | // Update the config and redraw layout |
873 | | - _this.config.layout = layoutMode; |
874 | | - |
| 874 | + _this.config.layout = layoutMode; |
| 875 | + |
875 | 876 | // Update the display: |
876 | 877 | _this.updateLayout(); |
877 | 878 | } |
— | — | @@ -880,7 +881,7 @@ |
881 | 882 | * Updates the timed text layout ( should be called when config.layout changes ) |
882 | 883 | */ |
883 | 884 | updateLayout: function() { |
884 | | - var $playerTarget = this.embedPlayer.$interface; |
| 885 | + var $playerTarget = this.embedPlayer.$interface; |
885 | 886 | $playerTarget.find('.track').remove(); |
886 | 887 | this.refreshDisplay(); |
887 | 888 | }, |
— | — | @@ -935,15 +936,17 @@ |
936 | 937 | */ |
937 | 938 | refreshDisplay: function() { |
938 | 939 | // Update the configuration object |
939 | | - $.cookie( 'TimedText.Prefrences', JSON.stringify( this.config ) ); |
| 940 | + $.cookie( 'TimedText.Preferences', JSON.stringify( this.config ) ); |
940 | 941 | |
941 | 942 | // Empty out previous text to force an interface update: |
942 | 943 | this.prevText = []; |
| 944 | + |
943 | 945 | // Refresh the Menu (if it has a target to refresh) |
944 | 946 | if( this.menuTarget ) { |
945 | 947 | mw.log('bind menu refresh display'); |
946 | 948 | this.bindMenu( this.menuTarget, false ); |
947 | 949 | } |
| 950 | + |
948 | 951 | // Issues a "monitor" command to update the timed text for the new layout |
949 | 952 | this.monitor(); |
950 | 953 | }, |
— | — | @@ -1012,9 +1015,11 @@ |
1013 | 1016 | } |
1014 | 1017 | |
1015 | 1018 | //Add in the "add text" to the end of the interface: |
1016 | | - $langMenu.append( |
1017 | | - _this.getLiAddText() |
1018 | | - ); |
| 1019 | + if( mw.getConfig( 'TimedText.ShowAddTextLink' ) && _this.embedPlayer.apiTitleKey ){ |
| 1020 | + $langMenu.append( |
| 1021 | + _this.getLiAddText() |
| 1022 | + ); |
| 1023 | + } |
1019 | 1024 | |
1020 | 1025 | return $langMenu; |
1021 | 1026 | }, |
— | — | @@ -1101,7 +1106,12 @@ |
1102 | 1107 | 'height' : this.embedPlayer.getHeight() |
1103 | 1108 | }) |
1104 | 1109 | ); |
1105 | | - |
| 1110 | + // Resize the interface for layoutMode == 'below' ( if not in full screen) |
| 1111 | + if( ! this.embedPlayer.controlBuilder.fullscreenMode ){ |
| 1112 | + this.embedPlayer.$interface.animate({ |
| 1113 | + 'height': this.embedPlayer.getHeight() |
| 1114 | + }); |
| 1115 | + } |
1106 | 1116 | $playerTarget.append( $track ); |
1107 | 1117 | |
1108 | 1118 | } else if ( layoutMode == 'below') { |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/resources/mw.TimedTextEdit.js |
— | — | @@ -2,33 +2,7 @@ |
3 | 3 | * Timed text edit interface based off of participatory culture foundation timed text mockups. |
4 | 4 | */ |
5 | 5 | ( function( mw, $ ) { |
6 | | -mw.addMessages( { |
7 | | - "mwe-timedtext-editor" : "Timed text editor", |
8 | | - "mwe-timedtext-stage-transcribe" : "Transcribe", |
9 | | - "mwe-timedtext-stage-sync" : "Sync", |
10 | | - "mwe-timedtext-stage-translate" : "Translate", |
11 | | - "mwe-timedtext-stage-upload" : "Upload from local file", |
12 | 6 | |
13 | | - "mwe-timedtext-select-language": "Select language", |
14 | | - "mwe-timedtext-file-language": "Subtitle file language", |
15 | | - |
16 | | - "mwe-timedtext-upload-text": "Upload text file", |
17 | | - "mwe-timedtext-uploading-text": "Uploading text file", |
18 | | - "mwe-timedtext-upload-text-desc-title": "Upload a text file", |
19 | | - "mwe-timedtext-upload-text-desc-help": "The upload text file interface accepts .srt files", |
20 | | - "mwe-timedtext-upload-text-desc-help-browse": "Browse your local computer for the srt file you want to upload", |
21 | | - "mwe-timedtext-upload-text-desc-help-select" : "Select the language of the file", |
22 | | - "mwe-timedtext-upload-text-desc-help-review" : "Review / edit the text content and then press upload to add the text", |
23 | | - "mwe-timedtext-upload-text-preview" : "Review text", |
24 | | - |
25 | | - "mwe-timedtext-upload-text-success" : "Upload of timed text was successful", |
26 | | - "mwe-timedtext-upload-text-done" : "Upload done", |
27 | | - "mwe-timedtext-upload-text-fail-desc" : "Upload was unsuccessful", |
28 | | - "mwe-timedtext-upload-text-fail-title" : "Upload failed", |
29 | | - "mwe-timedtext-upload-text-another" : "Upload another", |
30 | | - "mwe-timedtext-upload-text-done-uploading" : "Done uploading" |
31 | | -} ); |
32 | | - |
33 | 7 | mw.TimedTextEdit = function( parentTimedText ) { |
34 | 8 | return this.init( parentTimedText ); |
35 | 9 | }; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/mw.PlayerSkinKskin.js |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | $menuBar = $( '<ul />' ) |
93 | 93 | .addClass( 'k-menu-bar' ); |
94 | 94 | |
95 | | - // dont include about player menu item ( FIXME should be moved to a init function ) |
| 95 | + // Don't include about player menu item ( FIXME should be moved to a init function ) |
96 | 96 | delete ctrlObj.supportedMenuItems['aboutPlayerLibrary']; |
97 | 97 | |
98 | 98 | // Output menu item containers: |
— | — | @@ -231,9 +231,14 @@ |
232 | 232 | .text ( gM( 'mwe-embedplayer-close_btn' ) ); |
233 | 233 | } ); |
234 | 234 | this.$playerTarget.find( '.play-btn-large' ).fadeOut( 'fast' ); |
| 235 | + |
| 236 | + $( this.embedPlayer ).trigger( 'displayMenuOverlay' ); |
235 | 237 | |
236 | | - $(this.embedPlayer).trigger( 'displayMenuOverlay' ); |
237 | | - |
| 238 | + // By default show the credits ( if nothing else is displayed ) |
| 239 | + if( this.$playerTarget.find( '.menu-screen :visible' ).length == 0 ){ |
| 240 | + this.showMenuItem( 'credits' ); |
| 241 | + } |
| 242 | + |
238 | 243 | // Set the Options Menu display flag to true: |
239 | 244 | this.keepControlBarOnScreen = true; |
240 | 245 | }, |
— | — | @@ -268,7 +273,7 @@ |
269 | 274 | // Grab the context from the "clicked" menu item |
270 | 275 | var mk = $( this ).attr( 'rel' ); |
271 | 276 | |
272 | | - // hide all menu items |
| 277 | + // get the target iitem |
273 | 278 | $targetItem = $playerTarget.find( '.menu-' + mk ); |
274 | 279 | |
275 | 280 | // call the function showMenuItem |
— | — | @@ -369,7 +374,7 @@ |
370 | 375 | |
371 | 376 | // Allow modules to load and add credits |
372 | 377 | $( embedPlayer ).triggerQueueCallback( 'ShowCredits', $creditsTarget, function( status ){ |
373 | | - // Check if the first ShowCredits binding returned false: |
| 378 | + // If no module is showing credits add no-video credits msg: |
374 | 379 | if( !status || status[0] == false ){ |
375 | 380 | $creditsTarget.text( |
376 | 381 | gM('mwe-embedplayer-no-video_credits') |