r44488 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44487‎ | r44488 | r44489 >
Date:01:21, 12 December 2008
Author:dale
Status:deferred
Tags:
Comment:
some basic fixes
improved stubs for remote media search
Modified paths:
  • /trunk/extensions/MetavidWiki/MV_LocalSettings.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Hooks.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_SequenceTools.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/external_media_wizard.js (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_allpages.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_htmlEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clip_edit.js (deleted) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_logo_80.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/metavid_logo_100.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/wiki_commons_logo_80.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/MV_LocalSettings.php
@@ -11,6 +11,7 @@
1212 $mvExternalImages = true;
1313 $mvExternalImgServerPath = 'http://metavid.org/wiki/index.php';
1414
 15+$mvgJSDebug=true;
1516 // for sunlight network annalysis we include google analytics
1617 /*$mvExtraHeader = '<script type="text/javascript">
1718 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -6,7 +6,7 @@
77 * for more info visit http://metavid.org/wiki/Code
88 *
99 */
10 -define( 'MV_VERSION', '1.0rc2' );
 10+define( 'MV_VERSION', '1.0r44460' );
1111
1212 if ( !defined( 'MEDIAWIKI' ) ) die( 1 );
1313
@@ -45,16 +45,14 @@
4646 function mvSetupExtension() {
4747 global $mvVersion, $mvNamespace, $mvgIP, $wgHooks, $wgExtensionCredits, $mvMasterStore,
4848 $wgParser, $mvArticlePath, $mvgScriptPath, $wgServer, $wgExtensionFunctions, $markerList,$wgVersion,
49 - $wgAjaxExportList, $mvEnableAutoComplete, $mvEnableJSLinkBack, $mvEnableJSMVDrewrite,
 49+ $wgAjaxExportList, $mvEnableAutoComplete, $mvEnableJSMVDrewrite,
5050 $wgAutoloadClasses, $wgSpecialPages, $wgMediaHandlers,
5151 $wgAPIModules;
5252
5353
5454 mvfInitMessages();
55 - // add header for autoComplete if enabled:
56 - if ( $mvEnableAutoComplete || $mvEnableJSLinkBack || $mvEnableJSMVDrewrite ) {
57 - mvfAutoAllPageHeader();
58 - }
 55+ //add the ALL page header
 56+ mvfAutoAllPageHeader();
5957
6058 /********************************
6159 * Ajax Hooks
@@ -291,19 +289,28 @@
292290 * enables linkback and autocomplete for search
293291 */
294292 function mvfAutoAllPageHeader() {
295 - global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle;
 293+ global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle, $mvgJSDebug;
296294 $mvgScriptPath = htmlspecialchars( $mvgScriptPath );
297 - $wgJsMimeType = htmlspecialchars( $wgJsMimeType ) ;
 295+ $wgJsMimeType = htmlspecialchars( $wgJsMimeType ) ;
 296+ //set the unquie request value
 297+ if( $mvgJSDebug ){
 298+ $unique_req_param = time();
 299+ }else{
 300+ $unique_req_param = MV_VERSION;
 301+ }
 302+
298303 /* (moved to on_dom ready) but here as well*/
299 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js\"></script>" );
300 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js\"></script>" );
301 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js\"></script>" );
 304+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js?{$unique_req_param}\"></script>" );
 305+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js?{$unique_req_param}\"></script>" );
 306+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js?{$unique_req_param}\"></script>" );
302307
303 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js\"></script>" );
304 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_allpages.js\"></script>" );
305 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js\"></script>" );
306 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_common.js\"></script>" );
 308+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js?{$unique_req_param}\"></script>" );
 309+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_allpages.js?{$unique_req_param}\"></script>" );
 310+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js?{$unique_req_param}\"></script>" );
 311+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_common.js?{$unique_req_param}\"></script>" );
307312
 313+ //temp for testing:
 314+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/external_media_wizard.js?{$unique_req_param}\"></script>" );
