Revision: 48548
Author:   dale
Date:     2009-03-18 23:53:40 +0000 (Wed, 18 Mar 2009)

Log Message:
-----------
* re-factor to better handle of "parent streams" 
* some javascript clean up
* fixes for importing assets
* rss output modifications for easy access to metadata (usefull for importing 
assets)

Modified Paths:
--------------
    trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
    trunk/extensions/MetavidWiki/includes/MV_Index.php
    
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php
    
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
    trunk/extensions/MetavidWiki/includes/MV_Settings.php
    trunk/extensions/MetavidWiki/includes/MV_Title.php
    trunk/extensions/MetavidWiki/includes/articlepages/MV_StreamPage.php
    trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
    trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php
    trunk/extensions/MetavidWiki/languages/MV_Messages.php
    trunk/extensions/MetavidWiki/skins/mv_custom.css
    
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js
    
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/archiveOrgSearch.js
    trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js
    trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js
    trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
    trunk/extensions/MetavidWiki/skins/mv_stream.js

Modified: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php        
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php        
2009-03-18 23:53:40 UTC (rev 48548)
@@ -126,7 +126,7 @@
        $wgJSAutoloadClasses['seqRemoteSearchDriver'] = $mvjsp . 
'libAddMedia/seqRemoteSearchDriver.js';
        $wgJSAutoloadClasses['mediaWikiSearch']         = $mvjsp . 
'libAddMedia/searchLibs/mediaWikiSearch.js';
        $wgJSAutoloadClasses['metavidSearch']           = $mvjsp . 
'libAddMedia/searchLibs/metavidSearch.js';
-       $wgJSAutoloadClasses['solrArchiveSearch']       = $mvjsp . 
'libAddMedia/searchLibs/solrArchiveSearch.js';       
+       $wgJSAutoloadClasses['archiveOrgSearch']        = $mvjsp . 
'libAddMedia/searchLibs/archiveOrgSearch.js';        
        
        //libClipEdit:
        $wgJSAutoloadClasses['mvClipEdit']                      = $mvjsp . 
'libClipEdit/mvClipEdit.js';

Modified: trunk/extensions/MetavidWiki/includes/MV_Index.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/MV_Index.php  2009-03-18 23:41:19 UTC 
(rev 48547)
+++ trunk/extensions/MetavidWiki/includes/MV_Index.php  2009-03-18 23:53:40 UTC 
(rev 48548)
@@ -25,6 +25,7 @@
 
  class MV_Index {
        var $mvTitle = null;
+       var $annoCache = array();
        function __construct( & $mvTitle = null ) {
                if ( $mvTitle != null )
                        $this->mvTitle = $mvTitle;
@@ -43,15 +44,14 @@
        }
        /*
         * getMVDInRange returns the mvd titles that are in the given range
-        * param list got kind of crazy long... @@todo re-factor int a request 
object or something cleaner
+        * param list got kind of crazy long... @@todo re-factor into something 
cleaner
         */
        function getMVDInRange( $stream_id, $start_time = null, $end_time = 
null, $mvd_type = 'all', $getText = false, $smw_properties = '', $options = 
array() ) {
                global $mvDefaultClipLength;
                $dbr =& wfGetDB( DB_SLAVE );
                // set up select vars:
                $conds = $vars = array();
-               $from_tables = '';
-               $do_cat_lookup = $do_smw_lookup = false;
+               $from_tables = '';      
                //
                // set mvd_type if empty:
                if ( $mvd_type == null )$mvd_type = 'all';
@@ -61,55 +61,7 @@
                // add in base from:
                $from_tables .= $dbr->tableName( 'mv_mvd_index' );
                $conds = array( 'stream_id' => $stream_id );
-               // print_r($smw_properties);            
-               if ( $smw_properties != '' ) {
-                       if ( !is_array( $smw_properties ) )
-                               $smw_properties = explode( ',', $smw_properties 
);
-                       foreach ( $smw_properties as $prop_name ) {
-                               if ( $prop_name == 'category' ) {
-                                       $do_cat_lookup = true;
-                               } else {
-                                       if ( SMW_VERSION >= 1.2 ) {             
                                
-                                               // the following is too slow to 
use but generally works:
-                                               // has to be rewritten with 
sub-queries or something more elaborate
-                                               // for now just do lookup after 
the fact
-                                               $do_smw_lookup = true;
-                                               /*$esc_p = 
mysql_real_escape_string($prop_name);
-                                               $vars[] = $esc_p.'.`smw_title` 
AS `'.
-                                                                       
$esc_p.'` ';
-                                               $from_tables.=' ,'.
-                                                       ' ' . 
$dbr->tableName('smw_rels2') . ' as `'.$esc_p.'_rels2`'. 
-                                                       ' JOIN `smw_ids` AS 
`'.$esc_p.'_pname` '. 
-                                                               ' ON ( '. 
-                                                               ' 
`'.$esc_p.'_rels2`.`p_id` = `'.$esc_p.'_pname`.`smw_id`
-                                                                       AND 
`'.$esc_p.'_pname`.`smw_title` LIKE CONVERT( _utf8 '.
-                                                                               
        $dbr->addQuotes($esc_p).
-                                                                               
' USING latin1 ) COLLATE latin1_general_ci '.                                   
                                        
-                                                       ' ) ' . 
-                                                       ' LEFT JOIN `smw_ids` 
AS `'.$esc_p.'stext` ' . 
-                                                               ' ON ( '.
-                                                               ' 
`'.$esc_p.'_rels2`.`s_id` = `'.$esc_p.'stext`.`smw_id` '.
-                                                               ' ) ' .         
                                                
-                                                       'LEFT JOIN `smw_ids` AS 
`'.mysql_real_escape_string($prop_name).'` '. 
-                                                               ' ON ( '.
-                                                               ' 
`'.$esc_p.'_rels2`.`o_id` = 
`'.mysql_real_escape_string($prop_name).'`.`smw_id`'.  
-                                                               ' ) ';
-                                               $conds[]=' 
`'.$esc_p.'stext`.`smw_title` = `mv_mvd_index`.`wiki_title` ';
-                                               break;          
-                                               */
-                                       } else {
-                                               $vars[] = 
mysql_real_escape_string( $prop_name ) . '.object_title as ' . 
mysql_real_escape_string( $prop_name );
-                                               $from_tables .= ' ' .
-                                                       ' LEFT JOIN ' . 
$dbr->tableName( 'smw_relations' ) .
-                                                       ' as ' . 
mysql_real_escape_string( $prop_name ) .
-                                                       ' ON (' . 
$dbr->tableName( 'mv_mvd_index' ) . '.mv_page_id' .
-                                                       ' = ' . 
mysql_real_escape_string( $prop_name ) . '.subject_id' .
-                                                       ' AND ' . 
mysql_real_escape_string( $prop_name ) . '.relation_title' .
-                                                       ' = ' . 
$dbr->addQuotes( $prop_name ) . ')';
-                                       }
-                               }
-                       }
-               }
+               // print_r($smw_properties);                            
                if ( $mvd_type != 'all' ) {
                        $mvd_type = ( is_object( $mvd_type ) ) ? 
get_object_vars( $mvd_type ):$mvd_type;
                        if ( is_array( $mvd_type ) ) {
@@ -146,9 +98,26 @@
                        $conds,
                        __METHOD__,
                        $options );
+               
                //print $dbr->lastQuery();
                //die;
+               return MV_Index::getMVDMeta( $result, $getText, 
$smw_properties);
+       }
+       function getMVDMeta( &$result, $getText = false, $smw_properties = ''){
+               $dbr =& wfGetDB( DB_SLAVE );
                if ( $dbr->numRows( $result ) == 0 )return array();
+               
+               $do_cat_lookup = $do_smw_lookup = false;
+               $smw_properties = explode( ',', $smw_properties );      
+               foreach($smw_properties as $propKey){
+                       if($propKey == 'category')
+                               $do_cat_lookup=true;
+                               
+                       if($propKey=='Speech_by'|| $propKey=='Bill')
+                               $do_smw_lookup=true;
+                               
+               }               
+               //get the results with meta
                $ret_ary = array();
                $from_tables = $vars = $options = array();
                $conds = '';
@@ -175,17 +144,18 @@
                                                
                        $vars = array( 'cl_from', 'cl_to' );
                        
-                       $options['LIMIT'] = 2000; // max avarage 5 categories 
per page
+                       $options['LIMIT'] = 2000; // max average 5 categories 
per page
 
                        $result_cat = $dbr->select( $from_tables,
                                $vars,
                                $conds,
                                __METHOD__,
-                               $options );
+                               $options );                     
+                                                       
                        while ( $cat_row = $dbr->fetchObject( $result_cat ) ) {
                                $ret_ary[$cat_row->cl_from]->category[] = 
$cat_row->cl_to;
                        }
-               }
+               }               
                // slow epecialy for lots of query results but join Query is 
