r58294 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58293‎ | r58294 | r58295 >
Date:00:30, 29 October 2009
Author:dale
Status:deferred
Tags:
Comment:
* 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/binPlayers/cortado/cortado.jar (deleted) (history)
  • /trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html
@@ -14,6 +14,8 @@
1515 <div style="width:450px;float:left">
1616 <video src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
1717 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>
 18+<video style="width:208px;height:160px;float:left" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
 19+ 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>
1820 <b>Source Code used:</b><br>
1921 <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"
2022 src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
@@ -22,6 +24,8 @@
2325 <div style="width:450px;float:left">
2426 <video skin_name="kskin" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
2527 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>
 28+<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"
 29+ 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>
2630 <b>(ksin) Source Code used:</b><br>
2731 <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"
2832 src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -72,6 +72,10 @@
7373 'import_url_mode': 'api',
7474
7575 'target_title':null,
 76+
 77+ //edit tools (can be an array of tools or keyword 'all')
 78+ 'enabled_tools' : 'all',
 79+
7680
7781 'target_textbox':null,
7882 'target_render_area': null, //where output render should go:
@@ -515,10 +519,10 @@
516520 },
517521 init_modal:function(){
518522 js_log("init_modal");
519 - var _this = this;
520 - _this.target_container = '#rsd_modal_target';
 523+ var _this = this;
521524 //add the parent target_container if not provided or missing
522525 if(!_this.target_container || $j(_this.target_container).length==0){
 526+ _this.target_container = '#rsd_modal_target';
523527 $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>');
524528 //js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id'));
525529 //js_log('added target id:' + $j(_this.target_container).attr('id'));
@@ -1261,7 +1265,8 @@
12621266 'control_ct' : 'clip_edit_ctrl',
12631267 'media_type' : mediaType,
12641268 'p_rsdObj' : _this,
1265 - 'controlActionsCb' : _this.getClipEditControlActions( cp )
 1269+ 'controlActionsCb' : _this.getClipEditControlActions( cp ),
 1270+ 'enabled_tools' : _this.enabled_tools
12661271 };
12671272 //set the base clip edit lib class req set:
12681273 var clibs = ['mvClipEdit'];
@@ -1802,15 +1807,17 @@
18031808 }
18041809 js_log('getPaging:'+ cp_id + ' len: ' + cp.sObj.num_results);
18051810 var to_num = ( cp.limit > cp.sObj.num_results )?
1806 - (cp.offset + cp.sObj.num_results):
1807 - (cp.offset + cp.limit);
 1811+ (parseInt( cp.offset ) + parseInt( cp.sObj.num_results ) ):
 1812+ ( parseInt( cp.offset ) + parseInt( cp.limit) );
18081813 var out = '';
18091814
18101815 //@@todo we should instead support the wiki number format template system instead of inline calls
1811 - if( cp.sObj.num_results > cp.limit){
1812 - out+= gM('rsd_results_desc_total', [(cp.offset+1), to_num, $mw.lang.formatNumber( cp.sObj.num_results )] );
1813 - }else{
1814 - out+= gM('rsd_results_desc', [(cp.offset+1), to_num]);
 1816+ if( cp.sObj.num_results != 0 ){
 1817+ if( cp.sObj.num_results > cp.limit){
 1818+ out+= gM( 'rsd_results_desc_total', [(cp.offset+1), to_num, $mw.lang.formatNumber( cp.sObj.num_results )] );
 1819+ }else{
 1820+ out+= gM( 'rsd_results_desc', [(cp.offset+1), to_num] );
 1821+ }
18151822 }
18161823 //check if we have more results (next prev link)
18171824 if( cp.offset >= cp.limit )
@@ -1820,11 +1827,13 @@
18211828 out+=' <a href="#" id="rsd_pnext">' + gM('rsd_results_next') + ' ' + cp.limit + '</a>';
18221829
18231830 $j(target).html(out);
 1831+
18241832 //set bindings
18251833 $j('#rsd_pnext').click(function(){
18261834 cp.offset += cp.limit;
18271835 _this.runSearch( false );
18281836 });
 1837+
18291838 $j('#rsd_pprev').click(function(){
18301839 cp.offset -= cp.limit;
18311840 if(cp.offset<0)
Index: trunk/phase3/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js
@@ -20,6 +20,8 @@
2121 }
2222 if(typeof this_seq.amw_conf != 'undefined')
2323 $j.extend(iObj, this_seq.amw_conf);
 24+
 25+
2426 //inherit the remoteSearchDriver properties:n
2527 var tmpRSD = new remoteSearchDriver( iObj );
2628 for(var i in tmpRSD){
@@ -28,7 +30,7 @@
2931 }else{
3032 this[i] = tmpRSD[i];
3133 }
32 - }
 34+ }