308315
309316 $mvCssUrl = $mvgScriptPath . '/skins/mv_custom.css';
310317 $wgOut->addLink( array(
@@ -328,78 +335,7 @@
329336 global $mvGlobalJSVariables;
330337 $vars = array_merge($vars, $mvGlobalJSVariables);
331338 return true;
332 -}
333 -
334 - /**
335 - * This method is in charge of inserting additional CSS, JScript, and meta tags
336 - * into the html header of each page. It is called by pages
337 - * that will be embedding video or use metavid interfaces
338 - *
339 - * @@todo split up embed js & interface js include calls
340 - *
341 - * $out is the modified OutputPage.
342 - */
343 - /*function mvfAddHTMLHeader( $head_set = '' ) {
344 - global $mvgHeadersInPlace; // record whether headers were created already (don't call mvfAddHTMLHeader twice)
345 - global $mvgArticleHeadersInPlace; // record whether article name specific headers are already there
346 - global $mvgScriptPath, $wgJsMimeType, $wgOut , $mvEnableAutoComplete, $mvEnableJSLinkBack, $mvEnableJSMVDrewrite;
347 -
348 - print "HEAD SET:$head_set ";
349 - die;
350 - if ( !$mvgHeadersInPlace ) {
351 - // all sets use mv_common script: *not used much yet*
352 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_common.js\"></script>" );
353 - //we always want mv_embed (for metavid pages) (should be cached)
354 - if ( $head_set == 'smw_ext' || $head_set == 'search' || $head_set == 'sequence' || $head_set == 'stream_interface' || $head_set == 'embed' ) {
355 - if ( !( $mvEnableAutoComplete || $mvEnableJSLinkBack || $mvEnableJSMVDrewrite ) ) {
356 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js\"></script>" );
357 - }
358 - }
359 -
360 - if( $head_set == 'sequence' ){
361 - //add the sequence page helper
362 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_sequence_page.js\"></script>" );
363 - }
364 -
365 - if ( $head_set == 'search' )
366 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js\"></script>" );
367 - if ( $head_set == 'sequence' )
368 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_sequence.js\"></script>" );
369 - if ( $head_set == 'stream_interface' )
370 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_stream.js\" ></script>" );
371 - // if($head_set=='smw_ext')
372 - // $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_smw_ext.js\" ></script>");
373 -
374 - if ( !( $mvEnableAutoComplete || $mvEnableJSLinkBack ) ) {
375 - $mvCssUrl = $mvgScriptPath . '/skins/mv_custom.css';
376 - $wgOut->addLink( array(
377 - 'rel' => 'stylesheet',
378 - 'type' => 'text/css',
379 - 'media' => 'all',
380 - 'href' => $mvCssUrl
381 - ) );
382 - }
383 - // add extra IE styles fixes
384 - $wgOut->addScript( '<!--[if IE 7]>' .
385 - '<style type="text/css">@import "' . $mvgScriptPath . '/skins/mv_customIE6.css";</style>' .
386 - '<![endif]--> ' .
387 - '<!--[if IE 6]>' .
388 - '<style type="text/css">@import "' . $mvgScriptPath . '/skins/mv_customIE6.css";</style>' .
389 - '<![endif]-->'
390 - );
391 - // add extra safari sheet
392 - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\">
393 -if(navigator.userAgent.toLowerCase().indexOf('safari')!=-1){
394 - document.write('<style type=\"text/css\">@import \"{$mvgScriptPath}/skins/mv_customSafari.css\";</style>');
395 -}
396 -</script>" );
397 - // add in the semantic wiki css if in stream interface
398 - if ( $head_set == 'stream_interface' )
399 - $wgOut->addScript( '<link rel="stylesheet" type="text/css" media="screen, projection" href="https://www.mediawiki.org/mvWiki/extensions/SemanticMediaWiki/skins/SMW_custom.css" />' );
400 - $mvgHeadersInPlace = true;
401 - }
402 - return true; // always return true, in order not to stop MW's hook processing!
403 - }*/
 339+}
404340 /**
405341 * Init the additional namepsaces used by Metavid MediaWiki. The
406342 * parameter denotes the least unused even namespace ID that is
@@ -517,7 +453,6 @@
518454 }
519455 }
520456
521 -
522457 /*
523458 * Utility functions:
524459 */
@@ -878,6 +813,4 @@
879814 return wfMsg( 'mv_viewprevnext', $plink, $nlink );
880815 }
881816 }
882 -
883 -
884817 ?>
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php
@@ -24,10 +24,7 @@
2525 // (causes the inclution of jquery into every page.. can slow things down a bit)
2626 $mvEnableAutoComplete = true;
2727
28 -// if you want every page have the little powered by metavid software link
29 -// (note this is done with javascript rewrite client side to avoid complicated skin
30 -// (normally you could just add it to your site skin)
31 -$mvEnableJSLinkBack = true;
 28+$mvgJSDebug=false;
3229
3330 // if you want mvd links to be rewritten client side as inline movie clips and link to the stream page
3431 $mvEnableJSMVDrewrite = true;
Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php
@@ -65,7 +65,7 @@
6666 }
6767 }else if( !in_array( 'known', $options ) ){
6868 $options[]='known';
69 - }
 69+ }