crazy complicated for SMW >= 1.2 
                // (and I have not been able to construct it without hitting 
exessive number of rows in the EXPLIN) 
                // @@todo these queries should be merged with semantic wiki Ask 
with some ~special~ keywords for fulltext search
@@ -217,7 +187,53 @@
                // echo $sql;
                // $result =& $dbr->query( $sql, 'MV_Index:time_index_query');
                return $ret_ary;
+       }       
+       //gets an Annotative layer that encapsulates the mvTilte  
+       function getParentAnnotativeLayers(& $mvTitle){
+               //first check the cache: 
+               if(count($this->annoCache)!=0){
+                       foreach($this->annoCache as $aMVD){
+                               if(     $aMVD->start_time <=  
$mvTitle->getStartTimeSeconds() && 
+                                       $aMVD->start_time <=  
$mvTitle->getEndTimeSeconds() && 
+                                       $aMVD->end_time >= 
$mvTitle->getEndTimeSeconds() && 
+                                       $aMVD->end_time >= 
$mvTitle->getEndTimeSeconds() && 
+                                       $aMVD->stream_id ==  
$mvTitle->getStreamId() ){
+                                               //just return the cached result 
(worlds faster than the set of db queries below)                        
+                                               return $aMVD;
+                               }
+                       }
+               }
+               
+               $dbr =& wfGetDB( DB_SLAVE );
+               $from_tables =  $dbr->tableName( 'mv_mvd_index' );
+               $vars = '`mv_page_id` as `id`, `wiki_title`,`mvd_type`, 
`stream_id`, `start_time`,`end_time`,`view_count`';
+               $cond = array( 'stream_id' =>   $mvTitle->getStreamId()  ,
+                                                'mvd_type' =>   'Anno_en'      
                                         
+                                               );
+               
+               $cond[] = ' `start_time` <= '   . 
$mvTitle->getStartTimeSeconds() ;
+               $cond[] = ' `start_time` <= '   . $mvTitle->getEndTimeSeconds() 
;
+                                       
+               $cond[] = ' `end_time`    >= '  . 
$mvTitle->getStartTimeSeconds() ;
+               $cond[] = ' `end_time`    >= '  . $mvTitle->getEndTimeSeconds() 
;                       
+               
+               $res = $dbr->select( $from_tables,
+                       $vars,
+                       $cond,
+                       __METHOD__,     
+                       array( 'LIMIT' => 1 ) //just get one result             
        
+               );
+               //print $dbr->lastQuery();
+               //die;
+               $aMvd_rows = MV_Index::getMVDMeta($res, false, 
'Speech_by,Bill,category');
+               //returns the result in array set to current: 
+               $aMvd = end($aMvd_rows );               
+               if(!isset($this->annoCache[ $aMvd->id ])){
+                       $this->annoCache[ $aMvd->id ] = $aMvd;
+               };              
+               return $aMvd;
        }
+       
        /*@@todo figure another way to get at this data...this is not a very 
fast query: */
        function getMVDTypeInRange( $stream_id, $start_time = null, $end_time = 
null ) {
                $dbr =& wfGetDB( DB_SLAVE );
@@ -610,101 +626,8 @@
                        }
                }
                
