From ea8069180c47e7a35080c4eb292eb82d0a6a5216 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Wed, 28 Oct 2009 00:01:24 +0000 Subject: [PATCH] * restored seqRemoteSearchDriver * skin updates --- js2/mwEmbed/libEmbedVideo/embedVideo.js | 7 +- js2/mwEmbed/libSequencer/mvPlayList.js | 2 +- js2/mwEmbed/libSequencer/mvSequencer.js | 4 +- .../libSequencer/seqRemoteSearchDriver.js | 182 ++++++++++++++++++ js2/mwEmbed/mv_embed.js | 11 +- js2/mwEmbed/skins/mvpcf/styles.css | 6 +- 6 files changed, 199 insertions(+), 13 deletions(-) create mode 100644 js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 3514034071..828ebe47fd 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -1885,7 +1885,7 @@ embedVideo.prototype = { if(dl_list!='') out+=gM('mwe-download_full') + '
' + dl_list + '
'; if(dl_txt_list!='') - out+=gM('mwe-download_text')+'
' + dl_txt_list +'
'; + out+=gM('mwe-download_text') + '
' + dl_txt_list +'
'; out+=''; return out; } @@ -1902,6 +1902,9 @@ embedVideo.prototype = { $target.html( getShowVideoDownload() ); } }, + showCredits:function( $target ){ + $target.html('

' + gM('mwe-credits') + '

'); + }, /* * base embed controls * the play button calls @@ -1937,7 +1940,7 @@ embedVideo.prototype = { }, load:function(){ - //should be done by child (no base way to load assets) + //should be done by child (no base way to pre-buffer video) js_log('baseEmbed:load call'); }, getSrc:function(){ diff --git a/js2/mwEmbed/libSequencer/mvPlayList.js b/js2/mwEmbed/libSequencer/mvPlayList.js index 6eaff528f2..9f66ff72ca 100644 --- a/js2/mwEmbed/libSequencer/mvPlayList.js +++ b/js2/mwEmbed/libSequencer/mvPlayList.js @@ -656,7 +656,7 @@ mvPlayList.prototype = { this.cur_clip.embed.stop(); }, updateCurrentClip:function( new_clip ){ - js_log('f:updateCurrentClip:'+new_clip.id); + js_log('f:updateCurrentClip:'+new_clip.id); //make sure we are not switching to the current if( this.cur_clip.id == new_clip.id ){ js_log('trying to updateCurrentClip to same clip'); diff --git a/js2/mwEmbed/libSequencer/mvSequencer.js b/js2/mwEmbed/libSequencer/mvSequencer.js index 19b5b902ed..7bad73b37c 100644 --- a/js2/mwEmbed/libSequencer/mvSequencer.js +++ b/js2/mwEmbed/libSequencer/mvSequencer.js @@ -754,6 +754,7 @@ mvSequencer.prototype = { }, //updates the clip details div if edit resource is set doEditClip:function( cObj){ + js_log('seq:doEditClip'); var _this = this; //set default edit action (maybe edit_action can be sent via by context click) @@ -763,7 +764,8 @@ mvSequencer.prototype = { //load the clipEdit library if not already loaded: mvJsLoader.doLoad( [ 'mvClipEdit' - ], function(){ + ], function(){ + //zero out the current editor: _this.myClipEditor = {}; //setup the cliploader _this.myClipEditor = new mvClipEdit({ diff --git a/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js b/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js new file mode 100644 index 0000000000..065d6f66bf --- /dev/null +++ b/js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js @@ -0,0 +1,182 @@ +/*the sequence remote search driver + extends the base remote search driver with sequence specific stuff +*/ + +var seqRemoteSearchDriver = function(iObj){ + return this.init( iObj ) +} +seqRemoteSearchDriver.prototype = { + sequence_add_target:false, + init:function( this_seq ){ + var _this = this; + js_log("init:seqRemoteSearchDriver"); + //setup remote search driver with a seq parent: + this.pSeq = this_seq; + var iObj = { + 'target_container' : '#cliplib_ic', + 'local_wiki_api_url': this_seq.getLocalApiUrl(), + 'instance_name' : this_seq.instance_name + '.mySearch', + 'default_query' : this.pSeq.plObj.title + } + 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){ + if(this[i]){ + this['parent_'+i] = tmpRSD[i]; + }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; + this.pSeq.do_refresh_timeline = function(){ + js_log("seqRemoteSearchDriver::" + _this.pSeq.disp_menu_item); + //call the parent + _this.pSeq.parent_do_refresh_timeline(); + //add our local bindings + _this.addResultBindings(); + return true; + } + } + }, + resourceEdit:function(){ + var _this = this; + + }, + addResultBindings:function(){ + //set up seq: + var _this = this; + //setup parent bindings: + this.parent_addResultBindings(); + + //add an aditional 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 + $j( '.rsd_res_item' ).draggable('destroy').draggable({ + helper:function(){ + return $j( this ).clone().appendTo('body').css({'z-index':9999}).get(0); + }, + revert:'invalid', + start:function(){ + js_log('start drag'); + } + }); + $j(".mv_clip_drag").droppable( 'destroy' ).droppable({ + accept: '.rsd_res_item', + over:function(event, ui){ + //js_log("over : mv_clip_drag: " + $j(this).attr('id') ); + $j(this).css('border-right', 'solid thick red'); + }, + out:function(event, ui){ + $j(this).css('border-right', 'solid thin white'); + }, + drop: function(event, ui) { + $j(this).css('border-right', 'solid thin white'); + js_log("Droped: "+ $j(ui.draggable).attr('id') +' on ' + $j(this).attr('id') ); + _this.sequence_add_target = $j(this).attr('id'); + //load the orginal draged item + var rObj = _this.getResourceFromId( $j(ui.draggable).attr('id') ); + _this.resourceEdit(rObj, ui.draggable); + } + }); + + }, + insertResource:function(rObj){ + var _this = this; + js_log("SEQ insert resource after:" + _this.sequence_add_target + ' of type: ' + rObj.mime); + if(_this.sequence_add_target ){ + var tClip = _this.pSeq.getClipFromSeqID( _this.sequence_add_target ); + var target_order = false; + if(tClip) + var target_order = tClip.order; + } + //@@todo show wating of sorts. + + //get target order: + var cat = rObj; + //check for target insert path + this.checkImportResource( rObj, function(){ + + var clipConfig = { + 'type' : rObj.mime, + 'uri' : _this.cFileNS + ':' + rObj.target_resource_title, + 'title' : rObj.title + }; + //set via local properites if avaliable + clipConfig['src'] = (rObj.local_src) ? rObj.local_src : rObj.src; + clipConfig['poster'] = ( rObj.local_poster ) ? rObj.local_poster : rObj.poster; + + if(rObj.start_time && rObj.end_time){ + clipConfig['dur'] = npt2seconds( rObj.end_time ) - npt2seconds( rObj.start_time ); + }else{ + //provide a default duration if none set + clipConfig['dur'] = 4; + } + + //create the media element (target order+1 (since we insert (after) + _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) ); + //refresh the timeline: + _this.pSeq.do_refresh_timeline(); + js_log("run close all: "); + _this.closeAll(); + }); + }, + getClipEditControlActions:function(){ + var _this = this; + return { + 'insert_seq':function(rObj){ + _this.insertResource( rObj ) + }, + 'cancel':function(rObj){ + _this.cancelClipEditCB( rObj ) + } + }; + }, + resourceEdit:function(rObj, rsdElement){ + var _this = this; + //don't resize to default (full screen behavior) + _this.dmodalCss = {}; + //open up a new target_contaienr: + if($j('#seq_resource_import').length == 0) + $j('body').append('
'); + + $j('#seq_resource_import').dialog('destroy').dialog({ + bgiframe: true, + width:750, + height:480, + modal: true, + buttons: { + "Cancel": function() { + $j(this).dialog("close"); + } + } + }); + _this.target_container = '#seq_resource_import'; + //do parent resource edit (with updated target) + this.parent_resourceEdit(rObj, rsdElement); + }, + closeAll:function(){ + js_log( 'should close: seq_resource_import'); + $j('#seq_resource_import').dialog('close').dialog('destroy').remove(); + this.parent_closeAll(); + }, + getEditToken:function(callback){ + if(this.pSeq.sequenceEditToken){ + callback( this.pSeq.sequenceEditToken ) + }else{ + this.parent_getEditToken(callback); + } + }, + cancelClipEditCB:function(){ + js_log('seqRSD:cancelClipEditCB'); + $j('#seq_resource_import').dialog('close').dialog('destroy').remove(); + } +}; + diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index c34bf96b45..2ed21749be 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -15,7 +15,6 @@ * */ - /** * AutoLoader paths * @path The path to the file (or set of files) with ending slash @@ -830,8 +829,8 @@ var mvJsLoader = { missing_path : null, doLoad: function( loadLibs, callback ) { this.ctime++; - if( loadLibs && loadLibs.length != 0 ) { + //js_log("doLoad setup::" + JSON.stringify( loadLibs ) ); // Set up this.libs // First check if we already have this library loaded var all_libs_loaded = true; @@ -842,7 +841,7 @@ var mvJsLoader = { } } if( all_libs_loaded ) { - //js_log( 'Libraries ( ' + loadLibs + ') already loaded... skipping load request' ); + js_log( 'Libraries ( ' + loadLibs + ') already loaded... skipping load request' ); callback(); return; } @@ -867,7 +866,7 @@ var mvJsLoader = { coma = ','; } } - //Build the url to the scriptServer striping its request paramaters: + //Build the url to the scriptServer striping its request parameters: var puri = parseUri( getMvEmbedURL() ); if( ( getMvEmbedURL().indexOf('://') != -1 ) && puri.host != parseUri( document.URL ).host ) @@ -895,14 +894,14 @@ var mvJsLoader = { } } } + if( callback ) { this.callbacks.push( callback ); } if( this.checkLoading() ) { //@@todo we should check the