7070 }
7171 }
7272 return true;
@@ -117,29 +117,19 @@
118118 }
119119 }
120120 }
121 - if( substr( $title->getText(), 0, strlen($mvEmbedKey) ) == $mvEmbedKey ){
122 - $mvTitle = new MV_Title( substr( $title->getText(), strlen($mvEmbedKey)+1) );
123 - $ret = $mvTitle->getEmbedVideoHtml( array( 'size'=>$size, 'showmeta'=>true ) );
124 - return false;
125 - }
126 - //strait Stream links are not the best to rewrite right now since there are lots of "stream" links
127 - /*if( $title->getNamespace() == MV_NS_STREAM ){
128 - //parse the stream title:
129 - $mvTitle = new MV_Title($title);
130 - if ( !$mvTitle->getStartTime() || !$mvTitle->getEndTime() ) {
131 - if($start_ntp)
132 - $mvTitle->setStartTimeNtp( $start_ntp );
133 - if($end_ntp)
134 - $mvTitle->setEndTimeNtp( $end_ntp );
 121+
 122+ if( substr( $title->getText(), 0, strlen($mvEmbedKey) ) == $mvEmbedKey){
 123+ $resourceTitle = Title::newFromText( substr( $title->getText(), strlen($mvEmbedKey)+1) );
 124+ if( $resourceTitle->getNamespace() == MV_NS_STREAM){
 125+ $mvTitle = new MV_Title( $resourceTitle );
 126+ $ret = $mvTitle->getEmbedVideoHtml( array( 'size'=>$size, 'showmeta'=>true ) );
135127 }
136 - $ret = $mvTitle->getEmbedVideoHtml( array( 'size'=>$size, 'showmeta'=>true ) );
 128+ if( $resourceTitle->getNamespace() == MV_NS_SEQUENCE){
 129+ $seqPlayer = new MV_SequencePlayer($resourceTitle);
 130+ $ret = $seqPlayer->getEmbedSeqHtml( array( 'size'=>$size ) );
 131+ }
137132 return false;
138 - } */
139 - if( $title->getNamespace() == MV_NS_SEQUENCE ){
140 - $seqPlayer = new MV_SequencePlayer($title);
141 - $ret = $seqPlayer->getEmbedSeqHtml( array( 'size'=>$size ) );
142 - return false;
143 - }
 133+ }
