r61524 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61523‎ | r61524 | r61525 >
Date:18:49, 26 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* white space updates
* version bump
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/remotes/RemoteMwSequencer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js
@@ -171,14 +171,14 @@
172172 kalturaSearch.prototype = {
173173
174174 // Stores search library pointers
175 - searchLibs: { },
 175+ searchLibs: { },
176176
177177 /**
178178 * Initialize the Search with provided options
179179 *
180180 * @param {Object} options Initial options for the kalturaSearch class
181181 */
182 - init:function( options ) {
 182+ init:function( options ) {
183183 this.options = options;
184184 this.filters = new kalturaFilters( options );
185185 var baseSearch = new baseRemoteSearch( options );
@@ -254,7 +254,7 @@
255255 var result = data[ resource_id ];
256256
257257 // Update mappings:
258 - result[ 'poster' ] = result[ 'thumbnail' ];
 258+ result[ 'poster' ] = result[ 'thumbnail' ];
259259 result[ 'pSobj' ] = _this;
260260 result[ 'link' ] = result[ 'item_details_page' ];
261261
@@ -276,7 +276,7 @@
277277 * @param {Number} size Requested size
278278 * @param {Function} callback Callback function for image resource
279279 */
280 - getImageObj: function( resource, size, callback ) {
 280+ getImageObj: function( resource, size, callback ) {
281281 var _this = this;
282282 this.getSerachLib( resource.content_provider_id, function( searchLib ){
283283 searchLib.getImageObj( resource, size, callback );
@@ -296,19 +296,19 @@
297297 * Get and load provider via id
298298 * @param {String} provider_id The id of the content provider
299299 * @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
301301 */
302302 getSerachLib: function( provider_id, callback ){
303303 var _this = this;
304304 // Check if we already have the library loaded:
305305 if( this.searchLibs[ provider_id ] ){
306 - callback ( this.searchLibs[ provider_id ] );
 306+ callback ( this.searchLibs[ provider_id ] );
307307 return ;
308308 }
309309 // Else load the provider lib:
310310 var provider = this.rsd.content_providers [ provider_id ];
311311 mw.load( provider.lib + 'Search', function(){
312 - //Set up the search lib options
 312+ //Set up the search lib options
313313 var options = {
314314 'provider': provider,
315315 // Same remote search driver as KalturaSearch
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js
@@ -25,7 +25,7 @@
2626
2727 mw.addModuleLoader( 'Sequencer', function( callback ){
2828 //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' );
3030 // Make sure we have the required mwEmbed libs:
3131 mw.load( [
3232 [ // 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 @@
322322 this.srcType = null;
323323 // if not external use different detection matrix
324324 if ( this.loading_external_data ) {
 325+ //var domParser = new DOMParser();
 326+ //this.data = domParser.parseFromString(this.data);
325327 if ( typeof this.data == 'object' ) {
326 - mw.log( 'object' );
 328+ mw.log( 'object' );
327329 // object assume xml (either xspf or rss)
328330 plElm = this.data.getElementsByTagName( 'playlist' )[0];
329331 if ( plElm ) {
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/remotes/RemoteMwSequencer.js
@@ -44,8 +44,22 @@
4545 gM("mwe-no-sequence-create", [this.title, $startLink.html() ])
4646 );
4747 $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+
4957 });
 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+
5064 }
5165 }
5266
@@ -63,17 +77,5 @@
6478 // grab textbox text,
6579 // set page to loading
6680 // 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 @@
12411241 }
12421242 while( mwLoadDoneCB[ requestName ].length ){
12431243 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+ }
12461253 }
12471254 // Set the load request name to done
12481255 mwLoadDoneCB[ requestName ] = 'done';
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r82';
 8+var mwRemoteVersion = 'r83';
99 var mwUseScriptLoader = true;
1010
1111 //Log the mwRemote version ( will determin what version of js we get )
@@ -83,7 +83,16 @@
8484 // Loading with loadMwEmbed not so big a deal since "sequencer is huge
8585 loadMwEmbed( function(){
8686 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+ } );
8897 } );
8998 } );
9099 }

Status & tagging log