http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58294

Revision: 58294
Author:   dale
Date:     2009-10-29 00:30:44 +0000 (Thu, 29 Oct 2009)

Log Message:
-----------
* updates to image edit tool configuration (to support crop enable/disable)
* some msg updates for better player display at low resolution
* removed old cortado
* some sequencer fixes

Modified Paths:
--------------
    trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html
    trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
    trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
    trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
    trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js
    trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js

Removed Paths:
-------------
    trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado.jar

Deleted: trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado.jar
===================================================================
(Binary files differ)

Modified: trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html
===================================================================
--- trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html 2009-10-28 
22:26:15 UTC (rev 58293)
+++ trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html 2009-10-29 
00:30:44 UTC (rev 58294)
@@ -14,6 +14,8 @@
 <div style="width:450px;float:left">
 <video 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";
 
                
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 durationHint="15"></video>
+<video style="width:208px;height:160px;float:left" 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";
 
+               
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 durationHint="15"></video>
 <b>Source Code used:</b><br>
 <textarea cols="50" rows="7"><video style="width:400px;height:288px" 
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 
 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";></video></textarea>
@@ -22,6 +24,8 @@
 <div style="width:450px;float:left">
 <video skin_name="kskin" 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";
 
                
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 durationHint="15"></video>
+<video  skin_name="kskin" style="width:208px;height:160px;float:left;" 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";
 
+               
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 durationHint="15"></video>
 <b>(ksin) Source Code used:</b><br>
 <textarea cols="50" rows="7"><video style="width:400px;height:288px" 
poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg";
 
 
src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg";></video></textarea>

Modified: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
===================================================================
--- trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js  2009-10-28 
22:26:15 UTC (rev 58293)
+++ trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js  2009-10-29 
00:30:44 UTC (rev 58294)
@@ -72,6 +72,10 @@
        'import_url_mode': 'api',
 
        'target_title':null,
+       
+       //edit tools (can be an array of tools or keyword 'all')
+       'enabled_tools' : 'all',
+       
 
        'target_textbox':null,
        'target_render_area': null, //where output render should go:
@@ -515,10 +519,10 @@
        },
        init_modal:function(){
                js_log("init_modal");
-               var _this = this;
-               _this.target_container = '#rsd_modal_target';
+               var _this = this;       
                //add the parent target_container if not provided or missing
                if(!_this.target_container || 
$j(_this.target_container).length==0){
+                       _this.target_container = '#rsd_modal_target';
                        $j('body').append('<div id="rsd_modal_target" 
style="position:absolute;top:3em;left:0px;bottom:3em;right:0px;" title="' + 
gM('mwe-add_media_wizard') + '" ></div>');                    
                        //js_log('appended: #rsd_modal_target' + 
$j(_this.target_container).attr('id'));
                        //js_log('added target id:' + 
$j(_this.target_container).attr('id'));
@@ -1261,7 +1265,8 @@
                        'control_ct'            : 'clip_edit_ctrl',
                        'media_type'            : mediaType,
                        'p_rsdObj'                      : _this,
-                       'controlActionsCb'      : 
_this.getClipEditControlActions( cp )
+                       'controlActionsCb'      : 
_this.getClipEditControlActions( cp ),
+                       'enabled_tools'         : _this.enabled_tools
                };
                //set the base clip edit lib class req set:
                var clibs = ['mvClipEdit'];
@@ -1802,15 +1807,17 @@
                }               
                js_log('getPaging:'+ cp_id + ' len: ' + cp.sObj.num_results);
                var to_num = ( cp.limit > cp.sObj.num_results )?
-                                               (cp.offset + 
cp.sObj.num_results):
-                                               (cp.offset + cp.limit);
+                                               (parseInt( cp.offset ) + 
parseInt( cp.sObj.num_results ) ):
+                                               ( parseInt( cp.offset ) + 
parseInt( cp.limit) );
                var out = '';                           
                
                //@@todo we should instead support the wiki number format 
