* updates for Add Media Wizard inline upload support
authorMichael Dale <dale@users.mediawiki.org>
Tue, 25 Aug 2009 16:49:27 +0000 (16:49 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Tue, 25 Aug 2009 16:49:27 +0000 (16:49 +0000)
* updated language-key mappings

js2/mwEmbed/example_usage/kPlayer_Simple_Video_Tag.html [deleted file]
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libAddMedia/simpleUploadForm.js
js2/mwEmbed/libEmbedVideo/nativeEmbed.js
js2/mwEmbed/mv_embed.js
js2/mwEmbed/php/script-cache/README
js2/mwEmbed/skins/ctrlBuilder.js
js2/mwEmbed/skins/mvpcf/styles.css

diff --git a/js2/mwEmbed/example_usage/kPlayer_Simple_Video_Tag.html b/js2/mwEmbed/example_usage/kPlayer_Simple_Video_Tag.html
deleted file mode 100644 (file)
index 4dca7a6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-       <title>Simple Video Tag Usage</title>
-       <script type="text/javascript">
-               var mwConfig = {
-                       'skin_name': 'kskin',
-                       'jui_skin' : 'base'
-               };
-       </script>
-       <script type="text/javascript" src="../mv_embed.js?debug=true"></script>
-</head>
-<body>
-<h3> Simple Video Tag Usage </h3>
-once you include: mv_embed.js on any remote page you can then use the video tag like so: 
-<span id="default_attr">
-</span> <br />
-<br />
-  <table border="1" cellpadding="6" width="600">
-                   <tr>
-             <td valign="top"><video durationHint="70"
-                       style="width:400px;height:288px"
-                               poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg" 
-                               src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"></video></video></td>
-             <td valign="top"><b>Sample Embed</b><br />
-             Simple video Embed: 
-               <pre>&lt;video style="width:400px;height:288px" poster="http://metavid.org/w/index.php?action=ajax&rs=mv_frame_server&stream_id=71&t=1:23:16&size=400x300" 
-src="http://metavidstorage01.ucsc.edu/media/house_proceeding_07-18-06_00.ogg?t=1:23:16/1:23:44"&gt;&lt;/video&gt;</pre>
-             </td>
-             </table>
-       <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;
-  </body>
-</html>        
-
index 37f5428..0c6d322 100644 (file)
@@ -607,9 +607,9 @@ remoteSearchDriver.prototype = {
                                        //load  this_wiki search system to grab the rObj
                                        _this.loadSearchLib(cp, function(){
                                                //do basic layout form on left upload "bin" on right
-                                               $j('#tab-upload').html('<table cellspacing="10">' +
+                                               $j('#tab-upload').html('<table>' +
                                                '<tr>' +
-                                                       '<td valign="top" style="width:350px;">' +
+                                                       '<td valign="top" style="width:350px; padding-right: 12px;">' +
                                                                '<h4>' + gM('mwe-upload_a_file') + '</h4>' +
                                                                '<div id="upload_form">' +
                                                                        mv_get_loading_img() +
@@ -639,19 +639,16 @@ remoteSearchDriver.prototype = {
                                                $j('#upload_form').simpleUploadForm({
                                                        "api_target" :  _this.upload_api_target ,
                                                        "ondone_cb"     : function( resultData ){
-                                                               var wTitle = resultData['wpDestFile'];
+                                                               var wTitle = resultData['wpDestFile'];                                                          
                                                                //add a loading div
-                                                               $j( _this.target_container ).append('<div id="temp_edit_loader" '+
-                                                                       'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' +
-                                                                               mv_get_loading_img('position:absolute;top:30px;left:30px') +
-                                                               '</div>');
-                                                                       cp.sObj.addByTitle( wTitle, function( rObj ){
-                                                                               $j( _this.target_container ).find('#temp_edit_loader').remove();
-                                                                               //redraw (with added result if new)
-                                                                               _this.drawOutputResults();
-                                                                               //pull up recource editor:
-                                                                               _this.resourceEdit( rObj, $j('#res_upload_' + rObj.id).get(0) );
-                                                                       });
+                                                               _this.addResourceEditLoader();
+                                                               
+                                                               cp.sObj.addByTitle( wTitle, function( rObj ){                                                                   
+                                                                       //redraw (with added result if new)
+                                                                       _this.drawOutputResults();
+                                                                       //pull up recource editor:                                                                      
+                                                                       _this.resourceEdit( rObj, $j('#res_upload__' + rObj.id).get(0) );                                                                       
+                                                               });
                                                                //return false to close progress window:
                                                                return false;
                                                        }
@@ -1012,7 +1009,7 @@ remoteSearchDriver.prototype = {
                                        o+='</div>';
                                }else if(_this.result_display_mode == 'list'){
                                        o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="width:90%">';
-                                               o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '_' + rInx +'" style="float:left;width:' +
+                                               o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '__' + rInx +'" style="float:left;width:' +
                                                                 _this.thumb_width + 'px;" src="' +
                                                                 cp.sObj.getImageTransform( rItem, {'width':_this.thumb_width } )
                                                                  + '">';
@@ -1456,14 +1453,13 @@ remoteSearchDriver.prototype = {
                        myUp = new mvBaseUploadInterface({
                                'api_url' : _this.local_wiki_api_url,
                                'done_upload_cb':function(){
-                                  //we have finished the upload:
-
-                                  //close up the rsd_resource_import
-                                  $j('#rsd_resource_import').remove();
-                                  //run the parent callback:
-                                  cir_callback();
-                                  //return false to avoid BaseUploadInterface done actions
-                                  return false;
+                                       js_log('doImportAPI:: run callback::' );
+                                       //we have finished the upload:
+                               
+                                       //close up the rsd_resource_import
+                                       $j('#rsd_resource_import').remove();
+                                       //return the parent callback:
+                                       return cir_callback();                                  
                                }
                        });
                        //set the edit token if we have it handy
@@ -1577,7 +1573,6 @@ remoteSearchDriver.prototype = {
                                                                                $j('#rsd_resource_import').remove();
                                                                        });
                                                                }
-
                                                        }
                                                );
                                        }
index 1239689..6a00a0e 100644 (file)
@@ -46,32 +46,33 @@ var default_form_options = {
                        }
 
                        //build an upload form:
-                       var o = ''+
-                               '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">'  +
-                               //hidden input:
-                               '<input type="hidden" name="action" value="upload">'+
-                               '<input type="hidden" name="format" value="jsonfm">'+
-                               '<input type="hidden" name="token" value="'+ eToken +'">' +
-
-                               //form name set:
-                               '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+
-                               '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
-
-                               '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
-                               '<input type="text" name="wpDestFile" size="30" /><br>'+
-
-                               '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
-                               '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
-
-                               '<div id="wpDestFile-warning"></div>' +
-                               '<div style="clear:both;"></div>' +
-
-                               gM('mwe-select_ownwork') + '<br>' +
-                               '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('mwe-licence_cc-by-sa') + '<br>' +
-
-                               '<input type="submit" accesskey="s" value="' + gM('mwe-upload') + '" name="wpUploadBtn" id="wpUploadBtn"  tabindex="9"/>' +
-                               //close the form and div
-                               '</form>';
+                       var o = '<div>'+
+                                               '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">'  +
+                                               //hidden input:
+                                               '<input type="hidden" name="action" value="upload">'+
+                                               '<input type="hidden" name="format" value="jsonfm">'+
+                                               '<input type="hidden" name="token" value="'+ eToken +'">' +
+                       
+                                               //form name set:
+                                               '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+
+                                               '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
+                       
+                                               '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
+                                               '<input type="text" name="wpDestFile" size="30" /><br>'+
+                       
+                                               '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
+                                               '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
+                       
+                                               '<div id="wpDestFile-warning"></div>' +
+                                               '<div style="clear:both;"></div>' +
+                       
+                                               gM('mwe-select_ownwork') + '<br>' +
+                                               '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('mwe-licence_cc-by-sa') + '<br>' +
+                       
+                                               '<input type="submit" accesskey="s" value="' + gM('mwe-upload') + '" name="wpUploadBtn" id="wpUploadBtn"  tabindex="9"/>' +
+                                               //close the form and div
+                                               '</form>' +
+                               '</div>';
 
                        //set the target with the form output:
                        $( _this.selector ).html( o );
@@ -88,7 +89,7 @@ var default_form_options = {
                        });
                        //do destination fill:
                        //@@should integrate with doDestinationFill on upload page
-                       $j("[name='wpUploadFile']").change(function(){
+                       $j("#suf-upload [name='wpUploadFile']").change(function(){
                                var path = $j(this).val();
                                // Find trailing part
                                var slash = path.lastIndexOf('/');
@@ -103,9 +104,9 @@ var default_form_options = {
                                }
                                fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
                                // Output result
-                               $j("[name='wpDestFile']").val( fname );
+                               $j("#suf-upload [name='wpDestFile']").val( fname );
                                //do destination check
-                               $j("[name='wpDestFile']").doDestCheck({
+                               $j("#suf-upload [name='wpDestFile']").doDestCheck({
                                        'warn_target':'#wpDestFile-warning'
                                });
                        });
index 9dcd88f..ba0a5dd 100644 (file)
@@ -159,11 +159,7 @@ var nativeEmbed = {
                //update currentTime                            
                this.currentTime = this.vid.currentTime;                
                this.addPresTimeOffset();
-               
-               //do clip done 
-               if(this.currentTime > this.duration){
-                       this.onClipDone();
-               }
+                               
                //js_log('currentTime:' + this.currentTime);
                //js_log('this.currentTime: ' + this.currentTime );
                //once currentTime is updated call parent_monitor
index 30b5594..5c4372d 100644 (file)
@@ -211,7 +211,7 @@ lcPaths({
        "mvFirefoggRender"      : "libSequencer/mvFirefoggRender.js",
        "mvTimedEffectsEdit": "libSequencer/mvTimedEffectsEdit.js",
 
-       "libTimedText"          : "libTimedText/mvTextInterface.js"
+       "mvTextInterface"       : "libTimedText/mvTextInterface.js"
 
 });
 
@@ -1093,7 +1093,7 @@ function do_api_req( options, callback ){
        if(!options.data['action'])
                options.data['action']='query';
 
-       js_log('do api req: ' + options.url +'?' +  jQuery.param(options.data) );
+       //js_log('do api req: ' + options.url +'?' +  jQuery.param(options.data) );
        //build request string:
        if( parseUri( document.URL ).host == parseUri( options.url ).host ){
                //local request do api request directly
index c4e0696..a42bd3e 100644 (file)
@@ -1,4 +1,6 @@
-This folder holds cached versions of grouped script requests.
+This folder holds cached versions of grouped script requests (if running mwEmbed in stand-alone-mode.
+(otherwise  $wgFileCacheDirectory from mediaWiki is used) 
+
 Be sure to enable write access by your web-server to this directory. 
   
 You can specify a different directory by updating the $wgFileCacheDirectory variable in noMediaWikiConfig.php
index 69fb101..a757d41 100644 (file)
@@ -79,9 +79,9 @@ var ctrlBuilder = {
                                        if($j('#gnp_' + embedObj.id).length==0){
                                                $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' +
                                                        'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;">' +
-                                                       gM('mv_for_best_experience') + 
+                                                       gM('mwe-for_best_experience') + 
                                                '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' + 
-                                                       gM('mv_do_not_warn_again') + 
+                                                       gM('mwe-do_not_warn_again') + 
                                                '</div>');                                                      
                                                $j('#ffwarn_'+embedObj.id).click(function(){
                                                        if( $j(this).is(':checked') ){
@@ -146,7 +146,7 @@ var ctrlBuilder = {
                                var perc = ui.value/1000;                                                                                                                                                                                                                                                                                       
                                embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);   
                                //js_log('perc:' + perc + ' * ' + embedObj.getDuration() + ' jt:'+  this.jump_time);
-                               embedObj.setStatus( gM('seek_to')+' '+embedObj.jump_time );     
+                               embedObj.setStatus( gM('mwe-seek_to')+' '+embedObj.jump_time ); 
                                //update the thumbnail / frame 
                                if(embedObj.isPlaying==false){
                                        embedObj.updateThumbPerc( perc );
@@ -268,9 +268,9 @@ var ctrlBuilder = {
                                        '<h6>Video Options</h6>'+
                                '</div>'+
                                        '<div class="block">'+
-                                               '<p class="short_match vo_selection"><a href="#"><span>Stream Selection</span></a></p>'+
-                                               '<p class="short_match vo_download"><a href="#"><span>Download</span></a></p>'+
-                                               '<p class="short_match vo_showcode"><a href="#"><span>Share or Embed</span></a></p>';
+                                               '<p class="short_match vo_selection"><a href="#"><span>'+gM('mwe-chose_player')+'</span></a></p>'+
+                                               '<p class="short_match vo_download"><a href="#"><span>'+gM('mwe-download')+'</span></a></p>'+
+                                               '<p class="short_match vo_showcode"><a href="#"><span>'+gM('mwe-share')+'</span></a></p>';
                                        
                                        //link to the stream page if we are not already there: 
                                        if( ctrlBuilder.embedObj.roe && typeof mv_stream_interface == 'undefined' )
@@ -286,31 +286,31 @@ var ctrlBuilder = {
                'fullscreen':{
                        'w':20,
                        'o':function(){
-                               return '<div title="' + gM('player_fullscreen') + '" id="fullscreen_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-arrow-4-diag"></span></div>'
+                               return '<div title="' + gM('mwe-player_fullscreen') + '" id="fullscreen_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-arrow-4-diag"></span></div>'
                        }
                },
                'options':{
                        'w':26,
                        'o':function(){
-                               return '<div title="'+ gM('player_options') + '" id="options_button_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-wrench"></span></div>';                                                 
+                               return '<div title="'+ gM('mwe-player_options') + '" id="options_button_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-wrench"></span></div>';                                             
                        }
                },
                'pause':{
                        'w':24,
                        'o':function(){
-                               return '<div title="' + gM('play_clip') + '" id="mv_play_pause_button_' + ctrlBuilder.id + '" class="ui-state-default ui-corner-all ui-icon_link lButton"><span class="ui-icon ui-icon-play"/></div>';
+                               return '<div title="' + gM('mwe-play_clip') + '" id="mv_play_pause_button_' + ctrlBuilder.id + '" class="ui-state-default ui-corner-all ui-icon_link lButton"><span class="ui-icon ui-icon-play"/></div>';
                        }
                },
                'closed_captions':{
                        'w':23,
                        'o':function(){
-                               return '<div title="' + gM('closed_captions') + '" id="timed_text_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-comment"></span></div>'
+                               return '<div title="' + gM('mwe-closed_captions') + '" id="timed_text_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-comment"></span></div>'
                        }                       
                },
                'volume_control':{
                        'w':23,
                        'o':function(){
-                                       return '<div title="' + gM('volume_control') + '" id="volume_control_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton">' +
+                                       return '<div title="' + gM('mwe-volume_control') + '" id="volume_control_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton">' +
                                                                '<span class="ui-icon ui-icon-volume-on"></span>' +
                                                                '<div style="position:absolute;display:none;" id="vol_container_'+ctrlBuilder.id+'" class="vol_container ui-corner-all">' +
                                                                        '<div class="volume_bar" id="volume_bar_' + ctrlBuilder.id + '"></div>' +
index cf545ab..7fa0f2c 100644 (file)
@@ -739,4 +739,58 @@ ui-widget-overlay{
        height:10px;    
        position:absolute;
        left:-1px;              
+}
+
+/* related videos Video */
+.related_vids {                        
+       top:10px;
+       left:5px;
+       right:5px;
+       bottom:5px;
+       position:absolute;
+       overflow-y:auto;        
+}
+.related_vids h1 {
+       border:medium none;
+       font-size:20px;
+       margin:4px 0px 4px 11px;
+       padding:0;
+       color:#F0F0F0;
+       font-family:arial,sans-serif;
+}
+
+.related_vids ul {
+       margin:0;
+       padding:0;
+       
+       list-style-image:none;
+       list-style-position:inside;
+       list-style-type:none;
+       margin:0;
+       padding:0;
+}
+
+
+.related_vids li{
+       -x-system-font:none;
+       color:#FAFAFA;
+       display:table;
+       font-family:arial,sans-serif;
+       font-size:11px;
+       line-height:normal;
+       margin:0 0 6px 35px;
+       padding:0;
+}
+
+.related_vids li div {
+       float:right;
+       margin:5px 0 0 10px;
+       width:200px;
+}
+
+.related_vids img {
+       width:80px;     
+       z-index:2;
+       border-bottom:3px solid #36393D;
+       border-top:3px solid #36393D;
 }
\ No newline at end of file