r70381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70380‎ | r70381 | r70382 >
Date:06:15, 3 August 2010
Author:dale
Status:deferred
Tags:
Comment:
* stubs for register of time change edits
* some code notes about google diff engine for more optimal undo redo once we have time
Modified paths:
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerActionsEdit.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js
@@ -109,7 +109,7 @@
110110 mw.log("Should update trimStartThumb::" + $j(smilClip).attr('clipBegin') );
111111 // Render a thumbnail for relative start time = 0
112112 smil.getLayout().drawElementThumb(
113 - $j(target).find('.trimStartThumb'),
 113+ $j( target ).find('.trimStartThumb'),
114114 smilClip,
115115 0
116116 )
@@ -120,7 +120,7 @@
121121 mw.log("Should update trimStartThumb::" + $j(smilClip).attr('clipBegin') );
122122 // Render a thumbnail for the updated duration
123123 smil.getLayout().drawElementThumb(
124 - $j(target).find('.trimEndThumb'),
 124+ $j( target ).find('.trimEndThumb'),
125125 smilClip,
126126 clipDur
127127 );
@@ -183,14 +183,15 @@
184184 );
185185 },
186186 change: function( event, ui ) {
 187+ var attributeValue = 0, sliderIndex = 0;
187188 if( sliderValues[0] != ui.values[0] ){
188189 var attributeChanged = 'clipBegin';
189190 sliderIndex = 0;
190 - var attributeValue = sliderToTime( ui.values[ 0 ] )
 191+ attributeValue = sliderToTime( ui.values[ 0 ] )
191192 } else {
192193 var attributeChanged = 'dur';
193194 sliderIndex = 1;
194 - var attributeValue = sliderToTime( ui.values[ 1 ]- ui.values[0] )
 195+ attributeValue = sliderToTime( ui.values[ 1 ]- ui.values[0] )
195196 }
196197 sliderValues[ sliderIndex ] = ui.values[ sliderIndex ];
197198
@@ -199,6 +200,10 @@
200201
201202 // update the widget
202203 _this.editWidgets.trimTimeline.update( _this, target, smilClip);
 204+
 205+ // Register the edit state for undo / redo
 206+ _this.sequencer.getActionsEdit().registerEdit();
 207+
203208 }
204209 })
205210 );
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js
@@ -103,12 +103,12 @@
104104 var $menuTarget = this.sequencer.getMenuTarget();
105105 $menuTarget.empty();
106106
107 - for( var menuKey in this.menuConfig ){
 107+ for( var menuKey in this.menuConfig ){
108108 // Create a function to preserve menuKey binding scope
109109 function drawTopMenu( menuKey ){
110110 // Add the menu target
111111 $menuTarget
112 - .append(
 112+ .append(
113113 $j('<span />')
114114 .html( gM('mwe-sequencer-menu-' + menuKey ) )
115115 .css({
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -359,7 +359,9 @@
360360 $j(curClip).addClass( 'selectedClip')
361361 }
362362 });
363 - }
 363+ }
 364+
 365+ // xxx check if selected clip has changed hide tool edit interface
364366 },
365367
366368 getTimelineClipId: function( $node ){
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerActionsEdit.js
@@ -53,8 +53,9 @@
5454 this.editStack = this.editStack.splice(0, this.editIndex);
5555 }
5656
57 - // @@TODO would be good to just compute the diff in JS and store that
58 - // ( instead of the full xml text )
 57+ // @@TODO could save space to just compute the diff in JS and store that
 58+ // ie: http://code.google.com/p/google-diff-match-patch/
 59+ // ( instead of the full xml text with "key-pages" every 10 edits or something like that.
5960 this.editStack.push( this.sequencer.getSmil().getXMLString() );
6061
6162 // Update the editIndex

Status & tagging log