r72515 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72514‎ | r72515 | r72516 >
Date:03:25, 7 September 2010
Author:dale
Status:deferred
Tags:
Comment:
fix for local sequences
* added render to disk option
* hide publish option when no server is configured
Modified paths:
  • /branches/MwEmbedStandAlone/libraries/jquery/jquery.ui/ui/jquery.ui.core.js (modified) (history)
  • /branches/MwEmbedStandAlone/libraries/jquery/jquery.ui/ui/jquery.ui.tabs.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
@@ -83,7 +83,7 @@
8484 */
8585 renderTime: function( time, deltaTime ){
8686 var _this = this;
87 - mw.log( "SmilBody::renderTime:: " + time + ' delta: '+ deltaTime);
 87+ //mw.log( "SmilBody::renderTime:: " + time + ' delta: '+ deltaTime);
8888
8989 // Get all the draw elements from the body this time:
9090 this.getElementsForTime( time ,
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -682,6 +682,7 @@
683683 // xxx height domination here may be confused refactor this check
684684 if( natrualAspect >= targetAspect ){
685685 transformCss.width = parseFloat( transformPercent ) + '%';
 686+ transformCss.height = null;
686687 /*transformCss.height = ( parseFloat( transformPercent ) * (
687688 ( natrualSize.height / natrualSize.width ) /
688689 ( targetSize.height / targetSize.width )
@@ -692,6 +693,7 @@
693694 // Fit vertically
694695 if(! transformCss.height || natrualAspect < targetAspect ){
695696 transformCss.height = parseFloat( transformPercent ) + '%';
 697+ transformCss.width = null;
696698 /*transformCss.width = ( parseFloat( transformPercent ) *
697699 ( natrualSize.height / natrualSize.width ) /
698700 ( targetSize.width / targetSize.height )
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -65,7 +65,7 @@
6666 },
6767
6868 /**
69 - * set the virtual smil volume ( will key all underling assets against this volume )
 69+ * Set the virtual smil volume ( will key all underling assets against this volume )
7070 * ( we can't presently "normalize" across clips )
7171 */
7272 setPlayerElementVolume: function( percent ){
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -3022,7 +3022,7 @@
30233023
30243024 // update the mute state from the player element
30253025 if( _this.muted != _this.getPlayerElementMuted() ){
3026 - mw.log("monitor:: muted does not mach embed player" );
 3026+ mw.log("monitor:: muted does not match embed player" );
30273027 _this.toggleMute();
30283028 // Make sure they match:
30293029 _this.muted = _this.getPlayerElementMuted();
@@ -3083,7 +3083,7 @@
30843084 }, this.monitorRate )
30853085 }
30863086 } else {
3087 - mw.log("EmbedPlayer::monitor: player is stoped, stop monitor")
 3087+ //mw.log("EmbedPlayer::monitor: player is stoped, stop monitor")
30883088 // If stopped "stop" monitor:
30893089 clearInterval( this.monitorInterval );
30903090 }
Index: branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js
@@ -240,6 +240,22 @@
241241 // give the input focus
242242 .find('input').focus()
243243 },
 244+ renderToDisk: function(){
 245+ var _this = this;
 246+ // add a loading dialog
 247+ var $dialog = mw.addDialog({
 248+ 'resizable':'true',
 249+ 'title' : gM('mwe-sequencer-menu-sequence-publish-desc'),
 250+ 'content' : gM('mwe-sequencer-loading-publish-render'),
 251+ 'width' : 450,
 252+ 'height' : 470,
 253+ 'draggable' : false,
 254+ 'resizable' : false
 255+ });
 256+ mw.load( ['AddMedia.firefogg','FirefoggRender'], function(){
 257+ _this.doPublish( $dialog, true );
 258+ });
 259+ },
