From: Michael Dale Date: Thu, 29 Oct 2009 00:30:44 +0000 (+0000) Subject: * updates to image edit tool configuration (to support crop enable/disable) X-Git-Tag: 1.31.0-rc.0~39047 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=d46d9dce9572b09eb134e65925cc9d24898fa15e;p=lhc%2Fweb%2Fwiklou.git * 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 --- diff --git a/js2/mwEmbed/binPlayers/cortado/cortado.jar b/js2/mwEmbed/binPlayers/cortado/cortado.jar deleted file mode 100644 index 6d9cbc7527..0000000000 Binary files a/js2/mwEmbed/binPlayers/cortado/cortado.jar and /dev/null differ diff --git a/js2/mwEmbed/example_usage/Player_Themable.html b/js2/mwEmbed/example_usage/Player_Themable.html index 70d8b2bac9..223bd3c164 100644 --- a/js2/mwEmbed/example_usage/Player_Themable.html +++ b/js2/mwEmbed/example_usage/Player_Themable.html @@ -14,6 +14,8 @@ To play with dynamic Themes install + Source Code used:
@@ -22,6 +24,8 @@ src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight
+ (ksin) Source Code used:
diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 673cefc4ec..534f8c3c4b 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -72,6 +72,10 @@ var default_remote_search_options = { '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 @@ remoteSearchDriver.prototype = { }, 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('
'); //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 @@ remoteSearchDriver.prototype = { '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 @@ remoteSearchDriver.prototype = { } 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 @@ remoteSearchDriver.prototype = { out+='
' + gM('rsd_results_next') + ' ' + cp.limit + ''; $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) diff --git a/js2/mwEmbed/libClipEdit/mvClipEdit.js b/js2/mwEmbed/libClipEdit/mvClipEdit.js index b06621d445..1de59fc991 100644 --- a/js2/mwEmbed/libClipEdit/mvClipEdit.js +++ b/js2/mwEmbed/libClipEdit/mvClipEdit.js @@ -41,7 +41,9 @@ var default_clipedit_values = { '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 @@ mvClipEdit.prototype = { 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 @@ mvClipEdit.prototype = { this.media_type = 'template'; } } - //display control: if(this.profile == 'sequence'){ this.doEditTypesMenu(); @@ -507,70 +509,90 @@ mvClipEdit.prototype = { //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( ''+ + 'Layout:' + + '
'+ + '
'+ + '

' + ); + //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( ''+ + '
'+ + '' + gM('mwe-crop') + ' '+ + ' '+ + ' '+ + ' '+ + '

' + ); + //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( + '' + ); + }); + break; + case 'scale': + /*scale: + '
'+ + '' + gM('mwe-scale') + '
'+ + ' '+ + '
'+ + + */ + break; + } + }, setUpImageCtrl:function(){ var _this = this; + var $tool_target = $j('#'+this.control_ct); //by default apply Crop tool - $j('#'+this.control_ct).html( - '

Edit tools

' + - '
'+ - '' + gM('mwe-crop') + ' '+ - ' '+ - ' '+ - ' '+ - '

'+ - 'Layout:' + - '
'+ - '
'+ - '

' + - _this.getInsertDescHtml() - ); - //add the actions to the 'button bar' - _this.updateInsertControlActions() - - /*scale: - '
'+ - '' + gM('mwe-scale') + '
'+ - ' '+ - '
'+ - - */ - //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(); + if( _this.enabled_tools == 'all' || _this.enabled_tools.length > 0){ + $tool_target.append( '

Edit tools

' ); + 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 ); } - }); - $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( - '' - ); - }); + } + //add the insert description text field: + $tool_target.append( _this.getInsertDescHtml() ); + //add the actions to the 'button bar' + _this.updateInsertControlActions(); }, applyVideoAdj:function(){ js_log('applyVideoAdj::'); diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 0dc72731eb..e4fd1d3f40 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -35,7 +35,7 @@ loadGM({ "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 @@ loadGM({ "mwe-do_not_warn_again" : "Dismiss for now.", "mwe-playerselect" : "Players", "mwe-read_before_embed" : "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 @@ embedVideo.prototype = { var _this = this; //load the roe if available (to populate out download options: function getShowVideoDownload(){ - var out='
' + - ''+gM('mwe-download_segment')+'
'; - out+='
'+ - gM('mwe-download_right_click') + '

'; + var out='
'; var dl_list=''; var dl_txt_list=''; $j.each(_this.media_element.getSources(), function(index, source){ diff --git a/js2/mwEmbed/libSequencer/mvFirefoggRender.js b/js2/mwEmbed/libSequencer/mvFirefoggRender.js index cd6c0da861..164a275643 100644 --- a/js2/mwEmbed/libSequencer/mvFirefoggRender.js +++ b/js2/mwEmbed/libSequencer/mvFirefoggRender.js @@ -1,5 +1,5 @@ /* - * hanndles driving the firefogg render system + * handles driving the firefogg render system */ var mvFirefoggRender = function( iObj ) { diff --git a/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js b/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js index 065d6f66bf..7004acbd18 100644 --- a/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js +++ b/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js @@ -20,6 +20,8 @@ seqRemoteSearchDriver.prototype = { } 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 @@ seqRemoteSearchDriver.prototype = { }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 @@ seqRemoteSearchDriver.prototype = { //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 @@ seqRemoteSearchDriver.prototype = { 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 @@ seqRemoteSearchDriver.prototype = { //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('
'); $j('#seq_resource_import').dialog('destroy').dialog({