template system instead of inline calls
-               if( cp.sObj.num_results  >  cp.limit){
-                       out+= gM('rsd_results_desc_total', [(cp.offset+1), 
to_num, $mw.lang.formatNumber( cp.sObj.num_results )] );
-               }else{
-                       out+= gM('rsd_results_desc', [(cp.offset+1), to_num]);
+               if( cp.sObj.num_results != 0 ){ 
+                       if( cp.sObj.num_results  >  cp.limit){          
+                               out+= gM( 'rsd_results_desc_total', 
[(cp.offset+1), to_num, $mw.lang.formatNumber( cp.sObj.num_results )] );
+                       }else{          
+                               out+= gM( 'rsd_results_desc', [(cp.offset+1), 
to_num] );
+                       }
                }
                //check if we have more results (next prev link)
                if(  cp.offset >=  cp.limit )
@@ -1820,11 +1827,13 @@
                        out+=' <a href="#" id="rsd_pnext">' + 
gM('rsd_results_next') + ' ' + cp.limit + '</a>';
 
                $j(target).html(out);
+               
                //set bindings
                $j('#rsd_pnext').click(function(){
                        cp.offset += cp.limit;
                        _this.runSearch( false );
                });
+               
                $j('#rsd_pprev').click(function(){
                        cp.offset -= cp.limit;
                        if(cp.offset<0)

Modified: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
===================================================================
--- trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js  2009-10-28 22:26:15 UTC 
(rev 58293)
+++ trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js  2009-10-29 00:30:44 UTC 
(rev 58294)
@@ -41,7 +41,9 @@
        'p_seqObj': null,        //parent sequence Object
 
        'controlActionsCb' : null, //the object that configures control Action 
callbacks
-
+       
+       //The set of tools to enable (by default 'all' else an array of tools 
from mvClipEdit.toolset list below: 
+       'enabled_tools': 'all',
        'edit_action': null, //the requested edit action
        'profile': 'inpage' //the given profile either "inpage" or "sequence"
 }
@@ -53,7 +55,8 @@
        selTool:null, //selected tool
        crop: null, //the crop values
        base_img_src:null,
-
+       toolset : ['crop', 'layout'],
+       
        init:function( iObj){
                //init object:
                for(var i in default_clipedit_values){
@@ -73,7 +76,6 @@
                                this.media_type = 'template';
                        }
                }
-
                //display control:
                if(this.profile == 'sequence'){
                        this.doEditTypesMenu();
@@ -507,70 +509,90 @@
                //copy over the desc text to the resource object
                _this.rObj['inlineDesc']= $j('#mv_inline_img_desc').val();
        },
+       appendTool: function( $target, tool_id ){
+               var _this = this;
+               switch(tool_id){
+                       case 'layout':                  
+                               $target.append( ''+             
+                                       '<span 
style="float:left;">Layout:</span>' +
+                                               '<input type="radio" 
name="mv_layout" id="mv_layout_left" style="float:left"><div 
id="mv_layout_left_img" title="'+gM('mwe-layout_left')+'"/>'+
+                                               '<input type="radio" 
name="mv_layout" id="mv_layout_right" style="float:left"><div 
id="mv_layout_right_img" title="'+gM('mwe-layout_left')+'"/>'+
+                                       '<hr style="clear:both" /><br>' 
+                               );
+                               //make sure the default is reflected:
+                               if( ! _this.rObj.layout )
+                                       _this.rObj.layout = 'right';
+                               $j('#mv_layout_' + 
_this.rObj.layout)[0].checked = true;
+               
+                               //left radio click
+                               
$j('#mv_layout_left,#mv_layout_left_img').click(function(){
+                                       $j('#mv_layout_right')[0].checked = 
false;
+                                       $j('#mv_layout_left')[0].checked = true;
+                                       _this.rObj.layout = 'left';
+                               });
+                               //right radio click
+                               
$j('#mv_layout_right,#mv_layout_right_img').click(function(){
+                                       $j('#mv_layout_left')[0].checked = 
false;
+                                       $j('#mv_layout_right')[0].checked = 
true;
+                                       _this.rObj.layout = 'right';
+                               });             
+                       break;
+                       case 'crop':                    
+                               $target.append( ''+
+                                       '<div class="mv_edit_button 
mv_crop_button_base" id="mv_crop_button" alt="crop" 
title="'+gM('mwe-crop')+'"/>'+
+                                               '<a href="#" 
class="mv_crop_msg">' + gM('mwe-crop') + '</a> '+
+                                               '<span style="display:none" 
class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+
+                                               '<a href="#" 
style="display:none" class="mv_apply_crop">' + gM('mwe-apply_crop') + '</a> '+
+                                               '<a href="#" 
style="display:none" class="mv_reset_crop">' + gM('mwe-reset_crop') + '</a> '+
+                                       '<hr style="clear:both"/><br>'
+                               );
+                               //add binding: 
+                               
$j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
+                                       js_log('click:mv_crop_button: base 
width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
+                                       
if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
+                                               _this.applyCrop();
+                                       }else{
+                                               js_log('click:turn on');
+                                               _this.enableCrop();
+                                       }
+                               });
+                               $j('.mv_reset_crop').click(function(){
+                                       
$j('.mv_apply_crop,.mv_reset_crop').hide();
+                                       $j('.mv_crop_msg').show();
+                                       
$j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop'));
+                                       _this.rObj.crop=null;
+                                       $j('#' + _this.clip_disp_ct 
).empty().html(
+                                               '<img src="' + 
_this.rObj.edit_url + '" id="rsd_edit_img">'
+                                       );
+                               });                             
+                       break;
+                       case 'scale':
+                               /*scale:
+                                '<div class="mv_edit_button 
mv_scale_button_base" id="mv_scale_button" alt="crop" 
title="'+gM('mwe-scale')+'"></div>'+
+                                               '<a href="#" 
class="mv_scale_msg">' + gM('mwe-scale') + '</a><br>'+
+                                               '<a href="#" 
style="display:none" class="mv_apply_scale">' + gM('mwe-apply_scale') + '</a> '+
+                                               '<a href="#" 
style="display:none" class="mv_reset_scale">' + gM('mwe-reset_scale') + 
'</a><br> '+
+               
+                               */
+                       break;
+               }
+       },
        setUpImageCtrl:function(){
                var _this = this;
+               var $tool_target = $j('#'+this.control_ct);
                //by default apply Crop tool
-               $j('#'+this.control_ct).html(
-                       '<h3>Edit tools</h3>' +
-                                       '<div class="mv_edit_button 
mv_crop_button_base" id="mv_crop_button" alt="crop" 
title="'+gM('mwe-crop')+'"/>'+
-                                       '<a href="#" class="mv_crop_msg">' + 
gM('mwe-crop') + '</a> '+
-                                       '<span style="display:none" 
class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+
-                                       '<a href="#" style="display:none" 
class="mv_apply_crop">' + gM('mwe-apply_crop') + '</a> '+
-                                       '<a href="#" style="display:none" 
class="mv_reset_crop">' + gM('mwe-reset_crop') + '</a> '+
-                               '<hr style="clear:both"/><br>'+
-                       '<span style="float:left;">Layout:</span>' +
-                               '<input type="radio" name="mv_layout" 
id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" 
title="'+gM('mwe-layout_left')+'"/>'+
-                               '<input type="radio" name="mv_layout" 
id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" 
title="'+gM('mwe-layout_left')+'"/>'+
-                       '<hr style="clear:both" /><br>' +
-                               _this.getInsertDescHtml()
-               );
+               if( _this.enabled_tools == 'all' || _this.enabled_tools.length 
> 0){
+                       $tool_target.append( '<h3>Edit tools</h3>' );
+                       for( var i in _this.toolset ){
+                               var toolid = _this.toolset[i];
+                               if( $j.inArray( toolid, _this.enabled_tools) != 
-1 || _this.enabled_tools=='all')
+                                       _this.appendTool( $tool_target, toolid 
);
+                       }
+               }
+               //add the insert description text field: 
+               $tool_target.append( _this.getInsertDescHtml() );
                //add the actions to the 'button bar'
-               _this.updateInsertControlActions()
-
-               /*scale:
-                '<div class="mv_edit_button mv_scale_button_base" 
id="mv_scale_button" alt="crop" title="'+gM('mwe-scale')+'"></div>'+
-                               '<a href="#" class="mv_scale_msg">' + 
gM('mwe-scale') + '</a><br>'+
-                               '<a href="#" style="display:none" 
class="mv_apply_scale">' + gM('mwe-apply_scale') + '</a> '+
-                               '<a href="#" style="display:none" 
class="mv_reset_scale">' + gM('mwe-reset_scale') + '</a><br> '+
-
-               */
-               //add bindings:
-
-               //make sure the default is reflected:
-               if( ! _this.rObj.layout )
-                       _this.rObj.layout = 'right';
-               $j('#mv_layout_' + _this.rObj.layout)[0].checked = true;
-
-               //left radio click
-               $j('#mv_layout_left,#mv_layout_left_img').click(function(){
-                       $j('#mv_layout_right')[0].checked = false;
-                       $j('#mv_layout_left')[0].checked = true;
-                       _this.rObj.layout = 'left';
-               });
-               //right radio click
-               $j('#mv_layout_right,#mv_layout_right_img').click(function(){
-                       $j('#mv_layout_left')[0].checked = false;
-                       $j('#mv_layout_right')[0].checked = true;
-                       _this.rObj.layout = 'right';
-               });
-               
$j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
-                       js_log('click:mv_crop_button: base width: ' + 
_this.rObj.width + ' bh: ' + _this.rObj.height);
-                       
if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
-                               _this.applyCrop();
-                       }else{
-                               js_log('click:turn on');
-                               _this.enableCrop();
-                       }
-               });
-               $j('.mv_reset_crop').click(function(){
-                       $j('.mv_apply_crop,.mv_reset_crop').hide();
-                       $j('.mv_crop_msg').show();
-                       
$j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop'));
-                       _this.rObj.crop=null;
-                       $j('#' + _this.clip_disp_ct ).empty().html(
-                               '<img src="' + _this.rObj.edit_url + '" 
id="rsd_edit_img">'
-                       );
-               });
+               _this.updateInsertControlActions();
        },
        applyVideoAdj:function(){
                js_log('applyVideoAdj::');

Modified: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
===================================================================
--- trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js        2009-10-28 
22:26:15 UTC (rev 58293)
+++ trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js        2009-10-29 
00:30:44 UTC (rev 58294)
@@ -35,7 +35,7 @@
        "mwe-menu_btn" : "Menu",
        "mwe-close_btn" : "Close",
        "mwe-ogg-player-vlc-mozilla" : "VLC plugin",
-       "mwe-ogg-player-videoElement" : "Native Ogg video support",
+       "mwe-ogg-player-videoElement" : "Native Ogg video",
        "mwe-ogg-player-vlc-activex" : "VLC ActiveX",
        "mwe-ogg-player-oggPlugin" : "Generic Ogg plugin",
        "mwe-ogg-player-quicktime-mozilla" : "QuickTime plugin",
@@ -49,7 +49,7 @@
        "mwe-do_not_warn_again" : "Dismiss for now.",
        "mwe-playerselect" : "Players",
        "mwe-read_before_embed" : "<a 
href=\"http:\/\/mediawiki.org\/wiki\/Security_Notes_on_Remote_Embedding\" 
target=\"_new\">Read this<\/a> before embedding.",
-       "mwe-embed_site_or_blog" : "Embed on your site or blog",
+       "mwe-embed_site_or_blog" : "Embed on a page",
        "mwe-related_videos" : "Related videos",
        "mwe-seeking" : "seeking",
        "mwe-copy-code" : "Copy code"
@@ -1866,10 +1866,7 @@
                var _this = this;
                //load the roe if available (to populate out download options:
                function getShowVideoDownload(){
-                       var out='<div style="color:white">' +
-                                       '<b 
style="color:white;">'+gM('mwe-download_segment')+'</b><br>';
-                       out+='<blockquote style="background:#000">'+
-                                       gM('mwe-download_right_click') + 
'</blockquote><br>';
+                               var out='<div style="color:white">';            
                        
                        var dl_list='';
                        var dl_txt_list='';             
                        $j.each(_this.media_element.getSources(), 
function(index, source){

Modified: trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js
===================================================================
--- trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js   2009-10-28 
22:26:15 UTC (rev 58293)
+++ trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js   2009-10-29 
00:30:44 UTC (rev 58294)
@@ -1,5 +1,5 @@
 /*
- * hanndles driving the firefogg render system 
+ * handles driving the firefogg render system 
 */
 
 var mvFirefoggRender = function( iObj ) {              

Modified: trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js
===================================================================
--- trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js      
2009-10-28 22:26:15 UTC (rev 58293)
+++ trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js      
2009-10-29 00:30:44 UTC (rev 58294)
@@ -20,6 +20,8 @@
                }               
                if(typeof this_seq.amw_conf != 'undefined')
                        $j.extend(iObj,  this_seq.amw_conf);
+                       
+       
                //inherit the remoteSearchDriver properties:n
                var tmpRSD = new remoteSearchDriver( iObj );
                for(var i in tmpRSD){
@@ -28,7 +30,7 @@
                        }else{
                                this[i] = tmpRSD[i];
                        }
-               }
+               }                       
                //extend parent_do_refresh_timeline actions:
                if(!this.pSeq.parent_do_refresh_timeline){
                        this.pSeq.parent_do_refresh_timeline = 
this.pSeq.do_refresh_timeline;
@@ -52,13 +54,13 @@
                //setup parent bindings:
                this.parent_addResultBindings();
 
-               //add an aditional click binding
+               //Add an additional click binding
                $j('.rsd_res_item').click(function(){
                        js_log('SeqRemoteSearch: rsd_res_item: click (remove 
sequence_add_target)');
                        _this.sequence_add_target =false;
                });
 
-               //add an additional drag binding
+               //Add an additional drag binding
                $j( '.rsd_res_item' ).draggable('destroy').draggable({
                        helper:function(){
                                return $j( this 
).clone().appendTo('body').css({'z-index':9999}).get(0);
@@ -97,7 +99,7 @@
                        if(tClip)
                                var target_order = tClip.order;
                }
-               //@@todo show wating of sorts.
+               //@@todo show watting of sorts.
 
                //get target order:
                var cat = rObj;
@@ -144,7 +146,7 @@
                //don't resize to default (full screen behavior)
                _this.dmodalCss = {};
                //open up a new target_contaienr:
-               if($j('#seq_resource_import').length == 0)
+               if( $j('#seq_resource_import').length == 0 )
                        $j('body').append('<div id="seq_resource_import" 
style="position:relative"></div>');
 
                $j('#seq_resource_import').dialog('destroy').dialog({



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to