r55577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55576‎ | r55577 | r55578 >
Date:16:49, 25 August 2009
Author:dale
Status:deferred
Tags:
Comment:
* updates for Add Media Wizard inline upload support
* updated language-key mappings
Modified paths:
  • /trunk/phase3/js2/mwEmbed/example_usage/kPlayer_Simple_Video_Tag.html (deleted) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/nativeEmbed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/php/script-cache/README (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/example_usage/kPlayer_Simple_Video_Tag.html
@@ -1,35 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title>Simple Video Tag Usage</title>
7 - <script type="text/javascript">
8 - var mwConfig = {
9 - 'skin_name': 'kskin',
10 - 'jui_skin' : 'base'
11 - };
12 - </script>
13 - <script type="text/javascript" src="../mv_embed.js?debug=true"></script>
14 -</head>
15 -<body>
16 -<h3> Simple Video Tag Usage </h3>
17 -once you include: mv_embed.js on any remote page you can then use the video tag like so:
18 -<span id="default_attr">
19 -</span> <br />
20 -<br />
21 - <table border="1" cellpadding="6" width="600">
22 - <tr>
23 - <td valign="top"><video durationHint="70"
24 - style="width:400px;height:288px"
25 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg"
26 - src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"></video></video></td>
27 - <td valign="top"><b>Sample Embed</b><br />
28 - Simple video Embed:
29 - <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"
30 -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>
31 - </td>
32 - </table>
33 - <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;
34 - </body>
35 -</html>
36 -
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -607,9 +607,9 @@
608608 //load this_wiki search system to grab the rObj
609609 _this.loadSearchLib(cp, function(){
610610 //do basic layout form on left upload "bin" on right
611 - $j('#tab-upload').html('<table cellspacing="10">' +
 611+ $j('#tab-upload').html('<table>' +
612612 '<tr>' +
613 - '<td valign="top" style="width:350px;">' +
 613+ '<td valign="top" style="width:350px; padding-right: 12px;">' +
614614 '<h4>' + gM('mwe-upload_a_file') + '</h4>' +
615615 '<div id="upload_form">' +
616616 mv_get_loading_img() +
@@ -639,19 +639,16 @@
640640 $j('#upload_form').simpleUploadForm({
641641 "api_target" : _this.upload_api_target ,
642642 "ondone_cb" : function( resultData ){
643 - var wTitle = resultData['wpDestFile'];
 643+ var wTitle = resultData['wpDestFile'];
644644 //add a loading div
645 - $j( _this.target_container ).append('<div id="temp_edit_loader" '+
646 - 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' +
647 - mv_get_loading_img('position:absolute;top:30px;left:30px') +
648 - '</div>');
649 - cp.sObj.addByTitle( wTitle, function( rObj ){
650 - $j( _this.target_container ).find('#temp_edit_loader').remove();
651 - //redraw (with added result if new)
652 - _this.drawOutputResults();
653 - //pull up recource editor:
654 - _this.resourceEdit( rObj, $j('#res_upload_' + rObj.id).get(0) );
655 - });
 645+ _this.addResourceEditLoader();
 646+
 647+ cp.sObj.addByTitle( wTitle, function( rObj ){
 648+ //redraw (with added result if new)
 649+ _this.drawOutputResults();
 650+ //pull up recource editor:
 651+ _this.resourceEdit( rObj, $j('#res_upload__' + rObj.id).get(0) );
 652+ });
656653 //return false to close progress window:
657654 return false;
658655 }
@@ -1012,7 +1009,7 @@
10131010 o+='</div>';
10141011 }else if(_this.result_display_mode == 'list'){
10151012 o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="width:90%">';
1016 - o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '_' + rInx +'" style="float:left;width:' +
 1013+ o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '__' + rInx +'" style="float:left;width:' +
10171014 _this.thumb_width + 'px;" src="' +
10181015 cp.sObj.getImageTransform( rItem, {'width':_this.thumb_width } )
10191016 + '">';
@@ -1456,14 +1453,13 @@
14571454 myUp = new mvBaseUploadInterface({
14581455 'api_url' : _this.local_wiki_api_url,
14591456 'done_upload_cb':function(){
1460 - //we have finished the upload:
1461 -
1462 - //close up the rsd_resource_import
1463 - $j('#rsd_resource_import').remove();
1464 - //run the parent callback:
1465 - cir_callback();
1466 - //return false to avoid BaseUploadInterface done actions
1467 - return false;
 1457+ js_log('doImportAPI:: run callback::' );
 1458+ //we have finished the upload:
 1459+
 1460+ //close up the rsd_resource_import
 1461+ $j('#rsd_resource_import').remove();
 1462+ //return the parent callback:
 1463+ return cir_callback();
14681464 }
14691465 });
14701466 //set the edit token if we have it handy
@@ -1577,7 +1573,6 @@
15781574 $j('#rsd_resource_import').remove();
15791575 });
15801576 }
1581 -
15821577 }
15831578 );
15841579 }
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js
@@ -46,33 +46,34 @@
4747 }
4848
4949 //build an upload form:
50 - var o = ''+
51 - '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">' +
52 - //hidden input:
53 - '<input type="hidden" name="action" value="upload">'+
54 - '<input type="hidden" name="format" value="jsonfm">'+
55 - '<input type="hidden" name="token" value="'+ eToken +'">' +
 50+ var o = '<div>'+
 51+ '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">' +
 52+ //hidden input:
 53+ '<input type="hidden" name="action" value="upload">'+
 54+ '<input type="hidden" name="format" value="jsonfm">'+
 55+ '<input type="hidden" name="token" value="'+ eToken +'">' +
 56+
 57+ //form name set:
 58+ '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+
 59+ '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
 60+
 61+ '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
 62+ '<input type="text" name="wpDestFile" size="30" /><br>'+
 63+
 64+ '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
 65+ '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
 66+
 67+ '<div id="wpDestFile-warning"></div>' +
 68+ '<div style="clear:both;"></div>' +
 69+
 70+ gM('mwe-select_ownwork') + '<br>' +
 71+ '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('mwe-licence_cc-by-sa') + '<br>' +
 72+
 73+ '<input type="submit" accesskey="s" value="' + gM('mwe-upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' +
 74+ //close the form and div
 75+ '</form>' +
 76+ '</div>';
5677
57 - //form name set:
58 - '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+
59 - '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' +
60 -
61 - '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+
62 - '<input type="text" name="wpDestFile" size="30" /><br>'+
63 -
64 - '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' +
65 - '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+
66 -
67 - '<div id="wpDestFile-warning"></div>' +
68 - '<div style="clear:both;"></div>' +
69 -
70 - gM('mwe-select_ownwork') + '<br>' +
71 - '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('mwe-licence_cc-by-sa') + '<br>' +
72 -
73 - '<input type="submit" accesskey="s" value="' + gM('mwe-upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' +
74 - //close the form and div
75 - '</form>';
76 -
7778 //set the target with the form output:
7879 $( _this.selector ).html( o );
7980 //by default dissable:
@@ -88,7 +89,7 @@
8990 });
9091 //do destination fill:
9192 //@@should integrate with doDestinationFill on upload page
92 - $j("[name='wpUploadFile']").change(function(){
 93+ $j("#suf-upload [name='wpUploadFile']").change(function(){
9394 var path = $j(this).val();
9495 // Find trailing part
9596 var slash = path.lastIndexOf('/');
@@ -103,9 +104,9 @@
104105 }
105106 fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
106107 // Output result
107 - $j("[name='wpDestFile']").val( fname );
 108+ $j("#suf-upload [name='wpDestFile']").val( fname );
108109 //do destination check
109 - $j("[name='wpDestFile']").doDestCheck({
 110+ $j("#suf-upload [name='wpDestFile']").doDestCheck({
110111 'warn_target':'#wpDestFile-warning'
111112 });
112113 });
Index: trunk/phase3/js2/mwEmbed/php/script-cache/README
@@ -1,4 +1,6 @@
2 -This folder holds cached versions of grouped script requests.
 2+This folder holds cached versions of grouped script requests (if running mwEmbed in stand-alone-mode.
 3+(otherwise $wgFileCacheDirectory from mediaWiki is used)
 4+
35 Be sure to enable write access by your web-server to this directory.
46
57 You can specify a different directory by updating the $wgFileCacheDirectory variable in noMediaWikiConfig.php
Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js
@@ -79,9 +79,9 @@
8080 if($j('#gnp_' + embedObj.id).length==0){
8181 $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' +
8282 'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;">' +
83 - gM('mv_for_best_experience') +
 83+ gM('mwe-for_best_experience') +
8484 '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' +
85 - gM('mv_do_not_warn_again') +
 85+ gM('mwe-do_not_warn_again') +
8686 '</div>');
8787 $j('#ffwarn_'+embedObj.id).click(function(){
8888 if( $j(this).is(':checked') ){
@@ -146,7 +146,7 @@
147147 var perc = ui.value/1000;
148148 embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);
149149 //js_log('perc:' + perc + ' * ' + embedObj.getDuration() + ' jt:'+ this.jump_time);
150 - embedObj.setStatus( gM('seek_to')+' '+embedObj.jump_time );
 150+ embedObj.setStatus( gM('mwe-seek_to')+' '+embedObj.jump_time );
151151 //update the thumbnail / frame
152152 if(embedObj.isPlaying==false){
153153 embedObj.updateThumbPerc( perc );
@@ -268,9 +268,9 @@
269269 '<h6>Video Options</h6>'+
270270 '</div>'+
271271 '<div class="block">'+
272 - '<p class="short_match vo_selection"><a href="#"><span>Stream Selection</span></a></p>'+
273 - '<p class="short_match vo_download"><a href="#"><span>Download</span></a></p>'+
274 - '<p class="short_match vo_showcode"><a href="#"><span>Share or Embed</span></a></p>';
 272+ '<p class="short_match vo_selection"><a href="#"><span>'+gM('mwe-chose_player')+'</span></a></p>'+
 273+ '<p class="short_match vo_download"><a href="#"><span>'+gM('mwe-download')+'</span></a></p>'+
 274+ '<p class="short_match vo_showcode"><a href="#"><span>'+gM('mwe-share')+'</span></a></p>';
275275
276276 //link to the stream page if we are not already there:
277277 if( ctrlBuilder.embedObj.roe && typeof mv_stream_interface == 'undefined' )
@@ -286,31 +286,31 @@
287287 'fullscreen':{
288288 'w':20,
289289 'o':function(){
290 - 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>'
 290+ 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>'
291291 }
292292 },
293293 'options':{
294294 'w':26,
295295 'o':function(){
296 - 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>';
 296+ 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>';
297297 }
298298 },
299299 'pause':{
300300 'w':24,
301301 'o':function(){
302 - 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>';
 302+ 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>';
303303 }
304304 },
305305 'closed_captions':{
306306 'w':23,
307307 'o':function(){
308 - 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>'
 308+ 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>'
309309 }
310310 },
311311 'volume_control':{
312312 'w':23,
313313 'o':function(){
314 - return '<div title="' + gM('volume_control') + '" id="volume_control_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton">' +
 314+ return '<div title="' + gM('mwe-volume_control') + '" id="volume_control_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton">' +
315315 '<span class="ui-icon ui-icon-volume-on"></span>' +
316316 '<div style="position:absolute;display:none;" id="vol_container_'+ctrlBuilder.id+'" class="vol_container ui-corner-all">' +
317317 '<div class="volume_bar" id="volume_bar_' + ctrlBuilder.id + '"></div>' +
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css
@@ -739,4 +739,58 @@
740740 height:10px;
741741 position:absolute;
742742 left:-1px;
 743+}
 744+
 745+/* related videos Video */
 746+.related_vids {
 747+ top:10px;
 748+ left:5px;
 749+ right:5px;
 750+ bottom:5px;
 751+ position:absolute;
 752+ overflow-y:auto;
 753+}
 754+.related_vids h1 {
 755+ border:medium none;
 756+ font-size:20px;
 757+ margin:4px 0px 4px 11px;
 758+ padding:0;
 759+ color:#F0F0F0;
 760+ font-family:arial,sans-serif;
 761+}
 762+
 763+.related_vids ul {
 764+ margin:0;
 765+ padding:0;
 766+
 767+ list-style-image:none;
 768+ list-style-position:inside;
 769+ list-style-type:none;
 770+ margin:0;
 771+ padding:0;
 772+}
 773+
 774+
 775+.related_vids li{
 776+ -x-system-font:none;
 777+ color:#FAFAFA;
 778+ display:table;
 779+ font-family:arial,sans-serif;
 780+ font-size:11px;
 781+ line-height:normal;
 782+ margin:0 0 6px 35px;
 783+ padding:0;
 784+}
 785+
 786+.related_vids li div {
 787+ float:right;
 788+ margin:5px 0 0 10px;
 789+ width:200px;
 790+}
 791+
 792+.related_vids img {
 793+ width:80px;
 794+ z-index:2;
 795+ border-bottom:3px solid #36393D;
 796+ border-top:3px solid #36393D;
743797 }
\ No newline at end of file
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -211,7 +211,7 @@
212212 "mvFirefoggRender" : "libSequencer/mvFirefoggRender.js",
213213 "mvTimedEffectsEdit": "libSequencer/mvTimedEffectsEdit.js",
214214
215 - "libTimedText" : "libTimedText/mvTextInterface.js"
 215+ "mvTextInterface" : "libTimedText/mvTextInterface.js"
216216
217217 });
218218
@@ -1093,7 +1093,7 @@
10941094 if(!options.data['action'])
10951095 options.data['action']='query';
10961096
1097 - js_log('do api req: ' + options.url +'?' + jQuery.param(options.data) );
 1097+ //js_log('do api req: ' + options.url +'?' + jQuery.param(options.data) );
10981098 //build request string:
10991099 if( parseUri( document.URL ).host == parseUri( options.url ).host ){
11001100 //local request do api request directly
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/nativeEmbed.js
@@ -159,11 +159,7 @@
160160 //update currentTime
161161 this.currentTime = this.vid.currentTime;
162162 this.addPresTimeOffset();
163 -
164 - //do clip done
165 - if(this.currentTime > this.duration){
166 - this.onClipDone();
167 - }
 163+
168164 //js_log('currentTime:' + this.currentTime);
169165 //js_log('this.currentTime: ' + this.currentTime );
170166 //once currentTime is updated call parent_monitor

Status & tagging log