* restored seqRemoteSearchDriver
authorMichael Dale <dale@users.mediawiki.org>
Wed, 28 Oct 2009 00:01:24 +0000 (00:01 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Wed, 28 Oct 2009 00:01:24 +0000 (00:01 +0000)
* skin updates

js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/libSequencer/mvPlayList.js
js2/mwEmbed/libSequencer/mvSequencer.js
js2/mwEmbed/libSequencer/seqRemoteSearchDriver.js [new file with mode: 0644]
js2/mwEmbed/mv_embed.js
js2/mwEmbed/skins/mvpcf/styles.css

index 3514034..828ebe4 100644 (file)
@@ -1885,7 +1885,7 @@ embedVideo.prototype = {
                        if(dl_list!='')
                                out+=gM('mwe-download_full') + '<blockquote style="background:#000">' + dl_list + '</blockquote>';
                        if(dl_txt_list!='')
-                               out+=gM('mwe-download_text')+'<blockquote style="background:#000">' + dl_txt_list +'</blockquote>';
+                               out+=gM('mwe-download_text') + '<blockquote style="background:#000">' + dl_txt_list +'</blockquote>';
                        out+='</div>';
                        return out;
                }
@@ -1902,6 +1902,9 @@ embedVideo.prototype = {
                        $target.html( getShowVideoDownload() );
                }
        },      
+       showCredits:function( $target ){
+               $target.html('<h2>' + gM('mwe-credits') + '</h2>');
+       },
        /*
        *  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(){
index 6eaff52..9f66ff7 100644 (file)
@@ -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');
index 19b5b90..7bad73b 100644 (file)
@@ -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 (file)
index 0000000..065d6f6
--- /dev/null
@@ -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('<div id="seq_resource_import" style="position:relative"></div>');
+
+               $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();
+       }
+};
+
index c34bf96..2ed2174 100644 (file)
@@ -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 <script> Element .onLoad property to
-                       //make sure its just not a very slow connection or we can run the callback
+                       //make sure its just not a very slow connection
                        //(even though the class is not loaded)
-
                        if( this.load_time++ > 4000 ){ // Time out after ~80 seconds
                                js_log( gM('mwe-error_load_lib', [mvGetClassPath(this.missing_path),  this.missing_path]) );
                                this.load_error = true;
index 49a9a35..5f4e07b 100644 (file)
@@ -503,12 +503,12 @@ ui-widget-overlay{
 /* Vertical Tabs
 ----------------------------------*/
 .ui-dialog-buttonpane { padding:10px !important; }
-.ui-tabs-vertical { width: 55em; }
-.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
+.ui-tabs-vertical { width: 100%; }
+.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 25%; }
 .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
 .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
 .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
-.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
+.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 68%;}
 
 .ui-dialog .ui-dialog-buttonpane button { float: left !important; }