r62533 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62532‎ | r62533 | r62534 >
Date:18:03, 15 February 2010
Author:dale
Status:deferred
Tags:
Comment:
* some add-media-wizard fixes ( empty target_container was causing issues )
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)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/testLang.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/testLang.html
@@ -8,7 +8,6 @@
99 }
1010 </style>
1111 <script type="text/javascript" >
12 -var scriptLoaderURID = 't17';
1312 //for just setting one or two to test at a time for debug
1413 //var langKeyDebug = [ 'lt' ]; //pl
1514 var langKeyDebug = mw.getConfig( 'languageCodeList' );
@@ -41,7 +40,7 @@
4241 var langName = 'Language' + langKey.substr(0,1).toUpperCase() + langKey.substr( 1,langKey.length );
4342 $j.getScript( '../includes/languages/classes/' + langName + '.js' , function(){
4443 // Get the current language mw.testLang js
45 - $j.getScript( '../../../mwScriptLoader.php?class=mw.testLang&debug=true&urid='+ scriptLoaderURID +'&uselang='+langKey, function(){
 44+ $j.getScript( '../../../mwScriptLoader.php?class=mw.testLang&debug=true&uselang='+langKey, function(){
4645 var o='';
4746 o+='<tr><td colspan="6" height="20" style="font-size:large"><b>Lang:' + langKey + '</b></td></tr>';
4847 //now for each langage msg:
@@ -83,7 +82,8 @@
8483 'meta' : 'allmessages',
8584 'ammessages' : mKey,
8685 'amlang' : langKey,
87 - 'amarg' : msgparam
 86+ 'amargs' : msgparam,
 87+ 'amenableparser' : true
8888 };
8989 mw.getJSON('../../../api.php', request, function( data ) {
9090 var t = '#'+ tkey;
Index: branches/js2-work/phase3/js/mwEmbed/tests/Add_Media_Wizard.html
@@ -11,23 +11,24 @@
1212 border:medium none;
1313 }
1414 </style>
15 - <!--
 15+
1616 <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
17 - -->
18 -
 17+
 18+ <!--
1919 <script type="text/javascript" src="../jsScriptLoader.php?uselang=en&class=window.jQuery,mwEmbed,mw.RemoteSearchDriver,$j.ui,$j.ui.resizable,$j.ui.draggable,$j.ui.dialog,$j.ui.tabs,$j.ui.sortable,$j.cookie,baseRemoteSearch&urid=1257728132531&debug=true"></script>
 20+ -->
2021
2122 <script type="text/javascript">
2223 mw.ready( function(){
23 - mw.load( 'AddMedia.addMediaWizard', function(){
24 -
 24+ mw.load( 'AddMedia.addMediaWizard', function(){
2525 $j('#add_media_link').addMediaWizard( {
2626 'profile' : 'html_edit',
2727 'target_textbox' : '#wpTextbox1',
2828 'target_render_area' : '#inline_append',
2929 'import_url_mode' : 'remote_link',
3030 'remote_insert_description' : true,
31 - //note selections in the textbox will take over the default query
 31+
 32+ // Note selections in the textbox will take over the default query
3233 'default_query' : 'fish',
3334
3435 //we only enabled commons
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/kalturaSearch.js
@@ -267,11 +267,11 @@
268268 _this.resultsObj = {};
269269 this.num_results = 0;
270270
271 - for ( var resource_id in data ) {
272 - var result = data[ resource_id ];
 271+ for ( var result_id in data ) {
 272+ var result = data[ result_id ];
273273
274274 // Skip the resource if the license is not compatible
275 - if( result.license_url && ! _this.rsd.checkCompatibleLicense( resource.licenseurl ) ){
 275+ if( result.license_url && ! _this.rsd.checkCompatibleLicense( result.license_url ) ){
276276 continue;
277277 }
278278
@@ -289,7 +289,7 @@
290290 }
291291
292292 this.num_results++;
293 - _this.resultsObj[ resource_id ] = result;
 293+ _this.resultsObj[ result_id ] = result;
294294
295295 }
296296 }
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -79,7 +79,7 @@
8080 /**
8181 * default_remote_search_options
8282 *
83 -* Options for initialising the remote search driver
 83+* Options for initializing the remote search driver
8484 */
8585 var default_remote_search_options = {
8686
@@ -157,9 +157,9 @@
158158
159159 $.addMediaWizard = function( options ){
160160 $.fn.addMediaWizard ( options, function( amwObj ) {
161 - // do the add-media-wizard display
 161+ // Do the add-media-wizard display
162162 amwObj.createUI();
163 - } )
 163+ } );
164164 }
165165
166166 } )( jQuery );
@@ -658,9 +658,10 @@
659659 createUI: function() {
660660 var _this = this;
661661 this.clearTextboxCache();
662 -
 662+
663663 // Setup the parent container (if not already created)
664 - if( $j( _this.target_container ).length == 0 ){
 664+ mw.log(" looking for: " + _this.target_container);
 665+ if( !_this.target_container || $j( _this.target_container ).length == 0 ){
665666 this.createDialogContainer();
666667 }else{
667668 // Empty out the target
@@ -835,10 +836,8 @@
836837 * Sets up the initial html interface
837838 */
838839 initDialog: function() {
839 - mw.log( 'initDialog' );
840 - var _this = this;
841840 mw.log( 'f::initDialog' );
842 -
 841+ var _this = this;
843842 var $mainContainer = $j( this.target_container );
844843
845844 var $controlContainer = this.createControlContainer();

Status & tagging log