Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | } |
178 | 178 | }; |
179 | 179 | //attempt to parse out some stuff from the template: |
180 | | - var desc = rObj.desc.match(/\|Description=(([^\n]*\n)*)\|Source=/) |
| 180 | + var desc = rObj.desc.match(/\|Description\s*=\s*(([^\n]*\n)*)\|Source=/) |
181 | 181 | if( desc && desc[1] ){ |
182 | 182 | rObj.desc = $j.trim( desc[1] ); |
183 | 183 | } |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -50,8 +50,6 @@ |
51 | 51 | var default_remote_search_options = { |
52 | 52 | 'profile':'mediawiki_edit', |
53 | 53 | 'target_container':null, //the div that will hold the search interface |
54 | | - //if using a modeal dialog (instead of target_container) how close to the edge of the window should we go: |
55 | | - 'modal_edge_padding':'20px', |
56 | 54 | |
57 | 55 | 'target_invocation': null, //the button or link that will invoke the search interface |
58 | 56 | |
— | — | @@ -107,7 +105,7 @@ |
108 | 106 | }, |
109 | 107 | /** the default content providers list. |
110 | 108 | * |
111 | | - * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list: |
| 109 | + * (should be note that special tabs like "upload" and "combined" don't go into the content providers list: |
112 | 110 | * @note do not use double underscore in content providers names (used for id lookup) |
113 | 111 | * |
114 | 112 | * @@todo we will want to load more per user-preference and per category lookup |
— | — | @@ -345,17 +343,7 @@ |
346 | 344 | this.content_providers[i].enabled = false; |
347 | 345 | } |
348 | 346 | } |
349 | | - } |
350 | | - |
351 | | - //set up the default model config: |
352 | | - this.dmodalCss = { |
353 | | - 'width':'auto', |
354 | | - 'height':'auto', |
355 | | - 'top' : this.modal_edge_padding, |
356 | | - 'left' : this.modal_edge_padding, |
357 | | - 'right' : this.modal_edge_padding, |
358 | | - 'bottom': this.modal_edge_padding |
359 | | - } |
| 347 | + } |
360 | 348 | |
361 | 349 | |
362 | 350 | //set up the target invocation: |
— | — | @@ -386,6 +374,8 @@ |
387 | 375 | _this.getTexboxSelection(); |
388 | 376 | //$j(_this.target_container).dialog("open"); |
389 | 377 | $j(_this.target_container).parents('.ui-dialog').fadeIn('slow'); |
| 378 | + //re-center the dialog: |
| 379 | + $j(_this.target_container).dialog('option', 'position','center'); |
390 | 380 | }); |
391 | 381 | }, |
392 | 382 | //gets the in and out points for insert position or grabs the selected text for search |
— | — | @@ -440,48 +430,40 @@ |
441 | 431 | //js_log('added target id:' + $j(_this.target_container).attr('id')); |
442 | 432 | //get layout |
443 | 433 | //layout = _this.getMaxModalLayout(); |
| 434 | + js_log( 'width: ' + $j(window).width() + ' height: ' + $j(window).height()); |
| 435 | + var cConf = {}; |
| 436 | + cConf['cancel'] = function(){ |
| 437 | + _this.cancelClipEditCB() |
| 438 | + } |
| 439 | + function doResize(){ |
| 440 | + js_log('do resize:: ' + _this.target_container); |
| 441 | + $j( '#rsd_modal_target').dialog('option', 'width', $j(window).width()-50 ); |
| 442 | + $j( '#rsd_modal_target').dialog('option', 'height', $j(window).height()-50 ); |
| 443 | + $j( '#rsd_modal_target').dialog('option', 'position','center'); |
| 444 | + } |
| 445 | + |
444 | 446 | $j(_this.target_container).dialog({ |
445 | 447 | bgiframe: true, |
446 | 448 | autoOpen: true, |
447 | 449 | modal: true, |
448 | 450 | draggable:false, |
449 | 451 | resizable:false, |
450 | | - buttons: { |
451 | | - '_': function() { |
452 | | - //just a place-holder |
453 | | - } |
454 | | - }, |
| 452 | + buttons:cConf, |
455 | 453 | close: function() { |
456 | 454 | //if we are 'editing' a item close that |
457 | 455 | _this.cancelClipEditCB(); |
458 | 456 | js_log('closed modal'); |
459 | 457 | $j(this).parents('.ui-dialog').fadeOut('slow'); |
460 | 458 | } |
461 | | - }).parent('.ui-dialog').css( _this.dmodalCss ); |
| 459 | + }); |
| 460 | + doResize(); |
| 461 | + $j(window).resize(function(){ |
| 462 | + doResize(); |
| 463 | + }); |
462 | 464 | |
463 | | - //@@bind on resize to disable css dialog to update dmodelCss |
464 | | - //(resize and drag presently disabled) |
465 | | - /*.bind('resizestart', function(event, ui) { |
466 | | - _this.dmodalCss = {}; |
467 | | - $j(this).css({}); |
468 | | - }) |
469 | | - //bind on drag to remove preset style as well |
470 | | - .bind('dragstart', function(event, ui) { |
471 | | - _this.dmodalCss = {}; |
472 | | - $j(this).css({}); |
473 | | - });*/ |
474 | 465 | |
475 | | - /*var resizeTimer = false; |
476 | | - $j(window).bind('resize', function() { |
477 | | - var adjustModal = function(){ |
478 | | - var layout = _this.getMaxModalLayout(); |
479 | | - //js_log("should adjust: h " + layout.h + ' width:' + layout.w); |
480 | | - $j(_this.target_container).dialog('option', 'width', layout.w); |
481 | | - $j(_this.target_container).dialog('option', 'height', layout.h); |
482 | | - } |
483 | | - if (resizeTimer) clearTimeout(resizeTimer); |
484 | | - var resizeTimer = setTimeout(adjustModal, 100); |
485 | | - });*/ |
| 466 | + //re add cancel button |
| 467 | + _this.cancelClipEditCB(); |
486 | 468 | |
487 | 469 | //update the child position: (some of this should be pushed up-stream via dialog config options |
488 | 470 | $j(_this.target_container +'~ .ui-dialog-buttonpane').css({ |
— | — | @@ -490,11 +472,12 @@ |
491 | 473 | 'right':'0px', |
492 | 474 | 'bottom':'0px' |
493 | 475 | }); |
494 | | - //re add cancel button |
495 | | - _this.cancelClipEditCB(); |
| 476 | + /* |
| 477 | + |
| 478 | + |
496 | 479 | js_log('done setup of target_container: ' + |
497 | 480 | $j(_this.target_container +'~ .ui-dialog-buttonpane').length); |
498 | | - |
| 481 | + */ |
499 | 482 | |
500 | 483 | } |
501 | 484 | }, |
Index: trunk/phase3/js2/editPage.js |
— | — | @@ -31,11 +31,13 @@ |
32 | 32 | }, 100 ); |
33 | 33 | } else { |
34 | 34 | // Add the add-media-wizard button for old toolbar: |
35 | | - $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' + |
36 | | - mv_skin_img_path + 'Button_add_media.png">' ); |
37 | | - $j( '#btn-add-media-wiz' ).addMediaWiz( |
38 | | - amwConf |
39 | | - ); |
| 35 | + if( $j('#btn-add-media-wiz').length == 0 ){ |
| 36 | + $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' + |
| 37 | + mv_skin_img_path + 'Button_add_media.png">' ); |
| 38 | + $j( '#btn-add-media-wiz' ).addMediaWiz( |
| 39 | + amwConf |
| 40 | + ); |
| 41 | + } |
40 | 42 | } |
41 | 43 | |
42 | 44 | // Add to new toolbar (need to use api) |