Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js |
— | — | @@ -171,14 +171,14 @@ |
172 | 172 | kalturaSearch.prototype = { |
173 | 173 | |
174 | 174 | // Stores search library pointers |
175 | | - searchLibs: { }, |
| 175 | + searchLibs: { }, |
176 | 176 | |
177 | 177 | /** |
178 | 178 | * Initialize the Search with provided options |
179 | 179 | * |
180 | 180 | * @param {Object} options Initial options for the kalturaSearch class |
181 | 181 | */ |
182 | | - init:function( options ) { |
| 182 | + init:function( options ) { |
183 | 183 | this.options = options; |
184 | 184 | this.filters = new kalturaFilters( options ); |
185 | 185 | var baseSearch = new baseRemoteSearch( options ); |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | var result = data[ resource_id ]; |
256 | 256 | |
257 | 257 | // Update mappings: |
258 | | - result[ 'poster' ] = result[ 'thumbnail' ]; |
| 258 | + result[ 'poster' ] = result[ 'thumbnail' ]; |
259 | 259 | result[ 'pSobj' ] = _this; |
260 | 260 | result[ 'link' ] = result[ 'item_details_page' ]; |
261 | 261 | |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | * @param {Number} size Requested size |
278 | 278 | * @param {Function} callback Callback function for image resource |
279 | 279 | */ |
280 | | - getImageObj: function( resource, size, callback ) { |
| 280 | + getImageObj: function( resource, size, callback ) { |
281 | 281 | var _this = this; |
282 | 282 | this.getSerachLib( resource.content_provider_id, function( searchLib ){ |
283 | 283 | searchLib.getImageObj( resource, size, callback ); |
— | — | @@ -296,19 +296,19 @@ |
297 | 297 | * Get and load provider via id |
298 | 298 | * @param {String} provider_id The id of the content provider |
299 | 299 | * @param {Function} callback Function to call once provider search lib is loaded |
300 | | - * callback is passed the search object |
| 300 | + * callback is passed the search object |
301 | 301 | */ |
302 | 302 | getSerachLib: function( provider_id, callback ){ |
303 | 303 | var _this = this; |
304 | 304 | // Check if we already have the library loaded: |
305 | 305 | if( this.searchLibs[ provider_id ] ){ |
306 | | - callback ( this.searchLibs[ provider_id ] ); |
| 306 | + callback ( this.searchLibs[ provider_id ] ); |
307 | 307 | return ; |
308 | 308 | } |
309 | 309 | // Else load the provider lib: |
310 | 310 | var provider = this.rsd.content_providers [ provider_id ]; |
311 | 311 | mw.load( provider.lib + 'Search', function(){ |
312 | | - //Set up the search lib options |
| 312 | + //Set up the search lib options |
313 | 313 | var options = { |
314 | 314 | 'provider': provider, |
315 | 315 | // Same remote search driver as KalturaSearch |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | mw.addModuleLoader( 'Sequencer', function( callback ){ |
28 | 28 | //Get sequencer style sheet |
29 | | - mw.getStyleSheet( mw.getMwEmbedPath() + 'skins/' + mw.getConfig( 'skinName' ) + '/mv_sequence.css' ); |
| 29 | + mw.getStyleSheet( mw.getMwEmbedPath() + 'modules/Sequencer/css/mv_sequence.css' ); |
30 | 30 | // Make sure we have the required mwEmbed libs: |
31 | 31 | mw.load( [ |
32 | 32 | [ // Load the EmbedPlayer Module ( includes lots of dependent classes ) |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js |
— | — | @@ -321,8 +321,10 @@ |
322 | 322 | this.srcType = null; |
323 | 323 | // if not external use different detection matrix |
324 | 324 | if ( this.loading_external_data ) { |
| 325 | + //var domParser = new DOMParser(); |
| 326 | + //this.data = domParser.parseFromString(this.data); |
325 | 327 | if ( typeof this.data == 'object' ) { |
326 | | - mw.log( 'object' ); |
| 328 | + mw.log( 'object' ); |
327 | 329 | // object assume xml (either xspf or rss) |
328 | 330 | plElm = this.data.getElementsByTagName( 'playlist' )[0]; |
329 | 331 | if ( plElm ) { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/remotes/RemoteMwSequencer.js |
— | — | @@ -44,8 +44,22 @@ |
45 | 45 | gM("mwe-no-sequence-create", [this.title, $startLink.html() ]) |
46 | 46 | ); |
47 | 47 | $j('#mwe-sequence-create').click(function(){ |
48 | | - alert(' new sequence here' ); |
| 48 | + $j('body').append( '<div id="seqcontainer" style="position:absolute;top:5px;bottom:10px;left:10px;right:10px;" />' ); |
| 49 | + mw.load( 'Sequencer', function(){ |
| 50 | + $j('#seqcontainer').sequencer({ |
| 51 | + 'amw_conf':{ |
| 52 | + 'enabled_providers':['wiki_commons'] |
| 53 | + } |
| 54 | + }) |
| 55 | + }); |
| 56 | + |
49 | 57 | }); |
| 58 | + }else{ |
| 59 | + $j( this.target ).html( |
| 60 | + '<playlist id="playlist" src="' +wgArticlePath.replace('$1', this.title) + '?action=raw&.xml" wikiTitleKey="' + this.title + '" ></playlist>' |
| 61 | + ); |
| 62 | + $j('#playlist').embedPlayer(); |
| 63 | + |
50 | 64 | } |
51 | 65 | } |
52 | 66 | |
— | — | @@ -63,17 +77,5 @@ |
64 | 78 | // grab textbox text, |
65 | 79 | // set page to loading |
66 | 80 | // display sequence editor in "body" with -> full-screen link |
67 | | -}; |
68 | | - |
69 | | - |
70 | | -mw.ready( function(){ |
71 | | - //Setup the remote configuration |
72 | | - var myRemote = new RemoteMwSequencer( { |
73 | | - 'action': wgAction, |
74 | | - 'title' : wgTitle, |
75 | | - 'target': '#bodyContent' |
76 | | - }); |
77 | | - // Update the UI |
78 | | - myRemote.updateUI(); |
79 | | - |
80 | | -}); |
\ No newline at end of file |
| 81 | +}; //Setup the remote configuration |
| 82 | + |
\ No newline at end of file |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -1240,8 +1240,15 @@ |
1241 | 1241 | } |
1242 | 1242 | while( mwLoadDoneCB[ requestName ].length ){ |
1243 | 1243 | if( typeof mwLoadDoneCB[ requestName ] != 'object' ) |
1244 | | - break; |
1245 | | - mwLoadDoneCB[ requestName ].pop()( requestName ); |
| 1244 | + { |
| 1245 | + break; |
| 1246 | + } |
| 1247 | + var func = mwLoadDoneCB[ requestName ].pop(); |
| 1248 | + if( typeof func == 'function' ){ |
| 1249 | + func( requestName ); |
| 1250 | + }else{ |
| 1251 | + mw.log('mwLoadDoneCB: error not a callback function'); |
| 1252 | + } |
1246 | 1253 | } |
1247 | 1254 | // Set the load request name to done |
1248 | 1255 | mwLoadDoneCB[ requestName ] = 'done'; |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r82'; |
| 8 | +var mwRemoteVersion = 'r83'; |
9 | 9 | var mwUseScriptLoader = true; |
10 | 10 | |
11 | 11 | //Log the mwRemote version ( will determin what version of js we get ) |
— | — | @@ -83,7 +83,16 @@ |
84 | 84 | // Loading with loadMwEmbed not so big a deal since "sequencer is huge |
85 | 85 | loadMwEmbed( function(){ |
86 | 86 | mw.load( 'Sequencer', function(){ |
87 | | - mw.load( 'RemoteMwSequencer' ); |
| 87 | + mw.load( 'RemoteMwSequencer', function(){ |
| 88 | + mw.log('RemoteMwSequencer loaded' ); |
| 89 | + var myRemote = new RemoteMwSequencer( { |
| 90 | + 'action': wgAction, |
| 91 | + 'title' : wgTitle, |
| 92 | + 'target': '#bodyContent' |
| 93 | + }); |
| 94 | + // Update the UI |
| 95 | + myRemote.updateUI(); |
| 96 | + } ); |
88 | 97 | } ); |
89 | 98 | } ); |
90 | 99 | } |