244260 /**
245261 * Display the publish dialog
246262 * ( confirm the user has firefogg and rights to save a new version of the file )
@@ -252,7 +268,9 @@
253269 'title' : gM('mwe-sequencer-menu-sequence-publish-desc'),
254270 'content' : gM('mwe-sequencer-loading-publish-render'),
255271 'width' : 450,
256 - 'height' : 470
 272+ 'height' : 470,
 273+ 'draggable' : false,
 274+ 'resizable' : false
257275 });
258276
259277 // Check if we have unsaved changes ( don't publish unsaved changes )
@@ -287,11 +305,8 @@
288306 }
289307 });
290308 },
291 - doPublish: function( $dialog ){
 309+ doPublish: function( $dialog, localFile ){
292310 var _this = this;
293 - // disable drag and resize
294 - $dialog.dialog("option", "draggable", false )
295 - $dialog.dialog( "option", "resizable", false );
296311
297312 // Get a Firefogg object to check if firefogg is installed
298313 var myFogg = new mw.Firefogg( {
@@ -344,7 +359,7 @@
345360 // Start up the render
346361 var foggRender = $j('#publishVideoTarget').firefoggRender({
347362 'statusTarget' : '#firefoggStatusTarget',
348 - 'saveToLocalFile' : false,
 363+ 'saveToLocalFile' : localFile,
349364 'onProgress' : function( progress ){
350365 var progressPrecent = ( Math.round( progress * 10000 ) / 100 );
351366 $j('#firefoggPercentDone').text(
@@ -358,7 +373,11 @@
359374 $j("#firefoggProgressbar .ui-progressbar-value").css('width', Math.round( progress * 10000 ) / 100 + '%');
360375 },
361376 'doneRenderCallback': function( fogg ){
362 - _this.uploadRenderedVideo( $dialog, fogg );
 377+ if( localFile ){
 378+ $dialog.html( gM('mwe-sequencer-save_done') );
 379+ } else {
 380+ _this.uploadRenderedVideo( $dialog, fogg );
 381+ }
363382 }
364383 });
365384 var buttons = {};
@@ -368,7 +387,10 @@
369388 }
370389 // Add cancel button
371390 $dialog.dialog( "option", "buttons", buttons );
372 - foggRender.doRender();
 391+ if( !foggRender.doRender() ){
 392+ // do render returns false on firefox gui cancel close the dialog:
 393+ $dialog.dialog("close");
 394+ }
373395 });
374396 },
375397
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
@@ -30,7 +30,7 @@
3131 },
3232 'duration':{
3333 'editableAttributes' : [ 'dur' ],
34 - 'contentTypes': ['img', 'mwtemplate']
 34+ 'contentTypes': ['img', 'cdata_html', 'mwtemplate']
3535 },
3636 'panzoom' : {
3737 'editWidgets' : ['panzoom'],
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js
@@ -43,16 +43,24 @@
4444 _this.sequencer.getActionsSequence().save();
4545 }
4646 },
47 - /*'renderdisk' : {
 47+ 'renderdisk' : {
4848 'icon' : 'gear',
4949 'action' : function( _this ){
50 - _this.sequencer.getRender().renderDialog();
 50+ _this.sequencer.getActionsSequence().renderToDisk();
 51+ },
 52+ 'condition': function( _this ){
 53+ // Only display if no server is defined:
 54+ return !( _this.sequencer.getServer().isConfigured() )
5155 }
52 - },*/
 56+ },
5357 'publish': {
5458 'icon' : 'gear',
5559 'action' : function( _this ){
5660 _this.sequencer.getActionsSequence().publish();
 61+ },
 62+ 'condition': function( _this ){
 63+ // Only display if publishing server is present
 64+ return ( _this.sequencer.getServer().isConfigured() )
5765 }
5866 },
5967 'exit_divider': 'divider',
@@ -120,7 +128,7 @@
121129 $menuTarget.empty().disableSelection();
122130
123131 for( var menuKey in this.menuConfig ){
124 - // Create a function to preserve menuKey binding scope
 132+ // Create a closure to preserve menuKey binding scope
125133 function drawTopMenu( menuKey ){
126134 // Add the menu target
127135 $menuTarget
@@ -147,12 +155,14 @@
148156 }
149157 drawTopMenu( menuKey );
150158 }
 159+
151160 // Add any menuWidgets
152161 for( var widgetKey in this.menuWidgets ){
153162 $menuTarget.append(
154163 this.menuWidgets[widgetKey]( this )
155164 );
156165 }
 166+
157167 // Append close button to the upper right
158168 $menuTarget.append(
159169 $j.button({
@@ -227,12 +237,22 @@
228238 $j('<li />')
229239 .addClass('divider')
230240 .append( $j('<hr />').css('width', '80%') )
231 - );
232 - } else {
233 - $menu.append(
234 - _this.getMenuItem( menuKey, menuItemKey )
235 - )
 241+ );
 242+ continue;
 243+ }
 244+
 245+ // Check if we have a conditional include
 246+ if( menuItem.condition &&
 247+ typeof menuItem.condition == 'function' &&
 248+ !menuItem.condition( _this )
 249+ ){
 250+ continue;
236251 }
 252+
 253+ // Do a normal menu item include:
 254+ $menu.append(
 255+ _this.getMenuItem( menuKey, menuItemKey )
 256+ )
237257 }
238258 return $menu;
239259 },
Index: branches/MwEmbedStandAlone/libraries/jquery/jquery.ui/ui/jquery.ui.core.js
@@ -24,7 +24,7 @@
2525 // $.ui.plugin is deprecated. Use the proxy pattern instead.
2626 plugin: {
2727 add: function( module, option, set ) {
28 - var proto = $.ui[ module ].prototype;
 28+ var proto = $.ui[ module ].prototype;
2929 for ( var i in set ) {
3030 proto.plugins[ i ] = proto.plugins[ i ] || [];
3131 proto.plugins[ i ].push( [ option, set[ i ] ] );
Index: branches/MwEmbedStandAlone/libraries/jquery/jquery.ui/ui/jquery.ui.tabs.js
@@ -603,7 +603,7 @@
604604 return this;
605605 },
606606
607 - load: function( index ) {
 607+ load: function( index ) {
608608 index = this._getIndex( index );
609609 var self = this,
610610 o = this.options,
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r143';
 8+var mwRemoteVersion = 'r144';
99 var mwUseScriptLoader = true;
1010
1111 // Log the mwRemote version makes it easy to debug cache issues
@@ -35,6 +35,8 @@
3636 mwUseScriptLoader = false;
3737 }
3838
 39+//mwReqParam['debug'] =false;
 40+//mwUseScriptLoader = true;
3941
4042 // Setup up some globals to wrap mwEmbed mw.ready and mw.setConfig functions
4143

Status & tagging log