3335 //extend parent_do_refresh_timeline actions:
3436 if(!this.pSeq.parent_do_refresh_timeline){
3537 this.pSeq.parent_do_refresh_timeline = this.pSeq.do_refresh_timeline;
@@ -52,13 +54,13 @@
5355 //setup parent bindings:
5456 this.parent_addResultBindings();
5557
56 - //add an aditional click binding
 58+ //Add an additional click binding
5759 $j('.rsd_res_item').click(function(){
5860 js_log('SeqRemoteSearch: rsd_res_item: click (remove sequence_add_target)');
5961 _this.sequence_add_target =false;
6062 });
6163
62 - //add an additional drag binding
 64+ //Add an additional drag binding
6365 $j( '.rsd_res_item' ).draggable('destroy').draggable({
6466 helper:function(){
6567 return $j( this ).clone().appendTo('body').css({'z-index':9999}).get(0);
@@ -97,7 +99,7 @@
98100 if(tClip)
99101 var target_order = tClip.order;
100102 }
101 - //@@todo show wating of sorts.
 103+ //@@todo show watting of sorts.
102104
103105 //get target order:
104106 var cat = rObj;
@@ -144,7 +146,7 @@
145147 //don't resize to default (full screen behavior)
146148 _this.dmodalCss = {};
147149 //open up a new target_contaienr:
148 - if($j('#seq_resource_import').length == 0)
 150+ if( $j('#seq_resource_import').length == 0 )
149151 $j('body').append('<div id="seq_resource_import" style="position:relative"></div>');
150152
151153 $j('#seq_resource_import').dialog('destroy').dialog({
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js
@@ -1,5 +1,5 @@
22 /*
3 - * hanndles driving the firefogg render system
 3+ * handles driving the firefogg render system
44 */
55
66 var mvFirefoggRender = function( iObj ) {
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -41,7 +41,9 @@
4242 'p_seqObj': null, //parent sequence Object
4343
4444 'controlActionsCb' : null, //the object that configures control Action callbacks
45 -
 45+
 46+ //The set of tools to enable (by default 'all' else an array of tools from mvClipEdit.toolset list below:
 47+ 'enabled_tools': 'all',
4648 'edit_action': null, //the requested edit action
4749 'profile': 'inpage' //the given profile either "inpage" or "sequence"
4850 }
@@ -53,7 +55,8 @@
5456 selTool:null, //selected tool
5557 crop: null, //the crop values
5658 base_img_src:null,
57 -
 59+ toolset : ['crop', 'layout'],
 60+
5861 init:function( iObj){
5962 //init object:
6063 for(var i in default_clipedit_values){
@@ -73,7 +76,6 @@
7477 this.media_type = 'template';
7578 }
7679 }
77 -
7880 //display control:
7981 if(this.profile == 'sequence'){
8082 this.doEditTypesMenu();
@@ -507,70 +509,90 @@
508510 //copy over the desc text to the resource object
509511 _this.rObj['inlineDesc']= $j('#mv_inline_img_desc').val();
510512 },
 513+ appendTool: function( $target, tool_id ){
 514+ var _this = this;
 515+ switch(tool_id){
 516+ case 'layout':
 517+ $target.append( ''+
 518+ '<span style="float:left;">Layout:</span>' +
 519+ '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mwe-layout_left')+'"/>'+
 520+ '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mwe-layout_left')+'"/>'+
 521+ '<hr style="clear:both" /><br>'
 522+ );
 523+ //make sure the default is reflected:
 524+ if( ! _this.rObj.layout )
 525+ _this.rObj.layout = 'right';
 526+ $j('#mv_layout_' + _this.rObj.layout)[0].checked = true;
 527+
 528+ //left radio click
 529+ $j('#mv_layout_left,#mv_layout_left_img').click(function(){
 530+ $j('#mv_layout_right')[0].checked = false;
 531+ $j('#mv_layout_left')[0].checked = true;
 532+ _this.rObj.layout = 'left';
 533+ });
 534+ //right radio click
 535+ $j('#mv_layout_right,#mv_layout_right_img').click(function(){
 536+ $j('#mv_layout_left')[0].checked = false;
 537+ $j('#mv_layout_right')[0].checked = true;
 538+ _this.rObj.layout = 'right';
 539+ });
 540+ break;
 541+ case 'crop':
 542+ $target.append( ''+
 543+ '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mwe-crop')+'"/>'+
 544+ '<a href="#" class="mv_crop_msg">' + gM('mwe-crop') + '</a> '+
 545+ '<span style="display:none" class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+
 546+ '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mwe-apply_crop') + '</a> '+
 547+ '<a href="#" style="display:none" class="mv_reset_crop">' + gM('mwe-reset_crop') + '</a> '+
 548+ '<hr style="clear:both"/><br>'
 549+ );
 550+ //add binding:
 551+ $j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
 552+ js_log('click:mv_crop_button: base width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
 553+ if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
 554+ _this.applyCrop();
 555+ }else{
 556+ js_log('click:turn on');
 557+ _this.enableCrop();
 558+ }
 559+ });
 560+ $j('.mv_reset_crop').click(function(){
 561+ $j('.mv_apply_crop,.mv_reset_crop').hide();
 562+ $j('.mv_crop_msg').show();
 563+ $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop'));
 564+ _this.rObj.crop=null;
 565+ $j('#' + _this.clip_disp_ct ).empty().html(
 566+ '<img src="' + _this.rObj.edit_url + '" id="rsd_edit_img">'
 567+ );
 568+ });
 569+ break;
 570+ case 'scale':
 571+ /*scale:
 572+ '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mwe-scale')+'"></div>'+
 573+ '<a href="#" class="mv_scale_msg">' + gM('mwe-scale') + '</a><br>'+
 574+ '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mwe-apply_scale') + '</a> '+
 575+ '<a href="#" style="display:none" class="mv_reset_scale">' + gM('mwe-reset_scale') + '</a><br> '+
 576+
 577+ */
 578+ break;
 579+ }
 580+ },