-               //print_r($ret_ary);
-               //die;
-               
-               
-               
-               
-               // print "<pre>";
-               // print_r($ret_ary);
-               // die;
-               // throw out empty top level ranges
-               /*foreach($ret_ary as &$stream_set){
-                       foreach($stream_set as $k=> &$srange){
-                               if(count($srange['rows'])==0){
-                                       //print "throw out: ". $srange['s'] . 
$srange['e'];
-                                       unset($stream_set[$k]);
-                               }
-                       }
-               }*/
-               // do category & bill lookup for search result ranges
-               /*if ( $mvCategoryInSearchResult || $mvBillInSearchResult ) {
-                       $from_tables = $conds = '';
-                       $vars = $options = array();
-
-                       // set up selected vars:
-                       $vars[] = $dbr->tableName( 'categorylinks' ) . '.cl_to';
-                       $vars[] = $dbr->tableName( 'mv_mvd_index' ) . 
'.stream_id';
-                       $vars[] = $dbr->tableName( 'mv_mvd_index' ) . 
'.start_time';
-                       $vars[] = $dbr->tableName( 'mv_mvd_index' ) . 
'.end_time';
-                       $vars[] = $dbr->tableName( 'smw_relations' ) . 
'.object_title as bill_to ';
-
-                       // set up from_tables
-                       $from_tables .= $dbr->tableName( 'mv_mvd_index' ) .
-                               ' LEFT JOIN ' . $dbr->tableName( 
'categorylinks' ) .
-                                       ' ON ( ' .
-                                               $dbr->tableName( 'mv_mvd_index' 
) . '.mv_page_id = ' .
-                                               $dbr->tableName( 
'categorylinks' ) . '.cl_from ' .
-                                       ' ) ' .
-                               ' LEFT JOIN ' . $dbr->tableName( 
'smw_relations' ) .
-                                       ' ON ( ' .
-                                                       $dbr->tableName( 
'mv_mvd_index' ) . '.mv_page_id = ' .
-                                                       $dbr->tableName( 
'smw_relations' ) . '.subject_id ' .
-                                               ' AND ' .
-                                                       $dbr->tableName( 
'smw_relations' ) . '.relation_title=\'bill\' ' .
-                                       ' ) ';
-                       // generate stream_id, range sets
-                       $conds .= $dbr->tableName( 'mv_mvd_index' ) . 
'.mvd_type=\'Anno_en\' ' .
-                               ' AND (';
-                               $or = '';
-                               foreach ( $stream_groups as $stream_id => 
$rangeSet ) {
-                                       foreach ( $rangeSet as $range ) {
-                                               $conds .= $or . ' ( ' . 
$dbr->tableName( 'mv_mvd_index' ) . '.stream_id =' .
-                                                                               
        $dbr->addQuotes( $stream_id );
-                                               $conds .= " AND `start_time` <= 
" . $dbr->addQuotes( $range['s'] ) . "";
-                                               $conds .= " AND `end_time` >= " 
. $dbr->addQuotes( $range['e'] ) . ' ) ';
-                                               $or = ' OR ';
-
-                                       }
-                               }
-                       $conds .= ' ) ';
-                       $options['LIMIT'] = 200;
-
-                       $result = $dbr->select( $from_tables,
-                               $vars,
-                               $conds,
-                               __METHOD__,
-                               $options );
-                       // print "BEFORE merge: ";
-                       // print_r($ret_ary);
-                       // print_r($stream_groups);
-
-                       // merge category info back into base results:
-                       // $result = $dbr->query($sql,  
'MV_Index:doCategorySearchResult');
-                       while ( $cl_row = $dbr->fetchObject( $result ) ) {
-                               // print_r($cl_row);
-                               foreach ( $stream_groups[$cl_row->stream_id] as 
&$range ) {
-                                       foreach ( $range['rows'] as 
&$result_row ) {
-                                               if ( $result_row->start_time <= 
$cl_row->end_time &&
-                                                 $result_row->end_time >= 
$cl_row->start_time ) {
-                                                       // print "result row:"; 
print_r($result_row);
-                                                       if ( isset( 
$cl_row->cl_to ) && isset( $ret_ary[$result_row->id] ) )
-                                                               
$ret_ary[$result_row->id]->categories[$cl_row->cl_to] = true;
-                                                       if ( isset( 
$cl_row->bill_to ) && isset( $ret_ary[$result_row->id] ) )
-                                                               
$ret_ary[$result_row->id]->bills[$cl_row->bill_to] = true;
-                                               }
-                                       }
-                               }
-                       }
-                       // print "AFTER MERGE: ";
-                       // print_r($ret_ary);
-               }*/
-               // print "<pre>";
-               // print_r($ret_ary);
-               // die;
                return $ret_ary;