144134 return true;
145135 }
146136 function mvAddToolBoxLinks(){
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_SequenceTools.php
@@ -110,11 +110,11 @@
111111 // grab a de-encapsulated search with prefix
112112 $wgOut->addHTML( '<h3>'. wfMsg('mv_resource_locator') . '</h3>' );
113113 //add the input form
114 - $wgOut->addHTML(
115 - xml::input('mv_ams_search', 255,'', array( 'id' => 'mv_ams_search' , 'class' => 'searchField' )) .
 114+ /*$wgOut->addHTML(
 115+ xml::input('mv_ams_search', 50,'', array( 'id' => 'mv_ams_search' , 'class' => 'searchField' )) .
116116 xml::submitButton( wfMsg('mv_media_search'), array('id'=>'mv_ams_submit') ) .
117117 xml::element('div',array('id'=>'mv_ams_results'))
118 - );
 118+ );*/
119119 }
120120 function add_editor_options(){
121121 global $wgOut;
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js
@@ -7,7 +7,7 @@
88 }else{
99 var base_roe_url='';
1010 }
11 -//foce wgScript path for blog support
 11+//force wgScript path for blog support
1212 if(typeof wgScript=='undefined')
1313 var wgScript = "/w/index.php";
1414
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -97,7 +97,8 @@
9898 org_vid_title = $j('#mv_stream_time').html();
9999 if( $j('#embed_vid').length==0 || !$j('#embed_vid').get(0).ready_to_play){
100100 //no embed video present stop init
101 - return js_log('no clip ready to play');
 101+ js_log('no clip ready to play');
 102+ return false;
102103 }
103104 org_vid_time_req = $j('#embed_vid').get(0).getTimeReq();
104105 org_thum_src = $j('#embed_vid').get(0).thumbnail;
Index: trunk/extensions/MetavidWiki/skins/external_media_wizard.js
@@ -0,0 +1,51 @@
 2+//add media wizard integration for mediaWiki
 3+
 4+//to support remote media searching.
 5+
 6+var mv_embed_url = 'http://localhost/wiki/extensions/MetavidWiki/skins/mv_embed/mv_embed.js';
 7+
 8+//check if we are on a edit page:
 9+if(wgAction=='edit'){
 10+ //add onPage ready request:
 11+ addOnloadHook( function(){
 12+ var toolbar = document.getElementById("toolbar");
 13+ toolbar.innerHTML = toolbar.innerHTML + ''+
 14+ '<img src="http://upload.wikimedia.org/wikipedia/commons/8/86/Button_add_media.png" '+
 15+ 'style="cursor:pointer;" ' +
 16+ 'onClick="mv_do_load_wiz()" />';
 17+ });
 18+}
 19+function mv_do_load_wiz(){
 20+ //show the loading screen:
 21+ var body_elm = document.getElementsByTagName("body")[0];
 22+ body_elm.innerHTML = body_elm.innerHTML + ''+
 23+ '<div id="modalbox" style="background:#DDD;border:3px solid #666666;'+
 24+ 'height:90%;left:10%;position:fixed;top:5%;width:80%;z-index:100;">'+
 25+
 26+ 'loading external media wizard<blink>...</blink>'+
 27+
 28+ '</div>'+
 29+ '<div style="background:#000;cursor:wait;height:100%;left:0;position:fixed;'+
 30+ 'top:0;width:100%;z-index:5;filter:alpha(opacity=60);-moz-opacity: 0.6;'+
 31+ 'opacity: 0.6;"/>';
 32+ //inject mv_embed
 33+ if( typeof MV_EMBED_VERSION == 'undefined'){
 34+ var e = document.createElement("script");
 35+ e.setAttribute('src', mv_embed_url);
 36+ e.setAttribute('type',"text/javascript");
 37+ document.getElementsByTagName("head")[0].appendChild(e);
 38+ setTimeout('check_for_mv_embed();', 25);
 39+ }else{
 40+ check_for_mv_embed();
 41+ }
 42+}
 43+function check_for_mv_embed(){
 44+ if( typeof MV_EMBED_VERSION == 'undefined'){
 45+ setTimeout('check_for_mv_embed();', 25);
 46+ }else{
 47+ mv_do_remote_search({
 48+ 'target_id':'modalbox',
 49+ 'profile':'mediawiki_edit'
 50+ });
 51+ }
 52+}
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clip_edit.js
@@ -1,16 +0,0 @@
2 -/*
3 -hanndles clip edit controls
4 - 'inoutpoints':0, //should let you set the in and out points of clip
5 - 'panzoom':0, //should allow setting keyframes and tweening modes
6 - 'overlays':0, //should allow setting "locked to clip" overlay tracks
7 - 'audio':0 //should allow controling the audio volume (with keyframes)
8 -*/
9 -
10 -var mvClipEdit = function(initObj) {
11 - return this.init(initObj);
12 -};
13 -mvClipEdit.prototype = {
14 - init:function( initObj){
15 - //setup the clip editor
16 - }
17 -}
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js
@@ -51,6 +51,17 @@
5252 gMsg['clip_in'] = 'clip in';
5353 gMsg['clip_out'] = 'clip out';
5454
 55+//menu items display helper:
 56+gMsg['mv_welcome_to_sequencer'] = '<h3>Welcome to the sequencer demo</h3>'+
 57+'very <b>limited</b> functionality right now. Click on a Clip to edit that resource';
 58+
 59+gMsg['mv_editor_options'] = 'Editor options';
 60+gMsg['mv_editor_mode'] = 'Editor mode';
 61+gMsg['mv_simple_editor_desc'] = 'simple editor (iMovie style)';
 62+gMsg['mv_advanced_editor_desc'] = 'advanced editor (Final Cut style)';
 63+gMsg['mv_other_options'] = 'Other Options';
 64+gMsg['mv_contextmenu_opt'] = 'Enable Context Menus';
 65+
5566 //used to set default values and validate the passed init object
5667 var sequencerDefaultValues = {
5768
@@ -72,8 +83,8 @@
7384 track_thumb_height:60,
7485 track_text_height:20,
7586
76 - //default timeline mode: "clip" (i-movie like) or "time" (finalCut like)
77 - timeline_mode:'clip',
 87+ //default timeline mode: "story" (i-movie like) or "time" (finalCut like)
 88+ timeline_mode:'storyboard',
7889
7990 track_clipThumb_height:80, // how large are the i-movie type clips
8091
@@ -103,27 +114,66 @@
104115 };
105116 //set up the mvSequencer object
106117 mvSequencer.prototype = {
 118+ //the menu_items Object contains: default html, js setup/loader functions
107119 menu_items : {
108120 'clipedit':{
109121 'd':1,
110122 'submenu':{
111 - 'fileopts':1,
112 - 'inoutpoints':0,
113 - 'panzoom':0,
114 - 'overlays':0,
115 - 'audio':0
116 - }
 123+ 'fileopts':{},
 124+ 'inoutpoints':{},
 125+ 'panzoom':{},
 126+ 'overlays':{},
 127+ 'audio':{}
 128+ },
 129+ 'html': getMsg('mv_welcome_to_sequencer')
117130 },
118131 'cliplib':{
119 - 'd':0
 132+ 'd':0,
 133+ 'html': getMsg('loading_txt'),
 134+ 'js':function( this_seq ){
 135+ //load the search interface with sequence tool targets
 136+ mvJsLoader.doLoad({'mediaWikiRemoteSearch':'libRemoteMediaSearch/mv_remote_media_search.js'}, function(){
 137+ this_seq.mySearch = new remoteSearchDriver({
 138+ 'profile':'sequence',
 139+ 'p_seq':this_seq,
 140+ 'target_id':'cliplib_ic'
 141+ });
 142+ });
 143+ }
120144 },
121145 'transition':{
122 - 'd':0
 146+ 'd':0,
 147+ 'html' : '<h3>' + getMsg('menu_transition') + '</h3>',
 148+ 'js':function(this_seq){
 149+ this_seq.renderTransitionsSet('transition_ic');
 150+ }
123151 },
124152 'options':{
125 - 'd':0
 153+ 'd':0,
 154+ 'html' : '<h3>' + getMsg('menu_options') + '</h3>' +
 155+ getMsg('mv_editor_mode') + '<br> ' +
 156+ '<blockquote><input type="radio" value="simple_editor" name="opt_editor">' +
 157+ getMsg('mv_simple_editor_desc') + ' </blockquote>' +
 158+ '<blockquote><input type="radio" value="advanced_editor" name="opt_editor">' +
 159+ getMsg('mv_advanced_editor_desc') + ' </blockquote>'+
 160+ getMsg('mv_other_options') + '<br>' +
 161+ '<blockquote><input type="checkbox" value="contextmenu_opt" name="contextmenu_opt">' +
 162+ getMsg('mv_contextmenu_opt') + ' </blockquote>',
 163+ 'js':function(this_seq){
 164+ $j('#options_ic input[value=\'simple_editor\']').attr({
 165+ 'checked':(this_seq.timeline_mode=='storyboard')?true:false
 166+ }).click(function(){
 167+ this_seq.doSimpleTl();
 168+ });
 169+ $j('#options_ic input[value=\'advanced_editor\']').attr({
 170+ 'checked':( this_seq.timeline_mode=='time' )?true:false
 171+ }).click(function(){
 172+ this_seq.doAdvancedTl();
 173+ });
 174+ //set up the options for context menus
 175+ }
126176 }
127 - },
 177+ },