511581 setUpImageCtrl:function(){
512582 var _this = this;
 583+ var $tool_target = $j('#'+this.control_ct);
513584 //by default apply Crop tool
514 - $j('#'+this.control_ct).html(
515 - '<h3>Edit tools</h3>' +
516 - '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mwe-crop')+'"/>'+
517 - '<a href="#" class="mv_crop_msg">' + gM('mwe-crop') + '</a> '+
518 - '<span style="display:none" class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+
519 - '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mwe-apply_crop') + '</a> '+
520 - '<a href="#" style="display:none" class="mv_reset_crop">' + gM('mwe-reset_crop') + '</a> '+
521 - '<hr style="clear:both"/><br>'+
522 - '<span style="float:left;">Layout:</span>' +
523 - '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mwe-layout_left')+'"/>'+
524 - '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mwe-layout_left')+'"/>'+
525 - '<hr style="clear:both" /><br>' +
526 - _this.getInsertDescHtml()
527 - );
 585+ if( _this.enabled_tools == 'all' || _this.enabled_tools.length > 0){
 586+ $tool_target.append( '<h3>Edit tools</h3>' );
 587+ for( var i in _this.toolset ){
 588+ var toolid = _this.toolset[i];
 589+ if( $j.inArray( toolid, _this.enabled_tools) != -1 || _this.enabled_tools=='all')
 590+ _this.appendTool( $tool_target, toolid );
 591+ }
 592+ }
 593+ //add the insert description text field:
 594+ $tool_target.append( _this.getInsertDescHtml() );