-       }
+       }       
        function numResultsFound() {
                if ( isset( $this->numResultsFound ) ) {
                        return $this->numResultsFound;
@@ -795,7 +718,7 @@
                        // build the update row
                        $update_ary = array(
                                'wiki_title' => $mvTitle->getWikiTitle(),
-                               'mvd_type' => $mvTitle->getTypeMarker(),
+                               'mvd_type' => $mvTitle->getMvdTypeKey(),
                                'stream_id' => $mvTitle->getStreamId(),
                                'start_time' => $mvTitle->getStartTimeSeconds(),
                                'end_time' => $mvTitle->getEndTimeSeconds() );
@@ -827,7 +750,7 @@
                $insAry = array(
                        'mv_page_id' => $article->mTitle->getArticleID(),
                        'wiki_title' => $mvTitle->getWikiTitle(),
-                       'mvd_type' => $mvTitle->getTypeMarker(),
+                       'mvd_type' => $mvTitle->getMvdTypeKey(),
                        'stream_id' => $mvTitle->getStreamId(),
                        'start_time' => $mvTitle->getStartTimeSeconds(),
                        'end_time' => $mvTitle->getEndTimeSeconds(),

Modified: 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php
===================================================================
--- 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php   
    2009-03-18 23:41:19 UTC (rev 48547)
+++ 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php   
    2009-03-18 23:53:40 UTC (rev 48548)
@@ -372,7 +372,7 @@
                        if ( !isset( $this->article->mvTitle ) ) {
                                $this->mvTitle = new MV_Title( 
$this->mTitle->getDBkey() );
                        }
-                       $editFormType = strtolower( 
$this->mvTitle->getTypeMarker() );
+                       $editFormType = strtolower( 
$this->mvTitle->getMvdTypeKey() );
                } else {
                        // check if its seq type: 
                        if ( $this->mvd_id == 'seq' ) {

Modified: 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
===================================================================
--- 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
   2009-03-18 23:41:19 UTC (rev 48547)
+++ 
trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php
   2009-03-18 23:53:40 UTC (rev 48548)
@@ -92,10 +92,11 @@
                        '<br><span style="font-size:80%">' .
                                wfMsg( 'mv_stream_length' ) . 
seconds2Description( $this->article->mvTitle->getDuration(), true ) . ' <i>'.
                        '<span style="font-size:90%">';
+               $this->page_header .= wfMsg('mv_stream_tool_heading'). 
':</i></span> <span style="font-size:70%">';
                if( $wgRequest->getVal('view') != 'overview' )
-                       $this->page_header.= $sk->makeKnownLinkObj( $wgTitle, 
wfMsg( 'mv_stream_overview' ), 'view=overview' ) ;
+                       $this->page_header.= $sk->makeKnownLinkObj( $wgTitle, 
wfMsg( 'mv_stream_overview' ), 'view=overview' ) . ' | ';
                $this->page_header.=' <a id="mv_edit_time" 
style="color:#2060C1;" href="#" onclick="return false;" alt=" ' . 
-                                               wfMsg('mv_edit_time'). '" >'. 
wfMsg('mv_edit_time') . '</a></i></span></h1>';
+                                               wfMsg('mv_edit_time'). '" >'. 
wfMsg('mv_edit_time') . '</a></span></h1>';
                        
                if($mvEnableStreamNotice){
                        $wgOut->addWikiText( wfMsg('mv_warning_wiki'));

Modified: trunk/extensions/MetavidWiki/includes/MV_Settings.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/MV_Settings.php       2009-03-18 
23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/includes/MV_Settings.php       2009-03-18 
23:53:40 UTC (rev 48548)
@@ -20,7 +20,10 @@
 include_once( 'MV_GlobalFunctions.php' );
 
 
+//greatly affects site performance (turn to false to avoid costly parent 
lookups on all search results) : 
+$mvGetParentMeta = true;
 
+
 //script loader settings: 
 $mvgJSDebug=false;
 $wgEnableScriptLoader = true; //if the script loader is on at all

Modified: trunk/extensions/MetavidWiki/includes/MV_Title.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/MV_Title.php  2009-03-18 23:41:19 UTC 
(rev 48547)
+++ trunk/extensions/MetavidWiki/includes/MV_Title.php  2009-03-18 23:53:40 UTC 
(rev 48548)
@@ -44,6 +44,8 @@
                // print "mv_title stream name: " . $this->stream_name. "\n";
        }
        function inheritTitle( & $title ) {
+               if(!is_object($title))
+                       print_r( debug_backtrace() );
                foreach ( $title as $k => $v ) {
                        $this->$k = $v;
                }
@@ -119,7 +121,6 @@
                }
                return false;
        }
-       function getTypeMarker() { return $this->type_marker; }
        function getWikiTitle() { return $this->wiki_title; }
        function getStartTime() { return $this->start_time; }
        function setStartTimeNtp($start_time){
@@ -191,8 +192,11 @@
                $stream = & mvGetMVStream( $this->stream_name );
                return $stream->getDuration();
        }
+       function getSegmentDuration(){
+               return $this->getEndTimeSeconds() - 
$this->getStartTimeSeconds();
+       }
        function getSegmentDurationNTP( $short_time = false ) {
-               return seconds2ntp( $this->getEndTimeSeconds() - 
$this->getStartTimeSeconds(), $short_time );
+               return seconds2ntp( $this->getSegmentDuration(), $short_time );
        }
        /*
         * returns a near by stream range:
@@ -202,8 +206,8 @@
                
                $stream = & mvGetMVStream( $this->stream_name );
        
-               if ( $range == null )$range = $mvDefaultClipRange;
-               if ( $length == null )$length = $mvDefaultClipLength;
+               if ( $range === null )$range = $mvDefaultClipRange;
+               if ( $length === null )$length = $mvDefaultClipLength;          
                
                // subtract $range seconds from the start time:
                $start_t = $this->getStartTimeSeconds()  - $range;

Modified: trunk/extensions/MetavidWiki/includes/articlepages/MV_StreamPage.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/articlepages/MV_StreamPage.php        
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/includes/articlepages/MV_StreamPage.php        
2009-03-18 23:53:40 UTC (rev 48548)
@@ -87,7 +87,7 @@
                $wgTitle->mNamespace = NS_SPECIAL;
                
                // do some aditional stream proccessing throw an error if we 
have a type
-               if ( $this->mvTitle->getTypeMarker() != null ) {
+               if ( $this->mvTitle->getMvdTypeKey() != null ) {
                        $page = 'Bad format for Metavid request';
                        return mvOutputSpecialPage( 'bad format for Metavid 
request',
                        $page );

Modified: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php 
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php 
2009-03-18 23:53:40 UTC (rev 48548)
@@ -335,8 +335,8 @@
                $wgTitle = Title::newFromText( $this->stream_name . '/' . 
$this->req_time, MV_NS_STREAM );
                // do mvd_index query:
                $mvd_rows = MV_Index::getMVDInRange( 
$streamTitle->getStreamId(),
-               $streamTitle->getStartTimeSeconds(),
-               $streamTitle->getEndTimeSeconds(), $tracks, $getText = false, 
'Speech_by,Bill,category' );
+                       $streamTitle->getStartTimeSeconds(),
+                       $streamTitle->getEndTimeSeconds(), $tracks, $getText = 
false, 'Speech_by,Bill,category' );
                // get the stream stream req
                if ( $this->output_xml_header )
                        header( 'Content-Type: text/xml' );
@@ -518,7 +518,7 @@
                        // get Stream title for mvd match:
                        $mvTitle = new MV_Title( $mvd->wiki_title );
                        $stremTitle = Title::MakeTitle( MV_NS_STREAM, 
$mvTitle->getStreamName() . '/' . $mvTitle->getTimeRequest() );
-                       $this->feed->outPutItem( $stremTitle, 
$MV_Overlay->getMVDhtml( $mvd, $absolute_links = true ) );
+                       $this->feed->outPutItem( $mvTitle, 
$MV_Overlay->getMVDhtml( $mvd, $absolute_links = true ) );
                }
                $this->feed->outFooter();
        }
@@ -554,13 +554,15 @@
                <?
        }
        function outPutItem( $wikiTitle, $desc_html = '' ) {
-               global $wgOut;
+               global $wgOut, $wgUser;
+               $sk = $wgUser->getSkin();
                $mvTitle = new MV_Title( $wikiTitle );
                $mStreamTitle = Title::makeTitle( MV_NS_STREAM, ucfirst( 
$mvTitle->getStreamName() ) . '/' . $mvTitle->getTimeRequest() );
 
                // only output media RSS item if its valid media:
                if ( !$mvTitle->doesStreamExist() )return ;
-
+               
+                                               
                // @@todo this should be cached
                $thumb_ref = $mvTitle->getFullStreamImageURL( '320x240', null, 
'', true );
                if ( $desc_html == '' ) {
@@ -570,6 +572,51 @@
                        $desc_html = $wgOut->getHTML();
                        $wgOut->clearHTML();
                }
+               
+               //get the parent meta if allowed:
+               global $mvGetParentMeta;        
+               $pmvd=false;    
+               if( $mvGetParentMeta && strtolower( $mvTitle->getMvdTypeKey() ) 
== 'ht_en'){                    
+                       $pmvd = MV_Index::getParentAnnotativeLayers($mvTitle);  
        
+                       
+                       $pMvTitle =  new MV_Title( $pmvd->wiki_title );
+                       $pAnnoStreamTitle = Title :: MakeTitle( MV_NS_STREAM, 
$pMvTitle->getNearStreamName( 0 ) );
+                       
+                       $parent_clip_desc = 'Parent Clip';
+                       if($pmvd->Speech_by){   
+                               $personTitle = Title :: newFromText( 
$pmvd->Speech_by );
+                               $parent_clip_desc = 'Speech By ' . 
$personTitle->getText();
+                       }
+                       //append to the html output: should be merged with 
getUnifiedResultsHTML stuff
+                       if( $pmvd->wiki_title ){                                
                                                        
+                                       $pMvTitle =  new MV_Title( 
$pmvd->wiki_title );
+                                       $pAnnoStreamLink = Title :: MakeTitle( 
MV_NS_STREAM, $pMvTitle->getNearStreamName( 0 ) );
+                                       $clip_desc_txt = 'Segment';
+                                       if($pmvd->Speech_by){   
+                                               $personTitle = Title :: 
newFromText( $pmvd->Speech_by );
+                                               $clip_desc_txt = 'Speech By ' . 
$personTitle->getText();
+                                       }                                       
+                                               
+                                       $desc_html.='This clip is part of a '. 
seconds2Description ( $pMvTitle->getSegmentDuration() ). ' ' . 
+                                               
$sk->makeKnownLinkObj($pAnnoStreamLink, $clip_desc_txt );
+                                       if($pmvd->category){
+                                               $desc_html.=' <br>Covering: ';
+                                               $coma='';
+                                               foreach($pmvd->category as 
$cat_titlekey ){
+                                                       $cTitle = $cTitle = 
Title :: MakeTitle( NS_CATEGORY, $cat_titlekey );
+                                                       $desc_html .= $coma . 
$sk->makeKnownLinkObj( $cTitle, $cTitle->getText() );
+                                                       $coma=', ';
+                                               }
+                                       }
+                                       if($pmvd->Bill){
+                                               $desc_html.=' <br>Bill: ';      
                                        
+                                               $bTitle = Title :: newFromText( 
$pmvd->Bill );
+                                               $desc_html .= 
$sk->makeKnownLinkObj( $bTitle, $bTitle->getText() );                           
          
+                                       }                                       
+                               }       
+               }
+               
+               
                $desc_xml = '<![CDATA[
                        <center class="mv_rss_view_only">
                                <a href="' . htmlspecialchars( 
$mStreamTitle->getFullUrl() ) . '"><img src="' . $thumb_ref . '" border="0" 
/></a>
@@ -583,6 +630,7 @@
                        
                $type_desc = ( $mvTitle->getMvdTypeKey() ) ? wfMsg( 
$mvTitle->getMvdTypeKey() ):'';
                $time_desc = ( $mvTitle->getTimeDesc() ) ? 
$mvTitle->getTimeDesc():'';
+                               
                ?>
 <item>
 <link>
@@ -612,8 +660,27 @@
 <comments>
 <?php echo mvRSSFeed::xmlEncode( $talkpage->getFullUrl() )?>
 </comments>
+<?php
+//handle any parent clip tag info: 
+if( $pmvd ){ ?>
+       <media:parent_clip label="<?php echo $parent_clip_desc ?>" url="<?php 
echo mvRSSFeed::xmlEncode( $pAnnoStreamTitle->getFullUrl() )  ?>" />
+       <?php if( $pmvd->Bill ){                
+               $bTitle = Title :: newFromText( $pmvd->Bill );
+               ?>
+               <media:bill label="<?php echo $bTitle->getText() ?>" url="<?php 
echo mvRSSFeed::xmlEncode( $bTitle->getFullURL() );?>" />               
+       <?php }
+       if( $pmvd->category ){  
+               foreach($pmvd->category as $cat_titlekey ){ 
+                       $cTitle = $cTitle = Title :: MakeTitle( NS_CATEGORY, 
$cat_titlekey );
+               ?>
+               <media:category label="<?php echo $cTitle->getText() ?> 
url=<?php echo mvRSSFeed::xmlEncode( $cTitle->getFullUrl())  ?>" />
+               <?php
+               }
+       }
+}
+?>
 <media:thumbnail
-       url="<?php echo mvRSSFeed::xmlEncode( $thumb_ref ) ?>" />
+       url="<?php echo mvRSSFeed::xmlEncode( $thumb_ref ) ?>" />       
 <media:roe_embed
        url="<?php echo mvRSSFeed::xmlEncode( $mvTitle->getROEURL() )?>" />
 <media:group>

Modified: 
trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php
===================================================================
--- trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php    
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php    
2009-03-18 23:53:40 UTC (rev 48548)
@@ -345,7 +345,7 @@
                        wfMsg( 'mv_results_found', $rs, $re, number_format( 
$this->numResultsFound ) ) .
                        '</li>';
                }
-               // check order prefrence:
+               // check order
                $prevnext = '';
                // pagging
                if ( $this->numResultsFound > $this->limit ) {
@@ -359,7 +359,7 @@
 
                // force host for script (should be a better way to do this)
                if ( !isset( $_SERVER['HTTP_HOST'] ) )
-                       $_SERVER['HTTP_HOST'] = 'metavid.ucsc.edu';
+                       $_SERVER['HTTP_HOST'] = 'metavid.org';
 
                // make miro link:
                $o .= '<li class="subscribe"><a 
href="http://subscribe.getMiro.com/?url1=' .
@@ -399,6 +399,43 @@
                $o .= ' <ul id="results">';
                foreach ( $this->results as $inx => & $mvd ) {
                        $mvTitle = new MV_Title( $mvd->wiki_title );
+                       
+                       
+                       //get parent meta if requested: 
+                       global $mvGetParentMeta;                                
                
+                       $pmeta_out = '';                
+                       if( $mvGetParentMeta && strtolower( 
$mvTitle->getMvdTypeKey() ) == 'ht_en'){
+                               $pmvd = 
MV_Index::getParentAnnotativeLayers($mvTitle);                          
+                                                               
+                               if( $pmvd->wiki_title ){                        
                                                                
+                                       $pMvTitle =  new MV_Title( 
$pmvd->wiki_title );
+                                       $pAnnoStreamLink = Title :: MakeTitle( 
MV_NS_STREAM, $pMvTitle->getNearStreamName( 0 ) );
+                                       $clip_desc_txt = 'Segment';
+                                       if($pmvd->Speech_by){   
+                                               $personTitle = Title :: 
newFromText( $pmvd->Speech_by );
+                                               $clip_desc_txt = 'Speech By ' . 
$personTitle->getText();
+                                       }                                       
+                                               
+                                       $pmeta_out.='This clip is part of a '. 
seconds2Description ( $pMvTitle->getSegmentDuration() ). ' ' . 
+                                               
$sk->makeKnownLinkObj($pAnnoStreamLink, $clip_desc_txt );
+                                       if($pmvd->category){
+                                               $pmeta_out.='<br>Covering: ';
+                                               $coma='';
+                                               foreach($pmvd->category as 
$cat_titlekey ){
+                                                       $cTitle = $cTitle = 
Title :: MakeTitle( NS_CATEGORY, $cat_titlekey );
+                                                       $pmeta_out .= $coma . 
$sk->makeKnownLinkObj( $cTitle, $cTitle->getText() );
+                                                       $coma=', ';
+                                                       assoc_array_increment( 
$sideBarLinkBucket, 'category', $cat_titlekey );
+                                               }
+                                       }
+                                       if($pmvd->Bill){
+                                               $pmeta_out.='<br>Bill: ';       
                                        
+                                               $bTitle = Title :: newFromText( 
$pmvd->Bill );
+                                               $pmeta_out .= 
$sk->makeKnownLinkObj( $bTitle, $bTitle->getText() );             
+                                               assoc_array_increment( 
$sideBarLinkBucket, 'bill', $pmvd->Bill );                                      
 
+                                       }                                       
+                               }
+                       }                                               
                        $mvd_cnt_links = '';
                        if ( isset ( $mvd->spoken_by ) ) {
                                $ptitle = Title :: MakeTitle( NS_MAIN, 
$mvd->spoken_by );
@@ -433,12 +470,12 @@
                        }
                        // link directly to the current range:
                        //if the clip length is < $mvDefaultClipLength get 
range:
-                       global $mvDefaultClipLength;
-                       if($mvTitle->getDuration() < $mvDefaultClipLength){
+                       global $mvDefaultClipLength;                    
+                       if( $mvTitle->getSegmentDuration() < 
$mvDefaultClipLength){             
                                $mvStreamTitle = Title :: MakeTitle( 
MV_NS_STREAM, $mvTitle->getNearStreamName( $mvDefaultClipRange ) );
                        }else{
-                               $mvStreamTitle = Title :: MakeTitle( 
MV_NS_STREAM, $mvTitle->getNearStreamName( 0 ) );
-                       }
+                               $mvStreamTitle = Title :: MakeTitle( 
MV_NS_STREAM, $mvTitle->getNearStreamName( 0 ) );                          
+                       }                       
                        // $mvTitle->getStreamName() 
.'/'.$mvTitle->getStartTime() .'/'. $mvTitle->getEndTime() );
                        $mvd_text = $mvd->text;
 
@@ -461,12 +498,14 @@
                                        </div>
                                        <div class="result_meta">
                                                <span class="views">Views: ' . 
htmlspecialchars( $mvd->view_count ) . '</span>
-                                               <span class="duration">' . 
wfMsg( 'mv_duration_label' ) . ':' . htmlspecialchars( 
$mvTitle->getSegmentDurationNTP( $short_time = true ) ) . '</span>
-                                               <span 
class="comments">Comments: NYA</span>
+                                               <span class="duration">' . 
wfMsg( 'mv_duration_label' ) . ':' . htmlspecialchars( 
$mvTitle->getSegmentDurationNTP( $short_time = true ) ) . '</span>              
                              
                                                <span class="playinline"><a 
href="javascript:mv_pl(\'' . htmlspecialchars( $mvd->id ) . '\')">' .
                        wfMsg( 'mv_play_inline' ) . '</a></span>
-                                                                               
</div>
-                                                                       </li>';
+                                                                               
</div>';
+                                       if($pmeta_out!=''){
+                                               $o .='<div 
class="parent_meta">'.$pmeta_out.'</div>';
+                                       }
+                                       $o.='</li>';
                }
                $o .= '</ul>';
                // add in prev-next at bottom too:

Modified: trunk/extensions/MetavidWiki/languages/MV_Messages.php
===================================================================
--- trunk/extensions/MetavidWiki/languages/MV_Messages.php      2009-03-18 
23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/languages/MV_Messages.php      2009-03-18 
23:53:40 UTC (rev 48548)
@@ -89,8 +89,11 @@
        'cc_nd_title' => 'No Derivative Works',
        'cc_sa_title' => 'Share Alike',
        'cc_pd_title' => 'Public Domain',
-               
+       'unknown_license' => 'Unknown License',
 
+       'no_import_by_url' => 'This User or Wiki <b>can not</b> import assets 
via URLs. <br> 
+                                                       If permissions are 
correct; you may have to enable $wgAllowCopyUploads, <a 
href="http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads";>more info</a>"',
+
        # mvClipEdit.js
        'mv_crop' => 'Crop image',
        'mv_apply_crop' => 'Apply crop to image',
@@ -439,11 +442,11 @@
        'mv_export_cmml' => 'Export cmml',
        #'mv_search_stream' => 'Search stream', # duplicate
        'mv_navigate_stream' => 'Navigate full stream',
-       'mv_stream_overview' => 'stream overview',
-       'mv_edit_time' => 'edit time',
+       'mv_stream_overview' => 'Stream Overview',
+       'mv_edit_time' => 'Edit Time',
        'mv_embed_options' => 'Embed options',
        'mv_overlay' => 'Overlay controls',
-       'mv_stream_tool_heading' => 'Stream tools',
+       'mv_stream_tool_heading' => 'Stream Tools',
        'mv_tool_missing' => 'requested tool does not exist',
        'mv_bad_tool_request' => 'bad tool line should be form: 
tool_name|tool_display_name',
        #'mv_update_layers' => 'update layers view', # duplicate

Modified: trunk/extensions/MetavidWiki/skins/mv_custom.css
===================================================================
--- trunk/extensions/MetavidWiki/skins/mv_custom.css    2009-03-18 23:41:19 UTC 
(rev 48547)
+++ trunk/extensions/MetavidWiki/skins/mv_custom.css    2009-03-18 23:53:40 UTC 
(rev 48548)
@@ -9,10 +9,6 @@
  *
  * extended styles for metavid extension
  */
-/*annotative layers */
-.anno_en{
-       background:#DDD;
-} 
 .mvd_page_image{
        float:left;
        padding-right:5px;

Modified: 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js
===================================================================
--- 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js   
    2009-03-18 23:41:19 UTC (rev 48547)
+++ 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js   
    2009-03-18 23:53:40 UTC (rev 48548)
@@ -541,7 +541,7 @@
                }, function(data){                      
                        for( var i in data.query.userinfo.rights){              
                                var right = data.query.userinfo.rights[i];
-                               js_log('checking: ' + right ) ;                 
+                               //js_log('checking: ' + right ) ;               
        
                                if(right == 'upload_by_url'){
                                        callback( true );                       
        
                                        return true; //break out of the function
@@ -749,15 +749,15 @@
                        //also set the animated image if avaliable 
                        var res_id = 
$j(this).children('.rsd_res_item').attr('id');
                        var rObj = _this.getResourceFromId( res_id );
-                       if( rObj.poster_ani )
-                               $j('#' + res_id ).attr('src', rObj.poster_ani);
-                       
+                       if( rObj.poster_ani )                           
+                               $j('#' + res_id ).attr('src', rObj.poster_ani); 
                
                },function(){
                        
$j(this).removeClass('mv_clip_'+_this.result_display_mode+'_result_over');      
                        var res_id = 
$j(this).children('.rsd_res_item').attr('id');
                        var rObj = _this.getResourceFromId( res_id );   
                        //restore the original (non animated)
-                       $j('#' + res_id ).attr('src', rObj.poster);
+                       if( rObj.poster_ani )
+                               $j('#' + res_id ).attr('src', rObj.poster);
                });                             
                //resource click action: (bring up the resource editor)         
        
                $j('.rsd_res_item').unbind().click(function(){  
@@ -908,6 +908,8 @@
                        );      
                        //rewrite by id handldes getting any libs we are 
missing:               
                        rewrite_by_id('embed_vid',function(){
+                               //hide the rsd_edit_img: 
+                               $j('#rsd_edit_img').hide();
                                //grab any information that we got from the ROE 
xml or parsed from the media file
                                rObj = rObj.pSobj.getEmbedObjParsedInfo( rObj, 
'embed_vid' );                                   
                                //add the re-sizable to the doLoad request: 
@@ -937,7 +939,7 @@
                }
                
        },
-       checkImportResource:function( rObj, cir_callback){
+       checkImportResource:function( rObj, cir_callback){              
                //@@todo get the localized File/Image namespace name or do a 
general {NS}:Title aproch
                var cp = rObj.pSobj.cp; 
                var _this = this;
@@ -1196,6 +1198,7 @@
                );      
        },      
        insertResource:function( rObj){         
+               js_log('insertResource: ' + rObj.title);
                var _this = this
                this.checkImportResource( rObj, function(){
                        _this.updatePreviewText( rObj );

Modified: 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/archiveOrgSearch.js
===================================================================
--- 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/archiveOrgSearch.js
      2009-03-18 23:41:19 UTC (rev 48547)
+++ 
trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/archiveOrgSearch.js
      2009-03-18 23:53:40 UTC (rev 48548)
@@ -55,27 +55,24 @@
                        this.num_results = data.response.numFound;
                
                        for(var resource_id in data.response.docs){
-                               var resource = data.response.docs[resource_id];
-                               //make sure the reop is shared
-                               rObj = {
-                                       'titleKey'       :resource.identifier,
-                                       'link'           
:'http://www.archive.org/details/' + resource.identifier,                       
       
-                                       'title'          :resource.title
-                               };                      
-                               
rObj['poster']='http://www.archive.org/download/' + 
resource.identifier+'/format=thumbnail';
-                               
rObj['poster_ani']='http://www.archive.org/download/' + 
resource.identifier+'/format=Animated+Gif';
+                               var resource = data.response.docs[resource_id]; 
                        
+                               var rObj = {
+                                       'titleKey'       : resource.identifier,
+                                       'link'           : 
'http://www.archive.org/details/' + resource.identifier,                        
     
+                                       'title'          : resource.title,
+                                       'poster'         : 
'http://www.archive.org/download/' + resource.identifier+'/format=thumbnail',
+                                       'poster_ani' : 
'http://www.archive.org/download/' + resource.identifier+'/format=Animated+Gif',
+                                       'thumbwidth' : 160,
+                                       'thumbheight': 110,                     
+                                       'desc'           : resource.description,
+                                       'src'            : 
'http://www.archive.org/download/' + resource.identifier+'/format=Ogg+video',
+                                       'mime'           : 'application/ogg',
+                                       //set the licence: (rsd is a pointer to 
the parent remoteSearchDriver )                 
+                                       'license'        : 
this.rsd.getLicenceFromUrl( resource.licenseurl ),
+                                       'pSobj'          :_this
+                               };                                              
                                                                                
                                                                                
+                               this.resultsObj[ resource_id ] = rObj;
                                
-                               rObj['thumbwidth']=160;
-                               rObj['thumbheight']=110;                        
        
-                               rObj['src']='http://www.archive.org/download/' 
+ resource.identifier+'/format=Ogg+video';
-                               rObj['mime']='application/ogg';
-                               rObj['pSobj']=_this;                            
-                               
-                               //set the licence: (rsd is a pointer to the 
parent remoteSearchDriver ) 
-                               rObj['license'] = this.rsd.getLicenceFromUrl( 
resource.licenseurl );                                                          
   
-                               
-                               this.resultsObj[ resource_id ] =rObj;
-                               
                                //likely a audio clip if no poster and type 
application/ogg 
                                //@@todo we should return audio/ogg for the 
mime type or some other way to specify its "audio" 
                                                

Modified: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js
===================================================================
--- trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js       
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js       
2009-03-18 23:53:40 UTC (rev 48548)
@@ -309,26 +309,29 @@
        },
        setUpVideoCtrl:function(){
                js_log('setUpVideoCtrl:f');
-               var this_seq = this;
+               var _this = this;
                var eb = $j('#embed_vid').get(0);
                //turn on preview to avoid onDone actions
                eb.preview_mode = true;
                $j('#'+this.control_ct).html('<h3>Edit Video Tools:</h3>');
                if( eb.supportsURLTimeEncoding() ){                     
                        $j('#'+this.control_ct).append( 
-                               this_seq.getSetInOut({
+                               _this.getSetInOut({
                                        'start_ntp'     : eb.start_ntp, 
                                        'end_ntp'       : eb.end_ntp            
                                }) 
                        );
-                       this_seq.setInOutBindings();                    
+                       _this.setInOutBindings();                       
                }
                $j('#'+this.control_ct).append( this.getInsertDesc() );
                
-               $j('#'+this.control_ct).append( '<b>Remote Clip inserts not yet 
supported</b>' +
-                       '<a href="#" class="mv_cancel_img_edit" title="' + 
gM('mv_cancel_image_insert')+'">' + gM('mv_cancel_image_insert') + '</a> ');    
                             
-               //$j('#'+this.control_ct).append( this.getInsertDesc() + 
this.getInsertAction() );                              
-               
+               if( _this.p_rsdObj && _this.p_rsdObj.import_url_mode == 'none'){
+                       // in theory this code should never run since we should 
nto get past the repository checks 
+                       $j('#'+this.control_ct).append(  gM('no_import_by_url') 
+ '<br>' +                      
+                               '<a href="#" class="mv_cancel_img_edit" 
title="' + gM('mv_cancel_image_insert')+'">' + gM('mv_cancel_image_insert') + 
'</a> ' );
+               }else{                                                          
                
+                       $j('#'+this.control_ct).append(  this.getInsertAction() 
);
+               }                                               
                this.applyInsertControlBindings();
        },
        setInOutBindings:function(){
@@ -387,6 +390,7 @@
                                '<a href="#" class="mv_cancel_img_edit" 
title="' + gM('mv_cancel_image_insert')+'">' + gM('mv_cancel_image_insert') + 
'</a> ';
        },
        applyEdit:function(){
+               js_log('applyEdit::' + this.media_type);
                if(this.media_type == 'image'){
                        this.applyCrop();
                }else if(this.media_type == 'video'){
@@ -401,10 +405,11 @@
                        _this.rObj['inlineDesc']= 
$j('#mv_inline_img_desc').val();
                        _this.p_rsdObj.insertResource( _this.rObj );
                });
-               $j('.mv_preview_insert').click(function(){
+               $j('.mv_preview_insert').click(function(){              
                        _this.applyEdit();
                        //copy over the desc text to the resource object
                        _this.rObj['inlineDesc']= 
$j('#mv_inline_img_desc').val();
+                       js_log('going to call previewResource on rObj');
                        _this.p_rsdObj.previewResource( _this.rObj );
                });
                $j('.mv_cancel_img_edit').click( function(){
@@ -452,17 +457,16 @@
                this.applyInsertControlBindings();
        },
        applyVideoAdj:function(){               
+               js_log('applyVideoAdj::');              
                //update video related keys             
                this.rObj['start_time'] = $j('#mv_start_hr_rsd').val();
                this.rObj['end_time'] = $j('#mv_end_hr_rsd').val();
-               //select the ogg stream         
-               if( this.rObj.pSobj.cp.stream_import_key && this.rObj.roe_url){ 
                
+               //if the video is "roe" based select the ogg stream             
+               if( this.rObj.roe_url && this.rObj.pSobj.cp.stream_import_key){ 
                
                        var source = 
$j('#embed_vid').get(0).media_element.getSourceById( 
this.rObj.pSobj.cp.stream_import_key );
                        this.rObj['src'] = source.getURI();
                        js_log("g src_key: " + 
this.rObj.pSobj.cp.stream_import_key + ' src:' + this.rObj['src']) ;
-               }
-               //update the title: 
-               this.rObj['title'] = ' updated title';
+               }               
        },
        applyCrop:function(){
                var _this = this;

Modified: 
trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js
===================================================================
--- trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js     
2009-03-18 23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js     
2009-03-18 23:53:40 UTC (rev 48548)
@@ -547,14 +547,14 @@
                return this.sources;
         //apply mime filter: 
                var source_set = new Array();
-        for(var i=0; i < this.sources; i++){
+        for(var i=0; i < this.sources.length ; i++){
                if( this.sources[i].mime_type.indexOf( mime_filter ) != -1 )
                        source_set.push( this.sources[i] );
         }
         return source_set;
     },
-    getSourceById:function( source_id ){
-       for(var i=0; i < this.sources; i++){
+    getSourceById:function( source_id ){       
+       for(var i=0; i < this.sources.length ; i++){
                if( this.sources[i].id ==  source_id)
                        return this.sources[i];
        }

Modified: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
===================================================================
--- trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js     2009-03-18 
23:41:19 UTC (rev 48547)
+++ trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js     2009-03-18 
23:53:40 UTC (rev 48548)
@@ -1130,30 +1130,28 @@
                loadExternalJs( req_url );                              
        }       
 }
-//do a "normal" request (should be depriecated via extending the mediaWiki 
API) 
-function do_request(req_url, callback){        
-       //pass along a unique inentifier if set
-       js_log('do request: ' + req_url);
-               //if we are doing a request to the same domain or relative link 
do a normal GET: 
-               if( parseUri(document.URL).host == parseUri(req_url).host ||
-                       req_url == parseUri( req_url).host ){ //relative url
-                       //do a direct request:
-                       $j.ajax({
-                               type: "GET",
-                               url:req_url,
-                async: false,
-                               success:function(data){         
-                                       callback( data );
-                               }
-                       });
-               }else{                                          
-                       //get data via DOM injection with callback
-                       global_req_cb.push(callback);
-                       //prepend json_ to feed_format if not already 
requesting json format
-                       if( req_url.indexOf("feed_format=")!=-1 &&  
req_url.indexOf("feed_format=json")==-1)
-                               req_url = req_url.replace(/feed_format=/, 
'feed_format=json_');                                                           
                                      
-                       
loadExternalJs(req_url+'&cb=mv_jsdata_cb&cb_inx='+(global_req_cb.length-1));    
                
-               }
+//do a "normal" request 
+function do_request(req_url, callback){                        
+       //if we are doing a request to the same domain or relative link do a 
normal GET: 
+       if( parseUri(document.URL).host == parseUri(req_url).host ||
+               req_url == parseUri( req_url).host ){ //relative url
+               //do a direct request:
+               $j.ajax({
+                       type: "GET",
+                       url:req_url,
+               async: false,
+                       success:function(data){         
+                               callback( data );
+                       }
+               });
+       }else{                                          
+               //get data via DOM injection with callback
+               global_req_cb.push(callback);
+               //prepend json_ to feed_format if not already requesting json 
format
+               if( req_url.indexOf("feed_format=")!=-1 &&  
req_url.indexOf("feed_format=json")==-1)
+                       req_url = req_url.replace(/feed_format=/, 
'feed_format=json_');                                                           
                                      
+               
loadExternalJs(req_url+'&cb=mv_jsdata_cb&cb_inx='+(global_req_cb.length-1));    
                
+       }
 }
 function mv_jsdata_cb(response){
        js_log('f:mv_jsdata_cb:'+ response['cb_inx']);

Modified: trunk/extensions/MetavidWiki/skins/mv_stream.js
===================================================================
--- trunk/extensions/MetavidWiki/skins/mv_stream.js     2009-03-18 23:41:19 UTC 
(rev 48547)
+++ trunk/extensions/MetavidWiki/skins/mv_stream.js     2009-03-18 23:53:40 UTC 
(rev 48548)
@@ -179,11 +179,13 @@
        },
        oddEvenPaint:function(){
                //remove existing class:
-               $j('.mv_fd_mvd').removeClass("odd").removeClass("even");
-               $j('.mv_fd_mvd:odd').addClass("odd");
-               $j('.mv_fd_mvd:even').addClass("even");         
+               
$j('.mv_fd_mvd:not(.anno_en)').removeClass("odd").removeClass("even");
+               $j('.mv_fd_mvd:odd').filter(':not(.anno_en)').addClass("odd");
+               
$j('.mv_fd_mvd:even').filter(':not(.anno_en)').addClass("even");                
                //remove odd/even class for annoative layer: 
-               $j('.anno_en').removeClass("odd").removeClass("even");
+               $j('.anno_en:odd').addClass("anno_en_odd")
+               $j('.anno_en:even').addClass("anno_en_even");
+               //add annotative odd even collor: 
        },
        addHoverHooks:function(selector){
                this_stream=this;



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to