128178
129179 //set up initial key states:
130180 key_shift_down:false,
@@ -225,7 +275,8 @@
226276 },
227277 //display a menu item (hide the rest)
228278 disp:function( item ){
229 - js_log('disp: ' + item);
 279+ js_log('menu_item disp: ' + item);
 280+
230281 for(var i in this.menu_items){
231282 if(i==item){
232283 $j('#'+i+'_ic').fadeIn("fast");
@@ -234,104 +285,20 @@
235286 }
236287 }
237288 },
238 - //load the menu items:
239 - loadInitMenuItems:function(){
 289+ //setup the menu items:
 290+ setupMenuItems:function(){
240291 js_log('loadInitMenuItems');
241292 if( !this.plObj.interface_url ){
242293 js_log( 'Error:missing interface_url, can not load item' );
243294 return false;
244 - }
245 -
246 - var req_url =this.plObj.interface_url+ '?action=ajax&rs=mv_seqtool_disp&rsargs[]=';
247 - //ouput the requested items list:
248 - for(var i in this.menu_items){
249 - req_url+='|'+i;
250 - //if single items set to loading:
251 - if(typeof this.menu_items[i].submenu == 'undefined')
252 - $j('#'+i+'_ic').html( getMsg('loading_txt') );//set targets to loading
253 - //else set the default sub menu to loading:
254 - for(var j in this.menu_items[i].submenu){
255 - if(this.menu_items[i].submenu[j])
256 - $j('#sc_'+j).html( getMsg('loading_txt') );
257 - }
258 - }
 295+ }
259296 var this_seq = this;
260 - do_request(req_url, function(data){
261 - if( typeof data=='string' ){
262 - js_log(' eval data: ' + data);
263 - eval(data);
264 - var data = mv_result['pay_load'];
265 - }
266 - for( var i in data ){
267 - var menu_item = this_seq.menu_items[i];
268 - js_log('set '+ i + ' to: '+ data[i] );
269 - if( menu_item.submenu ){
270 - if(typeof data[i]=='string'){
271 - //just set the default item
272 - for(var j in menu_item.submenu){
273 - if( menu_item.submenu[j] )
274 - $j('#sc_'+j).html( data[i] );
275 - }
276 - }else if(typeof data[i] == 'object'){
277 - //see if we have sub data for each sub-menu item
278 - for(var j in data[i]){
279 - $j('#sc_'+j).html( data[i][j] );
280 - }
281 - }
282 - }else{
283 - //just set the parent container
284 - $j('#'+i+'_ic').html( data[i] );
285 - this_seq.doMenuItemDispJs(i)
286 - }
287 - }
288 - });
 297+ //do all the menu_items setup: @@we could defer this to once the menu item is requested
 298+ for( var i in this.menu_items ){
 299+ if( this.menu_items[i].js )
 300+ this.menu_items[i].js( this );
 301+ }
289302 },
290 - doMenuItemDispJs:function(item){
291 - var this_seq = this;
292 - var target_id = item + '_ic';
293 - var menu_item = this.menu_items[item];
294 - //do any menu item post embed js hook processing:
295 - switch(item){
296 - case 'clipedit':
297 - //load mv_clip_edit.js
298 - break;
299 - case 'transition':
300 - //render out the transitions library
301 - this.renderTransitionsSet(target_id);
302 - break;
303 - case 'cliplib':
304 - //load the search interface with sequence tool targets
305 - //@@todo it maybe cleaner to just pass along msg text in JSON
306 - //and have the search interface build the html
307 - if( ! this.plObj.interface_url ){
308 - js_log( 'Error:missing interface_url, can not load search interface' );
309 - return false;
310 - }
311 -
312 - //check default search
313 - mvJsLoader.doLoad({'mediaWikiRemoteSearch':'libRemoteMediaSearch/mv_remote_media_search.js'}, function(){
314 - this_seq.mySearch = new remoteSearchDriver({
315 - 'profile':'sequence',
316 - 'p_seq':this_seq,
317 - 'instance_name': this_seq.instance_name + '.mySearch'
318 - });
319 - });
320 - break;
321 - case 'options':
322 - $j('#'+target_id+" input[value='simple_editor']").attr({
323 - 'checked':(this_seq.timeline_mode=='clip')?true:false
324 - }).click(function(){
325 - this_seq.doSimpleTl();
326 - });
327 - $j('#'+target_id+" input[value='advanced_editor']").attr({
328 - 'checked':( this_seq.timeline_mode=='time' )?true:false
329 - }).click(function(){
330 - this_seq.doAdvancedTl();
331 - });
332 - //set up the options for context menus
333 - break;
334 - }
335 - },
336303 //renders out the transitions effects set
337304 renderTransitionsSet:function(target_id){
338305 js_log('f:renderTransitionsSet:' + target_id);
@@ -359,7 +326,7 @@
360327 //empty out the top level html:
361328 $j('#'+this.timeline_id).html('');
362329 //add html general for timeline
363 - if( this.timeline_mode=='time'){
 330+ if( this.timeline_mode == 'time'){
364331 $j('#'+this.timeline_id).html(''+
365332 '<div id="'+this.timeline_id+'_left_cnt" class="mv_tl_left_cnt">'+
366333 '<div id="'+this.timeline_id+'_head_control" style="position:absolute;top:0px;left:0px;right:0px;height:30px;">' +
@@ -421,7 +388,7 @@
422389 top_pos+=track_height+20;
423390 }
424391 }
425 - if( this.timeline_mode=='clip'){
 392+ if( this.timeline_mode=='storyboard'){
426393 var top_pos=this.plObj.org_control_height;
427394 //debugger;
428395 for(var i in this.plObj.tracks){
@@ -534,7 +501,9 @@
535502 });
536503 sub_menu_html+= '</ul>';
537504 }
538 - item_containers+= sub_menu_html + '</div>';
 505+ item_containers += sub_menu_html;
 506+ item_containers += (menu_item.html) ? menu_item.html : '<h3>' + getMsg('menu_'+inx) + '</h3>';
 507+ item_containers +='</div>';
539508 });
540509 menu_html+='</ul>';
541510
@@ -547,13 +516,14 @@
548517 });
549518
550519 //load init content into containers
551 - this.loadInitMenuItems();
 520+ this.setupMenuItems();