528595 //add the actions to the 'button bar'
529 - _this.updateInsertControlActions()
530 -
531 - /*scale:
532 - '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mwe-scale')+'"></div>'+
533 - '<a href="#" class="mv_scale_msg">' + gM('mwe-scale') + '</a><br>'+
534 - '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mwe-apply_scale') + '</a> '+
535 - '<a href="#" style="display:none" class="mv_reset_scale">' + gM('mwe-reset_scale') + '</a><br> '+
536 -
537 - */
538 - //add bindings:
539 -
540 - //make sure the default is reflected:
541 - if( ! _this.rObj.layout )
542 - _this.rObj.layout = 'right';
543 - $j('#mv_layout_' + _this.rObj.layout)[0].checked = true;
544 -
545 - //left radio click
546 - $j('#mv_layout_left,#mv_layout_left_img').click(function(){
547 - $j('#mv_layout_right')[0].checked = false;
548 - $j('#mv_layout_left')[0].checked = true;
549 - _this.rObj.layout = 'left';
550 - });
551 - //right radio click
552 - $j('#mv_layout_right,#mv_layout_right_img').click(function(){
553 - $j('#mv_layout_left')[0].checked = false;
554 - $j('#mv_layout_right')[0].checked = true;
555 - _this.rObj.layout = 'right';
556 - });
557 - $j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
558 - js_log('click:mv_crop_button: base width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
559 - if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
560 - _this.applyCrop();
561 - }else{
562 - js_log('click:turn on');
563 - _this.enableCrop();
564 - }
565 - });
566 - $j('.mv_reset_crop').click(function(){
567 - $j('.mv_apply_crop,.mv_reset_crop').hide();
568 - $j('.mv_crop_msg').show();
569 - $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop'));
570 - _this.rObj.crop=null;
571 - $j('#' + _this.clip_disp_ct ).empty().html(
572 - '<img src="' + _this.rObj.edit_url + '" id="rsd_edit_img">'
573 - );
574 - });
 596+ _this.updateInsertControlActions();
575597 },
576598 applyVideoAdj:function(){
577599 js_log('applyVideoAdj::');
Index: trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -35,7 +35,7 @@
3636 "mwe-menu_btn" : "Menu",
3737 "mwe-close_btn" : "Close",
3838 "mwe-ogg-player-vlc-mozilla" : "VLC plugin",
39 - "mwe-ogg-player-videoElement" : "Native Ogg video support",
 39+ "mwe-ogg-player-videoElement" : "Native Ogg video",
4040 "mwe-ogg-player-vlc-activex" : "VLC ActiveX",
4141 "mwe-ogg-player-oggPlugin" : "Generic Ogg plugin",
4242 "mwe-ogg-player-quicktime-mozilla" : "QuickTime plugin",
@@ -49,7 +49,7 @@
5050 "mwe-do_not_warn_again" : "Dismiss for now.",
5151 "mwe-playerselect" : "Players",
5252 "mwe-read_before_embed" : "<a href=\"http:\/\/mediawiki.org\/wiki\/Security_Notes_on_Remote_Embedding\" target=\"_new\">Read this<\/a> before embedding.",
53 - "mwe-embed_site_or_blog" : "Embed on your site or blog",
 53+ "mwe-embed_site_or_blog" : "Embed on a page",
5454 "mwe-related_videos" : "Related videos",
5555 "mwe-seeking" : "seeking",
5656 "mwe-copy-code" : "Copy code"
@@ -1866,10 +1866,7 @@
18671867 var _this = this;
18681868 //load the roe if available (to populate out download options:
18691869 function getShowVideoDownload(){
1870 - var out='<div style="color:white">' +
1871 - '<b style="color:white;">'+gM('mwe-download_segment')+'</b><br>';
1872 - out+='<blockquote style="background:#000">'+
1873 - gM('mwe-download_right_click') + '</blockquote><br>';
 1870+ var out='<div style="color:white">';
18741871 var dl_list='';
18751872 var dl_txt_list='';
18761873 $j.each(_this.media_element.getSources(), function(index, source){

Status & tagging log