Index: branches/MwEmbedStandAlone/mwEmbed.i18n.php |
— | — | @@ -495,6 +495,13 @@ |
496 | 496 | 'mwe-loading_txt' => 'A caria ...', |
497 | 497 | ); |
498 | 498 | |
| 499 | +/** Pashto (پښتو) |
| 500 | + * @author Ahmed-Najib-Biabani-Ibrahimkhel |
| 501 | + */ |
| 502 | +$messages['ps'] = array( |
| 503 | + 'mwe-ok' => 'ښه', |
| 504 | +); |
| 505 | + |
499 | 506 | /** Portuguese (Português) |
500 | 507 | * @author Hamilton Abreu |
501 | 508 | * @author Malafaya |
— | — | @@ -536,6 +543,16 @@ |
537 | 544 | 'mwe-error_load_lib' => 'Error: JavaScript $1 nebolo možné získať alebo neobsahuje definíciu $2', |
538 | 545 | ); |
539 | 546 | |
| 547 | +/** Serbian Cyrillic ekavian (Српски (ћирилица)) |
| 548 | + * @author Михајло Анђелковић |
| 549 | + */ |
| 550 | +$messages['sr-ec'] = array( |
| 551 | + 'mwe-loading_txt' => 'Учитавање ...', |
| 552 | + 'mwe-ok' => 'ОК', |
| 553 | + 'mwe-cancel' => 'Поништи', |
| 554 | + 'mwe-test-plural' => 'Покренуо/ла сам {{PLURAL:$1|$1 тест|$1 тестова}}', |
| 555 | +); |
| 556 | + |
540 | 557 | /** Swedish (Svenska) |
541 | 558 | * @author Dafer45 |
542 | 559 | * @author GameOn |
— | — | @@ -558,7 +575,7 @@ |
559 | 576 | * @author AnakngAraw |
560 | 577 | */ |
561 | 578 | $messages['tl'] = array( |
562 | | - 'mwe-loading_txt' => 'Ikinakarga ...', |
| 579 | + 'mwe-loading_txt' => 'Ikinakarga...', |
563 | 580 | 'mwe-error_load_lib' => 'Kamalian: hindi makukuha ang JavaScript na $1 o hindi nagbigay kahulugan sa $2', |
564 | 581 | 'mwe-apiproxy-setup' => 'Nagtatalaga ng pamalit na API', |
565 | 582 | 'mwe-load-drag-item' => 'Ikinakarga ang hinilang bagay', |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js |
— | — | @@ -84,6 +84,7 @@ |
85 | 85 | this.elementsInRange.push( $node ); |
86 | 86 | mw.log("Add ref to elementsInRange:: " + nodeType + " length:" + this.elementsInRange.length); |
87 | 87 | } |
| 88 | + |
88 | 89 | // Return the node Duration for startOffset updates |
89 | 90 | return this.getNodeDuration( $node ); |
90 | 91 | }, |
— | — | @@ -118,7 +119,7 @@ |
119 | 120 | if( $node.children().length ){ |
120 | 121 | $node.children().each( function( inx, childNode ){ |
121 | 122 | // If in a sequence add to duration |
122 | | - var childDuration = _this.getNodeDuration( $j( childNode ) ); |
| 123 | + var childDuration = _this.getNodeDuration( $j( childNode ), forceRefresh ); |
123 | 124 | if( blockType == 'seq' ){ |
124 | 125 | $node.data( 'implictDuration', $node.data('implictDuration') + childDuration ); |
125 | 126 | } |
— | — | @@ -157,7 +158,7 @@ |
158 | 159 | */ |
159 | 160 | getNodeSmilType: function( $node ){ |
160 | 161 | var blockType = $j( $node ).get(0).nodeName; |
161 | | - blockMap = { |
| 162 | + var blockMap = { |
162 | 163 | 'body':'seq', |
163 | 164 | 'animation':'ref', |
164 | 165 | 'audio' : 'ref', |
— | — | @@ -171,77 +172,4 @@ |
172 | 173 | return blockType; |
173 | 174 | } |
174 | 175 | |
175 | | - |
176 | | - /** |
177 | | - * Recurse parse out smil elements |
178 | | - |
179 | | - recurseSmilBlocks: function( $node, blockStore ){ |
180 | | - var _this = this; |
181 | | - |
182 | | - // Recursively parse the body for "<par>" and <seq>" |
183 | | - $node.children().each( function( inx, childNode ){ |
184 | | - debugger; |
185 | | - mw.log( 'on node: ' + childNode.nodeName); |
186 | | - var smilBlock = { |
187 | | - 'name' : childNode.nodeName |
188 | | - }; |
189 | | - switch( childNode.nodeName ) { |
190 | | - case 'par': |
191 | | - smilBlock = new mw.SmilPar( childNode ); |
192 | | - break; |
193 | | - case 'seq': |
194 | | - smilBlock = new mw.SmilSeq( childNode ); |
195 | | - break; |
196 | | - default: |
197 | | - mw.log(childNode.nodeName + ' ( not recognized tag )'); |
198 | | - smilBlock = new mw.SmilElement( childNode ); |
199 | | - break; |
200 | | - } |
201 | | - |
202 | | - // Add smilBlock to the current smilBlock |
203 | | - blockStore.push( smilBlock ); |
204 | | - |
205 | | - // If children have children add a block store and recurse |
206 | | - if( $j( childNode ).children().length ) { |
207 | | - _this.recurseSmilBlocks( $j( childNode ), smilBlock.smilBlocks ); |
208 | | - } |
209 | | - }); |
210 | | - }, |
211 | | - */ |
212 | | - |
213 | | -} |
214 | | - |
215 | | -/** |
216 | | - * Base smil element |
217 | | - |
218 | | -mw.SmilElement = function( parElement ){ |
219 | | - this.init( parElement ); |
220 | | -} |
221 | | -mw.SmilElement.prototype = { |
222 | | - init: function( element ){ |
223 | | - this.tag = element.nodeName; |
224 | | - this.$dom = $j( element ); |
225 | | - this.blockStore = []; |
226 | | - } |
227 | | -} */ |
228 | | - |
229 | | -/** |
230 | | -* Par Block |
231 | | -* http://www.w3.org/TR/2008/REC-SMIL3-20081201/smil-timing.html#edef-par |
232 | | - |
233 | | -mw.SmilPar = function( parElement ){ |
234 | | - this.init( parElement ); |
235 | | -} |
236 | | -// Inhert the SmilElement prototype |
237 | | -mw.SmilPar.prototype = mw.SmilElement.prototype |
238 | | -*/ |
239 | | -/** |
240 | | -* Seq Block |
241 | | -* http://www.w3.org/TR/2008/REC-SMIL3-20081201/smil-timing.html#edef-seq |
242 | | - |
243 | | -mw.SmilSeq = function( seqElement ){ |
244 | | - this.init( seqElement ); |
245 | | -} |
246 | | -//Inhert the SmilElement prototype |
247 | | -mw.SmilSeq.prototype = mw.SmilElement.prototype; |
248 | | -*/ |
\ No newline at end of file |
| 176 | +} |
\ No newline at end of file |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js |
— | — | @@ -189,7 +189,7 @@ |
190 | 190 | // XXX get context of smil document for relative or absolute paths: |
191 | 191 | return $j('<img />') |
192 | 192 | .attr( { |
193 | | - 'src' : 'panzoom/' + $j( smilElement ).attr( 'src' ) |
| 193 | + 'src' : this.smil.getAssetPath( $j( smilElement ).attr( 'src' ) ) |
194 | 194 | } ) |
195 | 195 | .css( { |
196 | 196 | 'width': '100%', |
— | — | @@ -198,7 +198,8 @@ |
199 | 199 | }, |
200 | 200 | |
201 | 201 | /** |
202 | | - * Parse pan attribute zoom strings |
| 202 | + * Parse pan zoom attribute string |
| 203 | + * @param panZoomString |
203 | 204 | */ |
204 | 205 | parsePanZoom: function( panZoomString ){ |
205 | 206 | var pz = panZoomString.split(','); |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js |
— | — | @@ -31,7 +31,10 @@ |
32 | 32 | // Stores the mw.SmilBody object |
33 | 33 | body : null, |
34 | 34 | |
| 35 | + // Stores the smil document for this object ( for relative image paths ) |
| 36 | + smilUrl: null, |
35 | 37 | |
| 38 | + |
36 | 39 | /** |
37 | 40 | * Constructor |
38 | 41 | * @param {Object} options Set of options for the smil interface |
— | — | @@ -47,6 +50,7 @@ |
48 | 51 | */ |
49 | 52 | loadFromUrl: function( url , callback ) { |
50 | 53 | var _this = this; |
| 54 | + this.smilUrl = url; |
51 | 55 | mw.log( 'Smil: loadFromUrl : ' + url ); |
52 | 56 | // Set the loading flag to true: |
53 | 57 | this.loadingSmil = true; |
— | — | @@ -133,6 +137,15 @@ |
134 | 138 | this.duration = this.getBody().getDuration(); |
135 | 139 | } |
136 | 140 | return this.duration; |
| 141 | + }, |
| 142 | + |
| 143 | + /** |
| 144 | + * Check if a supplied asset path is relative if and return absolute path |
| 145 | + */ |
| 146 | + getAssetPath: function( assetPath ){ |
| 147 | + if( this.smilUrl ){ |
| 148 | + // get the smilUrl path |
| 149 | + } |
137 | 150 | } |
138 | 151 | } |
139 | 152 | /** |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js |
— | — | @@ -1,4 +1,3 @@ |
2 | | - |
3 | 2 | /** |
4 | 3 | * Extends EmbedPlayer to wrap smil playback in the html5 video tag abstraction. |
5 | 4 | */ |
— | — | @@ -37,12 +36,8 @@ |
38 | 37 | 'height' : '100%', |
39 | 38 | 'position' : 'relative' |
40 | 39 | }) |
41 | | - ); |
42 | | - // Add a loading spinner if we don't already have one |
43 | | - /*if( $j('#loadingSpinner_' + this.id ).length ){ |
44 | | - $j('#smilCanvas_' + this.id ).loadingSpinner(); |
45 | | - }*/ |
46 | | - |
| 40 | + ); |
| 41 | + |
47 | 42 | // Update the embed player |
48 | 43 | this.getSmil( function( smil ){ |
49 | 44 | // XXX might want to move this into mw.SMIL |
— | — | @@ -52,10 +47,13 @@ |
53 | 48 | 'height': _this.getHeight() |
54 | 49 | } ) |
55 | 50 | ) |
56 | | - }); |
57 | | - |
| 51 | + }); |
58 | 52 | }, |
59 | 53 | |
| 54 | + /** |
| 55 | + * Get the smil object. If the smil object does not exist create one with the source url: |
| 56 | + * @param callback |
| 57 | + */ |
60 | 58 | getSmil: function( callback ){ |
61 | 59 | if( !this.smil ) { |
62 | 60 | // Create the Smil engine object |
— | — | @@ -70,6 +68,9 @@ |
71 | 69 | } |
72 | 70 | }, |
73 | 71 | |
| 72 | + /** |
| 73 | + * Get the duration of smil document. |
| 74 | + */ |
74 | 75 | getDuration: function(){ |
75 | 76 | if( this.smil ){ |
76 | 77 | return this.smil.getDuration(); |
— | — | @@ -85,7 +86,7 @@ |
86 | 87 | }, |
87 | 88 | |
88 | 89 | /** |
89 | | - * update the thumbnail html |
| 90 | + * Update the thumbnail html |
90 | 91 | */ |
91 | 92 | updateThumbnailHTML: function() { |
92 | 93 | // If we have a "poster" use that; |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js |
— | — | @@ -13,9 +13,9 @@ |
14 | 14 | |
15 | 15 | mw.setDefaultConfig({ |
16 | 16 | /** |
17 | | - * If SwarmTransport should be enabled as a video transport mechanism |
| 17 | + * If SwarmTransport should be enabled by default as video transport mechanism |
18 | 18 | */ |
19 | | - 'enableSwarmTransport': true, |
| 19 | + 'enableSwarmTransport': false, |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * If the swarm transport plugin should be recommended if the user does not have it installed. |
Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -2287,6 +2287,7 @@ |
2288 | 2288 | if( ! $j( targetObject ).data( 'events' ) || |
2289 | 2289 | ! $j( targetObject ).data( 'events' )[ triggerName ] ) { |
2290 | 2290 | callback(); |
| 2291 | + return ; |
2291 | 2292 | } |
2292 | 2293 | var callbackCount = $j( targetObject ).data( 'events' )[ triggerName ].length; |
2293 | 2294 | if( !callbackCount ){ |
Index: branches/MwEmbedStandAlone/README |
— | — | @@ -9,12 +9,12 @@ |
10 | 10 | * All mwEmbed code is Released under the GPL2 as |
11 | 11 | * a stand alone component of mediaWiki |
12 | 12 | * |
13 | | -* Libraries used include their licence info in their included path |
| 13 | +* Libraries used include their license info in their included path |
14 | 14 | * |
15 | 15 | * Copyright (C) 2007 - 2010 Kaltura, Wikimedia Foundation |
16 | 16 | * |
17 | 17 | * Sub modules and libraries carry specific copyright while the |
18 | | -* the entire package is always reasleasable under the GPL 2 |
| 18 | +* the entire package is always releasable under the GPL 2 |
19 | 19 | * |
20 | 20 | * Author Michael Dale <mdale@wikimedia.org>, |
21 | 21 | * and many others. |
Index: branches/MwEmbedStandAlone/jsScriptLoader.php |
— | — | @@ -60,6 +60,9 @@ |
61 | 61 | // The includeAllModuleMessages string regular expression |
62 | 62 | private static $includeAllMsgsRegEx = "/mw\.includeAllModuleMessages\s*\(\s*\)\;?/"; |
63 | 63 | |
| 64 | + //Temporary store for message js |
| 65 | + private static $addMessageJs = ''; |
| 66 | + |
64 | 67 | /** |
65 | 68 | * Output the javascript from cache |
66 | 69 | * |
— | — | @@ -98,7 +101,7 @@ |
99 | 102 | try { |
100 | 103 | jsClassLoader::loadClassPaths(); |
101 | 104 | } catch( Exception $e ) { |
102 | | - $this->errorMsg .= $e->getMessage() ; |
| 105 | + $this->errorMsg .= $e->getMessage() ; |
103 | 106 | } |
104 | 107 | |
105 | 108 | // Reset the requestKey: |
— | — | @@ -148,15 +151,15 @@ |
149 | 152 | // Output the current language class js |
150 | 153 | $this->output .= jsClassLoader::getLanguageJs( $this->langCode ); |
151 | 154 | |
152 | | - // Add the required core mwEmbed style sheets Commted out |
153 | | - // because when creating stand alone packages js package with css |
154 | | - // the paths get messed up. |
155 | | - /* |
| 155 | + // Add the required core mwEmbed style sheets Commted out |
| 156 | + // because when creating stand alone packages js package with css |
| 157 | + // the paths get messed up. |
| 158 | + /* |
156 | 159 | if( !isset( $this->namedFileList[ 'mw.style.mwCommon' ] ) ) { |
157 | 160 | $this->output .= $this->getScriptText( 'mw.style.mwCommon' ); |
158 | 161 | } |
159 | 162 | */ |
160 | | - |
| 163 | + |
161 | 164 | // Output "special" IE comment tag to support "special" mwEmbed tags. |
162 | 165 | $this->notMinifiedTopOutput .='/*@cc_on@if(@_jscript_version<9){\'video audio source itext playlist\'.replace(/\w+/g,function(n){document.createElement(n)})}@end@*/'."\n"; |
163 | 166 | } |
— | — | @@ -725,7 +728,7 @@ |
726 | 729 | try { |
727 | 730 | jsClassLoader::loadClassPaths(); |
728 | 731 | } catch( Exception $e ) { |
729 | | - $this->errorMsg .= $e->getMessage() ; |
| 732 | + $this->errorMsg .= $e->getMessage() ; |
730 | 733 | } |
731 | 734 | |
732 | 735 | if ( isset( $wgScriptLoaderNamedPaths[ $reqClass ] ) ) { |
— | — | @@ -813,13 +816,23 @@ |
814 | 817 | |
815 | 818 | // Do language swap by index: |
816 | 819 | if ( $wgEnableScriptLocalization ){ |
817 | | - // Get the mw.addMessage javascript from scriptText and moduleName |
818 | | - $addMessageJs = $this->getAddMessagesFromScriptText( $scriptText , $moduleName); |
819 | 820 | //@@NOTE getAddMessagesFromClass could identify which mode we are in and we would not need to |
820 | 821 | // try each of these search patterns in the same order as before. |
821 | 822 | |
| 823 | + // Get the mw.addMessage javascript |
| 824 | + self::$addMessageJs = $this->getAddMessagesFromScriptText( $scriptText , $moduleName); |
| 825 | + |
822 | 826 | // Check for mw.includeAllModuleMsgs() call to be replaced with all the msgs |
823 | | - $scriptText = preg_replace( self::$includeAllMsgsRegEx, $addMessageJs, $scriptText, 1, $count ); |
| 827 | + // Use preg_replace_callback to avoid back-refrence substitution |
| 828 | + $scriptText = preg_replace_callback( |
| 829 | + self::$includeAllMsgsRegEx, |
| 830 | + 'jsScriptLoader::preg_addMessageJs', |
| 831 | + $scriptText, |
| 832 | + 1, |
| 833 | + $count |
| 834 | + ); |
| 835 | + |
| 836 | + |
824 | 837 | if( $count != 0 ){ |
825 | 838 | return $scriptText; |
826 | 839 | } |
— | — | @@ -828,21 +841,23 @@ |
829 | 842 | $inx = self::getAddMessagesIndex( $scriptText ); |
830 | 843 | if( $inx ){ |
831 | 844 | // Return the final string (without double {}) |
832 | | - return substr($scriptText, 0, $inx['sfull']) . $addMessageJs . substr($scriptText, $inx['efull']); |
| 845 | + return substr($scriptText, 0, $inx['sfull']) . self::$addMessageJs . substr($scriptText, $inx['efull']); |
833 | 846 | } |
834 | 847 | |
835 | 848 | // Replace mw.addMessageKeys with localized msgs in javascript string |
836 | 849 | $inx = self::getAddMessageKeyIndex( $scriptText ); |
837 | 850 | if( $inx ) { |
838 | 851 | // Return the final string (without double {}) |
839 | | - return substr( $scriptText, 0, $inx['sfull'] ). $addMessageJs . substr($scriptText, $inx['efull']); |
| 852 | + return substr( $scriptText, 0, $inx['sfull'] ). self::$addMessageJs . substr($scriptText, $inx['efull']); |
840 | 853 | } |
841 | 854 | } |
842 | 855 | // Return the javascript str unmodified if we did not transform with the localisation |
843 | 856 | return $scriptText; |
844 | 857 | } |
845 | | - |
846 | | - |
| 858 | + /* simple function to return addMessageJs without preg_replace back reference substitution */ |
| 859 | + private static function preg_addMessageJs(){ |
| 860 | + return self::$addMessageJs; |
| 861 | + } |
847 | 862 | /** |
848 | 863 | * Get the "addMesseges" function index ( for replacing msg text with localized json ) |
849 | 864 | * |