r61522 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61521‎ | r61522 | r61523 >
Date:17:49, 26 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* fix display of mediaWiki results ( title key had "file:" in it twice )
* some white space fixes
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js
@@ -227,7 +227,7 @@
228228 }
229229
230230 mw.log( "Kaltura::getProviderResults query: " + request['s'] + " page: " + request['page']);
231 - $j.getJSON( this.provider.api_url + '?callback=?', request, function( data ) {
 231+ mw.getJSON( this.provider.api_url + '?callback=?', request, function( data ) {
232232 _this.addResults( data );
233233 callback( 'ok' );
234234 } );
@@ -250,16 +250,16 @@
251251 _this.resultsObj = {};
252252 this.num_results = 0;
253253
254 - for ( var resource_id in data ) {
255 - var result = data[ resource_id ];
 254+ for ( var resource_id in data ) {
 255+ var result = data[ resource_id ];
256256
257257 // Update mappings:
258258 result[ 'poster' ] = result[ 'thumbnail' ];
259259 result[ 'pSobj' ] = _this;
260260 result[ 'link' ] = result[ 'item_details_page' ];
261261
262 - var fileExtension = _this.getMimeExtension( result[ 'mime' ] );
263 - result[ 'titleKey' ] = 'File:' + result[ 'title' ] + '.' + fileExtension;
 262+ var fileExtension = _this.getMimeExtension( result[ 'mime' ] );
 263+ result[ 'titleKey' ] = result[ 'title' ] + '.' + fileExtension;
264264
265265 this.num_results++;
266266 _this.resultsObj[ resource_id ] = result;
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -202,23 +202,23 @@
203203 * Content_providers documentation
204204 *
205205 * @enabled: whether the search provider can be selected
206 - *
 206+ *
207207 * @default: default: if the current cp should be displayed (only one should be the default)
208 - *
 208+ *
209209 * @title: the title of the search provider
210 - *
 210+ *
211211 * @desc: can use html
212 - *
 212+ *
213213 * @homepage: the homepage url for the search provider
214214 *
215215 * @api_url: the url to query against given the library type:
216216 *
217217 * @lib: the search library to use corresponding to the
218 - * search object ie: 'mediaWiki' = new mediaWikiSearchSearch()
219 - *
 218+ * search object ie: 'mediaWiki' = new mediaWikiSearchSearch()
 219+ *
220220 * @tab_img: the tab image (if set to false use title text)
221 - * if === "true" use standard location skin/images/{cp_id}_tab.png
222 - * if === string use as url for image
 221+ * if === "true" use standard location skin/images/{cp_id}_tab.png
 222+ * if === string use as url for image
223223 *
224224 * @linkback_icon default is: /wiki/skins/common/images/magnify-clip.png
225225 *
@@ -237,7 +237,7 @@
238238 * Local wiki search
239239 */
240240 'this_wiki': {
241 - 'enabled': 1,
 241+ 'enabled': 1,
242242 'api_url': ( wgServer && wgScriptPath ) ?
243243 wgServer + wgScriptPath + '/api.php' : null,
244244 'lib': 'mediaWiki',
@@ -340,7 +340,7 @@
341341 * Special Upload tab provider
342342 */
343343 'upload': {
344 - 'enabled': 1,
 344+ 'enabled': 1,
345345 'title': 'Upload'
346346 }
347347 },
@@ -480,18 +480,18 @@
481481 } else {
482482 _this.upload_api_target = _this.local_wiki_api_url;
483483 }
484 - }
 484+ }
485485
486486 // Set up the "add media wizard" button, which invokes this object
487487 if ( !this.target_invoke_button || $j( this.target_invoke_button ).length == 0 ) {
488488 mw.log( "RemoteSearchDriver:: no target invocation provided " +
489 - "(will have to run your own createUI() )" );
 489+ "(will have to run your own createUI() )" );
490490 } else {
491 - if ( this.target_invoke_button ) {
 491+ if ( this.target_invoke_button ) {
492492 $j( this.target_invoke_button )
493493 .css( 'cursor', 'pointer' )
494494 .attr( 'title', gM( 'mwe-add_media_wizard' ) )
495 - .click( function() {
 495+ .click( function() {
496496 _this.createUI();
497497 } );
498498 }
@@ -510,7 +510,7 @@
511511 'title="' + licenseObj.title + '">' +
512512 licenseObj.img_html +
513513 '</a>' +
514 - '</div>';
 514+ '</div>';
515515 },
516516
517517 /**
@@ -1085,7 +1085,7 @@
10861086 this.$resultsContainer.html( mw.loading_spinner() );
10871087
10881088 // Make sure the search library is loaded and issue the search request
1089 - this.performProviderSearch( provider );
 1089+ this.performProviderSearch( provider );
10901090 },
10911091
10921092 /*
@@ -1209,7 +1209,7 @@
12101210 )
12111211 }
12121212 return false;
1213 - }
 1213+ }
12141214
12151215 if (!provider.sObj) {
12161216 this.loadSearchLib( provider, this.getProviderCallback() );
@@ -1228,9 +1228,9 @@
12291229 var searchTime = d.getMilliseconds();
12301230
12311231 provider.sObj.getSearchResults( $j( '#rsd_q' ).val() ,
1232 - function( resultStatus ) {
 1232+ function( resultStatus ) {
12331233 _this.showResults();
1234 - });
 1234+ });
12351235
12361236 // Set a timeout of 20 seconds
12371237 setTimeout( function() {
@@ -1348,9 +1348,9 @@
13491349 // Output all the results for the current current_provider
13501350 if ( typeof provider['sObj'] != 'undefined' ) {
13511351 $j.each( provider.sObj.resultsObj, function( resIndex, resource ) {
1352 - o += _this.getResultHtml( provider, resIndex, resource );
 1352+ o += _this.getResultHtml( provider, resIndex, resource );
13531353 numResults++;
1354 - } );
 1354+ } );
13551355 // Put in the tab output (plus clear the output)
13561356 $resultsContainer.append( o + '<div style="clear:both"/>' );
13571357 }
@@ -1395,7 +1395,7 @@
13961396 return this.getResultHtmlBox( provider, resIndex, resource );
13971397 }else{
13981398 return this.getResultHtmlList( provider, resIndex, resource );
1399 - }
 1399+ }
14001400 },
14011401
14021402 /**
@@ -1518,7 +1518,7 @@
15191519
15201520 // Set up the interface compoents:
15211521 var $clipEditControl = $j('<div />')
1522 - .attr( 'id', 'clip_edit_ctrl' )
 1522+ .attr( 'id', 'clip_edit_ctrl' )
15231523 .addClass('ui-widget ui-widget-content ui-corner-all')
15241524 .css( {
15251525 'position' : 'absolute',
@@ -2576,7 +2576,7 @@
25772577 mw.log( 'insertResource: ' + resource.title );
25782578 var _this = this;
25792579 // Double check that the resource is present:
2580 - this.isFileLocallyAvailable( resource, function( status ) {
 2580+ this.isFileLocallyAvailable( resource, function( status ) {
25812581 if ( status === 'missing' ) {
25822582 _this.showImportUI( resource, function() {
25832583 _this.insertResourceToOutput( resource );
@@ -2586,7 +2586,7 @@
25872587 if ( status === 'local' || status === 'shared' || status === 'imported' ) {
25882588 _this.insertResourceToOutput( resource );
25892589 }
2590 - //NOTE: should hanndle errors or other status states?
 2590+ //NOTE: should hanndle errors or other status states?
25912591 } );
25922592 },
25932593
@@ -2630,11 +2630,11 @@
26312631 mw.log( "close all:: " + _this.target_container );
26322632 _this.onCancelClipEdit();
26332633
2634 - $j( _this.target_container ).dialog( 'close' );
 2634+ $j( _this.target_container ).dialog( 'close' );
26352635 // Give a chance for the events to complete
26362636 // (somehow at least in firefox a rare condition occurs where
26372637 // the modal of the edit-box stick around even after the
2638 - // close request has been issued. )
 2638+ // close request has been issued. )
26392639 setTimeout(
26402640 function() {
26412641 $j( _this.target_container ).dialog( 'close' );

Status & tagging log