Index: trunk/extensions/TimedMediaHandler/handlers/TextHandler/TextHandler.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | * Timed text support is presently fairly limited. Unlike Ogg and WebM handlers, |
7 | 7 | * timed text does not extend the TimedMediaHandler class. |
8 | 8 | * |
9 | | - * TODO On "new" timedtext laguage save purge all pages where file exists |
| 9 | + * TODO On "new" timedtext language save purge all pages where file exists |
10 | 10 | */ |
11 | 11 | class TextHandler { |
12 | 12 | |
— | — | @@ -84,6 +84,7 @@ |
85 | 85 | wfDebug("Get text tracks from remote api \n"); |
86 | 86 | $query = $this->getTextPagesQuery(); |
87 | 87 | |
| 88 | + |
88 | 89 | // Error in getting timed text namespace return empty array; |
89 | 90 | if( $query === false ){ |
90 | 91 | return array(); |
— | — | @@ -92,7 +93,7 @@ |
93 | 94 | if ( $data && $this->file->repo->descriptionCacheExpiry > 0 ) { |
94 | 95 | $wgMemc->set( $key, $data, $this->file->repo->descriptionCacheExpiry ); |
95 | 96 | } |
96 | | - return $this->getTextTracksFromData( $data ); |
| 97 | + return $this->getTextTracksFromData( $data ); |
97 | 98 | } |
98 | 99 | function getLocalTextSources(){ |
99 | 100 | global $wgServer, $wgScriptPath; |
— | — | @@ -110,11 +111,10 @@ |
111 | 112 | |
112 | 113 | $textTracks = array(); |
113 | 114 | $providerName = $this->file->repo->getName(); |
114 | | - // For a while commons repo in the manual was named "shared" if commons fix name |
| 115 | + // For a while commons repo in the mediaWiki manual was called "shared" |
115 | 116 | // ( we need commons to be named "commons" so that the javascript api provider names match up ) |
116 | 117 | if( $providerName == 'shared' ){ |
117 | 118 | // We could alternatively check $this->file->repo->mApiBase |
118 | | - // ( but really we should add a getter ) |
119 | 119 | foreach( $wgForeignFileRepos as $repo ){ |
120 | 120 | if( $repo['name'] == $this->file->repo->getName() |
121 | 121 | && |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | 'data-mwtitle' => $namespacePrefix . $subTitle->getDBkey(), |
151 | 151 | 'data-mwprovider' => $providerName, |
152 | 152 | 'type' => 'text/x-srt', |
153 | | - // TODO Should add a special entry point and output proper WebVTT format: |
| 153 | + // TODO Should eventually add special entry point and output proper WebVTT format: |
154 | 154 | // http://www.whatwg.org/specs/web-apps/current-work/webvtt.html |
155 | 155 | 'src' => $subTitle->getFullURL( array( |
156 | 156 | 'action' => 'raw', |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.php |
— | — | @@ -50,10 +50,9 @@ |
51 | 51 | // Location of the FFmpeg binary ( used to encode WebM and for thumbnails ) |
52 | 52 | $wgFFmpegLocation = '/usr/bin/ffmpeg'; |
53 | 53 | |
54 | | -// The NS for TimedText ( registerd on mediawiki.org ) |
| 54 | +// The NS for TimedText ( registered on mediawiki.org ) |
55 | 55 | // http://www.mediawiki.org/wiki/Extension_namespace_registration |
56 | | -// Note commons pre-dates TimedMediaHandler and should add $wgTimedTextNS = 102 per |
57 | | -// their local settings config |
| 56 | +// Note commons pre-dates TimedMediaHandler and should set $wgTimedTextNS = 102 in localSettings.php |
58 | 57 | $wgTimedTextNS = 700; |
59 | 58 | |
60 | 59 | /** |
Index: trunk/extensions/TimedMediaHandler/ApiQueryVideoInfo.php |
— | — | @@ -2,7 +2,9 @@ |
3 | 3 | /** |
4 | 4 | * Extends imageinfo with support for videoinfo sources property. |
5 | 5 | * |
6 | | - * Alternativly core ApiQueryImageInfo could support being extended in obvious ways. |
| 6 | + * Alternatively core ApiQueryImageInfo could support being extended in some straightforward ways. |
| 7 | + * see: http://www.mediawiki.org/wiki/User:Catrope/Extension_review/TimedMediaHandler#ApiQueryVideoInfo.php |
| 8 | + * |
7 | 9 | */ |
8 | 10 | class ApiQueryVideoInfo extends ApiQueryImageInfo { |
9 | 11 | |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php |
— | — | @@ -11,8 +11,8 @@ |
12 | 12 | // Register TimedMediaHandler Hooks |
13 | 13 | static function register(){ |
14 | 14 | global $wgParserOutputHooks, $wgHooks, $wgJobClasses, $wgJobTypesExcludedFromDefaultQueue, |
15 | | - $wgMediaHandlers, $wgResourceModules, $wgExcludeFromThumbnailPurge, |
16 | | - $tmhFileExtensions, $wgParserOutputHooks, $wgOut, $wgAPIPropModules; |
| 15 | + $wgMediaHandlers, $wgResourceModules, $wgExcludeFromThumbnailPurge, $wgExtraNamespaces, |
| 16 | + $tmhFileExtensions, $wgParserOutputHooks, $wgOut, $wgAPIPropModules, $wgTimedTextNS; |
17 | 17 | |
18 | 18 | // Setup media Handlers: |
19 | 19 | $wgMediaHandlers['application/ogg'] = 'OggHandler'; |
— | — | @@ -67,13 +67,13 @@ |
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Add support for the "TimedText" NameSpace |
71 | | - */ |
72 | | - global $wgExtraNamespaces; |
73 | | - $wgTimedTextNS = null; |
74 | | - |
| 71 | + */ |
75 | 72 | define( "NS_TIMEDTEXT", $wgTimedTextNS); |
76 | 73 | define( "NS_TIMEDTEXT_TALK", $wgTimedTextNS +1); |
77 | 74 | |
| 75 | + $wgExtraNamespaces[NS_TIMEDTEXT] = "TimedText"; |
| 76 | + $wgExtraNamespaces[NS_TIMEDTEXT_TALK] = "TimedText_talk"; |
| 77 | + |
78 | 78 | return true; |
79 | 79 | } |
80 | 80 | static function pageOutputHook( &$out, &$sk ){ |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/resources/mw.TimedText.js |
— | — | @@ -635,6 +635,7 @@ |
636 | 636 | * Layout |
637 | 637 | * Bellow video |
638 | 638 | * Ontop video ( only available to supported plugins ) |
| 639 | + * TODO features: |
639 | 640 | * [ Search Text ] |
640 | 641 | * [ This video ] |
641 | 642 | * [ All videos ] |
— | — | @@ -642,8 +643,7 @@ |
643 | 644 | */ |
644 | 645 | getMainMenu: function() { |
645 | 646 | var _this = this; |
646 | | - |
647 | | - |
| 647 | + |
648 | 648 | // Build the source list menu item: |
649 | 649 | $menu = $( '<ul>' ); |
650 | 650 | // Show text menu item ( if there are sources) |
— | — | @@ -835,7 +835,7 @@ |
836 | 836 | }, |
837 | 837 | |
838 | 838 | /** |
839 | | - * Get lagnuage name from language key |
| 839 | + * Get language name from language key |
840 | 840 | * @param {String} lang_key Language key |
841 | 841 | */ |
842 | 842 | getLanguageName: function( lang_key ) { |
— | — | @@ -1493,6 +1493,7 @@ |
1494 | 1494 | * |
1495 | 1495 | |
1496 | 1496 | // Will add a base class once we are serving more than just mediaWiki "commons" |
| 1497 | + // also we should segment out these files |
1497 | 1498 | mw.BaseTextProvider = function() { |
1498 | 1499 | return this.init(); |
1499 | 1500 | } |