552521
553522 //render the timeline
554523 this.renderTimeLine();
555524 this.do_refresh_timeline();
556525
557526 var this_seq = this;
 527+
558528 //set up key bidnings
559529 $j().keydown(function(e){
560530 js_log('pushed down on:' + e.which);
@@ -873,7 +843,7 @@
874844 return false;
875845 },
876846 doSimpleTl:function(){
877 - this.timeline_mode='clip';
 847+ this.timeline_mode='storyboard';
878848 this.renderTimeLine();
879849 this.do_refresh_timeline();
880850 return false;
@@ -892,8 +862,8 @@
893863 var track = this.plObj.tracks[track_id];
894864 var cur_clip_time=0;
895865
896 - //set up some constants for timeline_mode == clip:
897 - if(this.timeline_mode == 'clip'){
 866+ //set up some constants for timeline_mode == storyboard:
 867+ if(this.timeline_mode == 'storyboard'){
898868 var frame_width = Math.round(this.track_clipThumb_height*1.3333333);
899869 var container_width = frame_width+60;
900870 }
@@ -902,7 +872,7 @@
903873 for(var j in track.clips){
904874 clip = track.clips[j];
905875 //var img = clip.getClipImg('icon');
906 - if(this.timeline_mode == 'clip'){
 876+ if(this.timeline_mode == 'storyboard'){
907877 clip.left_px = j*container_width;
908878 clip.width_px = container_width;
909879 var base_id = 'track_'+track_id+'_clip_'+j;
@@ -1271,7 +1241,7 @@
12721242 }
12731243 $j('#'+this.timeline_id+'_head_jump').html(out);
12741244 }
1275 - if(this.timeline_mode=='clip'){
 1245+ if(this.timeline_mode=='storyboard'){
12761246 //remove the old one if its still there
12771247 $j('#'+this.timeline_id +'_pl_control').remove();
12781248 //render out a playlist clip wide and all the way to the right (only playhead and play button) (outside of timeline)
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js
@@ -0,0 +1,16 @@
 2+/*
 3+hanndles clip edit controls
 4+ 'inoutpoints':0, //should let you set the in and out points of clip
 5+ 'panzoom':0, //should allow setting keyframes and tweening modes
 6+ 'overlays':0, //should allow setting "locked to clip" overlay tracks
 7+ 'audio':0 //should allow controling the audio volume (with keyframes)
 8+*/
 9+
 10+var mvClipEdit = function(initObj) {
 11+ return this.init(initObj);
 12+};
 13+mvClipEdit.prototype = {
 14+ init:function( initObj){
 15+ //setup the clip editor
 16+ }
 17+}
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js
___________________________________________________________________
Added: svn:mergeinfo
Added: svn:eol-style
118 + native
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css
@@ -183,7 +183,8 @@
184184 broder: solid thin gray;
185185 }
186186 .mv_submenu{
187 - position:absolute;
 187+ /*position:absolute;*/
 188+ float:left;
188189 left:0px;
189190 top:0px;
190191 margin:2px;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/wiki_commons_logo_80.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/wiki_commons_logo_80.png
___________________________________________________________________
Added: svn:mime-type
191192 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_logo_80.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_logo_80.png
___________________________________________________________________
Added: svn:mime-type
192193 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/metavid_logo_100.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/metavid_logo_100.png
___________________________________________________________________
Added: svn:mime-type
193194 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -1072,15 +1072,17 @@
10731073 });
10741074 }
10751075 }
 1076+
10761077 /* init remote search */
10771078 function mv_do_remote_search(initObj){
 1079+ js_log(':::::mv_do_remote_search::::');
10781080 //insure we have the basic libs (jquery etc) :
10791081 mvEmbed.load_libs(function(){
10801082 //load search specifc extra stuff
10811083 mvJsLoader.doLoad({
10821084 'mvBaseRemoteSearch':'libRemoteMediaSearch/mv_remote_media_search.js'
10831085 }, function(){
1084 - var mvrs = new remoteSearchDriver(initObj);
 1086+ var mvrs = new remoteSearchDriver( initObj );
10851087 });
10861088 });
10871089 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_htmlEmbed.js
@@ -71,6 +71,9 @@
7272 },
7373 selected_source:{
7474 supports_url_time_encoding:true
 75+ },
 76+ timedTextSources:function(){
 77+ return false;
7578 }
7679 },
7780 inheritEmbedObj:function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js
@@ -1,23 +1,151 @@
22 /*
33 * a library for doing remote media searches
 4+*
 5+* initial targeted archives are:
 6+ wikimedia commons
 7+ metavid
 8+ and archive.org
49 */
510
 11+gMsg['mv_media_search']= 'Media Search';
 12+
 13+var default_remote_search_options = {
 14+ 'profile':'mediawiki_edit',
 15+ 'target_id':null, //the div that will hold the search interface
 16+
 17+ 'default_provider_id':'all', //all or one of the content_providers ids
 18+
 19+ //specific to sequence profile
 20+ 'p_seq':null
 21+}
622 var remoteSearchDriver = function(initObj){
723 return this.init( initObj );
824 }
925 remoteSearchDriver.prototype = {
 26+ //here we define the set of possible media content providers:
 27+ main_search_options:{
 28+ 'selprovider':{
 29+ 'title': 'Select Provider'
 30+ },
 31+ 'advanced_search':{
 32+ 'title': 'Advanced Options'
 33+ }
 34+ },
 35+ content_providers:{
 36+ 'this_wiki':{
 37+ 'enabled':0,
 38+ 'title':'The Current Wiki',
 39+ 'desc': '(should be updated with the proper text)'
 40+ },
 41+ 'wiki_commons':{
 42+ 'enabled':1,
 43+ 'title':'Wikipedia Commons',
 44+ 'desc': 'Wikimedia Commons is a media file repository making available public domain '+
 45+ 'and freely-licensed educational media content (images, sound and video clips) to all.',
 46+ 'logo': 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Wiki-commons.png/80px-Wiki-commons.png'
 47+ },
 48+ 'archive_org':{
 49+ 'enabled':0,
 50+ 'title' : 'Archive.org',
 51+ 'desc' : 'The Internet Archive, a digital library of cultural artifacts in digital form',
 52+ 'logo' : 'http://www.archive.org/images/logo.jpg'
 53+ },
 54+ 'metavid':{
 55+ 'enabled':0,
 56+ 'title':'Metavid.org',
 57+ 'desc': 'Metavid hosts thousands of hours of US house and senate floor proccedings',
 58+ 'logo': 'http://metavid.org/w/skins/mvpcf/images/logo.png'
 59+ }
 60+ },
1061 init:function( initObj ){
11 - //do profile check:
12 - if( initObj.profile == 'mediawiki_edit'){
13 -
 62+ js_log('remoteSearchDriver:init');
 63+ for( var i in default_remote_search_options ) {
 64+ if( initObj[i]){
 65+ this[ i ] = initObj[i];
 66+ }else{
 67+ this[ i ] =default_remote_search_options[i];
 68+ }
1469 }
15 - if( initObj.profile == 'sequence'){
16 -
 70+ this.init_interface_html();
 71+ this.add_interface_bindings();
 72+ },
 73+ //sets up the initial html interface
 74+ init_interface_html:function(){
 75+ var out = '<div class="rsd_control_container" style="width:100%">' +
 76+ '<table style="width:100%">' +
 77+ '<tr>'+
 78+ '<td style="width:100px">'+
 79+ '<h3> Media Search </h3>'+
 80+ '</td>'+
 81+ '<td style="width:190px">'+
 82+ '<input type="text" tabindex="1" value="" maxlength="512" id="q" name="q" '+
 83+ 'size="20" autocomplete="off"/>'+
 84+ '</td>'+
 85+ '<td style="width:110px">'+
 86+ '<input type="submit" value="' + getMsg('mv_media_search') + '" tabindex="2" '+
 87+ ' id="search-button"/>'+
 88+ '</td>'+
 89+ '<td>';
 90+ for(var i in this.main_search_options){
 91+ var mso = this.main_search_options[i];
 92+ out += '<a src="#" id="mso_'+i+'" >' + mso.title + '</a><br>';
1793 }
18 - }
 94+ out+= '</td>'+
 95+ '</tr>'+
 96+ '</table>';
 97+ js_log('out: ' + out);
 98+ //set up the content provider selection div (do this first to get the default cp)
 99+ var cpsdiv = '<div id="cps_options">'+
 100+ '<table style="background:transparent"><tr>';
 101+
 102+ for( var i in this.content_providers ){
 103+ var cp = this.content_providers[i];
 104+
 105+ var checked_attr = (this.default_provider_id &&
 106+ ( this.default_provider_id == i || this.default_provider_id == 'all' ))?'checked':'';
 107+
 108+ cpsdiv+='<td '+
 109+ ' title="' + cp.title + '" '+
 110+ ' style="float:left;cursor:pointer;">'+
 111+ '<input class="mv_cps_input" type="checkbox" name="mv_cps" '+ checked_attr+'>'+
 112+ '</td>'+
 113+ '<td>';
 114+ if( cp.logo ){
 115+ cpsdiv+= '<img src="' + cp.logo + '">';
 116+ }else{
 117+ cpsdiv+= cp.title
 118+ }
 119+ cpsdiv+='</td>';
 120+ }
 121+ cpsdiv+='</table><a id="mso_selprovider_close" href="#">close</a></div>';
 122+ out+='<div id="rsd_options_bar" style="display:none;width:100%;height:0px;background:#BBB">'+
 123+ cpsdiv +
 124+ '</div>';
 125+ out+='<div class="rsd_result_bar" style="width:100%;border-top:solid thin black;background:#66F"/>';
 126+ //close up the control container:
 127+ out+='</div>';
 128+ //outout the results placeholder:
 129+ out+='<div class="rmd_results" style="width:100%;height:100%;overflow:auto;" />';
 130+ $j('#'+ this.target_id ).html( out );
 131+ },
 132+ add_interface_bindings:function(){
 133+ js_log("add_interface_bindings:");
 134+ //setup for this.main_search_options:
 135+ $j('#mso_selprovider').(function(){
 136+ $j('#rsd_options_bar:visible').animate({
 137+ 'height':'100px',
 138+ 'opacity':1
 139+ }, "normal");
 140+ $j('#rsd_options_bar:hidden,#mso_selprovider_close').animate({
 141+ 'height':'0px',
 142+ 'opacity':0
 143+ }, "normal");
 144+ });
 145+ //setup binding for search provider check box:
 146+
 147+ }
19148 }
20149
21 -
22150 var mvBaseRemoteSearch = function(initObj) {
23151 return this.init(initObj);
24152 };

Status & tagging log