r51730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51729‎ | r51730 | r51731 >
Date:05:33, 11 June 2009
Author:dale
Status:deferred
Tags:
Comment:
lots of sequencer updates
* save ~working~
* edit duration working with clip selection preservation
* some language updates for sequencer
* more stable display of clipEdit
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/mv_embed.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -30,8 +30,8 @@
3131 "cc_nd_title": "No Derivative Works",
3232 "cc_sa_title": "Share Alike",
3333 "cc_pd_title": "Public Domain",
34 - "unknown_license": "Unknown License",
35 - "no_import_by_url": "This User or Wiki <b>can not</b> import assets from remote URLs. <br> If permissions are set you may have to enable $wgAllowCopyUploads, <a href=\"http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads\">more info</a>"
 34+ "unknown_license": "Unknown License",
 35+ "no_import_by_url": "This User or Wiki <b>can not</b> import assets from remote URLs. <br><br> Do you need to Login? <br><br>If permissions are set you may have to enable $wgAllowCopyUploads, <a href=\"http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads\">more info</a>"
3636 });
3737 var default_remote_search_options = {
3838 'profile':'mediawiki_edit',
@@ -301,7 +301,7 @@
302302
303303 cUpLoader : null,
304304 cEdit : null,
305 - dmodalCss : null,
 305+ dmodalCss : {},
306306
307307 init: function( iObj ){
308308 var _this = this;
@@ -414,8 +414,8 @@
415415 _this.target_container = '#rsd_modal_target';
416416 js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id'));
417417 js_log('added target id:' + $j(_this.target_container).attr('id'));
418 - //get layout
419 - layout = _this.getMaxModalLayout();
 418+ //get layout
 419+ //layout = _this.getMaxModalLayout();
420420 $j(_this.target_container).dialog({
421421 bgiframe: true,
422422 autoOpen: true,
@@ -428,7 +428,7 @@
429429 close: function() {
430430 js_log('closed modal');
431431 }
432 - }).parent('.ui-dialog').css( _this.dmodalCss )
 432+ }).css({'height':'100%'}).parent('.ui-dialog').css( _this.dmodalCss )
433433 //@@bind on resize to disable css dialog to update dmodelCss
434434 .bind('resizestart', function(event, ui) {
435435 _this.dmodalCss = {};
@@ -438,17 +438,17 @@
439439 .bind('dragstart', function(event, ui) {
440440 _this.dmodalCss = {};
441441 $j(this).css({});
442 - })
 442+ });
443443 //update the child position: (some of this should be pushed up-stream via dialog config options
444 - .children('.ui-dialog-buttonpane').css({
445 - 'position':'abolute',
 444+ $j(_this.target_container +'~ .ui-dialog-buttonpane').css({
 445+ 'position':'absolute',
446446 'left':'0px',
447447 'right':'0px',
448448 'bottom':'0px'
449449 });
 450+ js_log('done setup of target_container: '+ $j(_this.target_container +'~ .ui-dialog-buttonpane').length);
450451
451452
452 -
453453 /*var resizeTimer = false;
454454 $j(window).bind('resize', function() {
455455 var adjustModal = function(){
@@ -692,8 +692,8 @@
693693 if( this.disp_item == 'combined' ){
694694 //combined results are harder to error handle just ignore that repo
695695 cp.sObj.loading = false;
696 - }else{
697 - $j('#rsd_results').html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>');
 696+ }else{
 697+ $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>');
698698 }
699699 return false;
700700 }
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js
@@ -117,9 +117,10 @@
118118 doEditor:function(){
119119 //black out the page:
120120 //$j('body').append('<div id="ui-widget-overlay"/> <div id="modalbox" class="ui-widget ui-widget-content ui-corner-all modal_editor">' );
121 -
122 - $j('body').append('<div id="sequencer_target" style="position:aboslute;top:10px;left:10px;right:10px;bottom:10px" title="' + gM('loading_title') + '" ></div>');
123 - $j('#sequencer_target').dialog({
 121+ $j('body').append('<div class="ui-widget-overlay" style="width: 100%; height: 100%px; z-index: 10;"></div>');
 122+ $j('body').append('<div id="sequencer_target" style="z-index:11;position:fixed;top:10px;left:10px;right:10px;bottom:10px;" ' +
 123+ 'class="ui-widget ui-widget-content ui-corner-all"></div>');
 124+ /*$j('#sequencer_target').dialog({
124125 bgiframe: true,
125126 autoOpen: true,
126127 modal: true,
@@ -128,6 +129,9 @@
129130 $j(this).dialog('close');
130131 }
131132 },
 133+ }).css({
 134+ "position":"relative",
 135+ "height": "90%"
132136 }).parent('.ui-dialog').css({
133137 'width':'auto',
134138 'height':'auto',
@@ -135,7 +139,7 @@
136140 'left' : '10px',
137141 'right' : '10px',
138142 'bottom': '10px'
139 - });
 143+ });*/
140144 //@@todo clone the playlist (for faster startup)
141145 /*var this_plObj_Clone = $j('#'+this.id).get(0).cloneNode(true);
142146 this_plObj_Clone.sequencer=true;
@@ -484,7 +488,8 @@
485489 $j( $j.btnHtml('edit', 'editBtn_'+this.id, 'pencil',
486490 {'style':'position:absolute;right:0;;font-size:x-small;height:10px;margin-bottom:0;padding-bottom:7px;padding-top:0;'} )
487491 ).click(function(){
488 - _this.doEditor();
 492+ _this.doEditor();
 493+ return false;
489494 }).appendTo('#ptitle_'+this.id);
490495 $j('.editBtn_'+this.id).btnBind();
491496 }
@@ -1683,18 +1688,24 @@
16841689 js_log('f:doParse smilPlaylist');
16851690 //@@todo get/parse meta that we are intersted in:
16861691 var meta_tags = this.data.getElementsByTagName('meta');
1687 - var metaNames = new Array('title','interface_url', 'linkback', 'mTitle', 'mTalk');
 1692+ var metaNames = {
 1693+ 'title':'',
 1694+ 'interface_url':"",
 1695+ 'linkback':"",
 1696+ 'mTitle':"",
 1697+ 'mTalk':"",
 1698+ 'mTouchedTime':""
 1699+ };
16881700 $j.each(meta_tags, function(i,meta_elm){
16891701 //js_log( "on META tag: "+ $j(meta_elm).attr('name') );
1690 - for(var i in metaNames){
1691 - var _name = metaNames[i];
1692 - if( $j(meta_elm).attr('name') && $j(meta_elm).attr('content') ){
1693 - if( $j(meta_elm).attr('name')== _name ){
1694 - _this[ _name ] = $j(meta_elm).attr('content');
1695 - js_log('set :' + _name + ' to ' + _this[ _name ]);
1696 - }
1697 - }
1698 - }
 1702+ if( $j(meta_elm).attr('name') in metaNames){
 1703+ _this[ $j(meta_elm).attr('name') ] = $j(meta_elm).attr('content');
 1704+ }
 1705+ //special check for wikiDesc
 1706+ if( $j(meta_elm).attr('name') == 'wikiDesc'){
 1707+ if(meta_elm.firstChild)
 1708+ _this.wikiDesc = meta_elm.firstChild.nodeValue;
 1709+ }
16991710 });
17001711 //add transition objects:
17011712 var transition_tags = this.data.getElementsByTagName('transition');
@@ -1720,13 +1731,14 @@
17211732 }
17221733 }
17231734 });
1724 - });
 1735+ });
17251736 js_log("done proc seq tags");
17261737 return true;
17271738 },
17281739 tryAddMedia:function(mediaElement, order, track_id){
17291740 js_log('SMIL:tryAddMedia:' + mediaElement);
17301741 //set up basic mvSMILClip send it the mediaElemnt & mvClip init:
 1742+ var clipObj = {};
17311743 var clipObj = new mvSMILClip(mediaElement,
17321744 {
17331745 "id":'p_' + this.id + '_c_' + order,
@@ -1774,7 +1786,8 @@
17751787 instanceOf:'mvSMILClip',
17761788 params : {}, //support param as child of ref clips per SMIL spec
17771789 init:function(sClipElm, mvClipInit){
1778 - _this = this;
 1790+ _this = this;
 1791+ this.params = {};
17791792 //make new mvCLip with ClipInit vals
17801793 var myMvClip = new mvClip( mvClipInit );
17811794
@@ -1828,16 +1841,14 @@
18291842 //if unset type and we have innerHTML assume text/html type
18301843 if( !this.type && this.wholeText ){
18311844 this.type = 'text/html';
1832 - }
1833 -
 1845+ }
18341846 //also grab andy child param elements if present:
1835 - if( sClipElm.getElementsByTagName('param')[0] ){
 1847+ if( sClipElm.getElementsByTagName('param')[0] ){
18361848 for(var i=0; i< sClipElm.getElementsByTagName('param').length; i++){
18371849 this.params[ sClipElm.getElementsByTagName('param')[i].getAttribute("name") ] =
18381850 sClipElm.getElementsByTagName('param')[i].firstChild.nodeValue;
18391851 }
1840 - }
1841 -
 1852+ }
18421853 return this;
18431854 },
18441855 //returns the values of supported_attributes:
@@ -2004,7 +2015,13 @@
20052016 * (probably have to use a Time object to fully support the smil spec
20062017 */
20072018 function smilParseTime(time_str){
2008 - return parseInt(time_str.replace('s', ''));
 2019+ //first check for hh:mm:ss time:
 2020+ if(time_str.split(':').length == 3){
 2021+ return npt2seconds(time_str);
 2022+ }else{
 2023+ //assume 34s secconds representation
 2024+ return parseInt(time_str.replace('s', ''));
 2025+ }
20092026 }
20102027 //stores a list pointers to active clips (maybe this should just be a property of clips (but results in lots of seeks)
20112028 var activeClipList = function(){
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -33,6 +33,8 @@
3434
3535 "edit_clip" : "Edit Clip",
3636 "edit_save" : "Save Changes",
 37+ "saving_wait": "Save in Progress (please wait)",
 38+ "save_done" : "Save Done",
3739 "edit_cancel" : "Cancel Edit",
3840 "edit_cancel_confirm" : "Are you sure you want to cancel your edit. Changes will be lost",
3941
@@ -100,7 +102,9 @@
101103 //stores the clipboard edit token (if user has rights to edit their User page)
102104 clipboardEditToken:null,
103105 //stores the sequence edit token (if user has rights to edit the current sequence)
104 - sequenceEditToken:null,
 106+ sequenceEditToken:null,
 107+ //the time the sequence was last touched (grabbed at time of startup)
 108+ sequenceTouchedTime:null,
105109
106110
107111
@@ -222,11 +226,11 @@
223227 '<div id="'+this.sequence_tools_id+'" style="position:absolute;' +
224228 'left:0px;right:'+(this.video_width+15)+'px;top:0px;height:'+(this.video_height+23)+'px;"/>'+
225229 '<div id="'+this.timeline_id+'" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' +
226 - 'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:25px;overflow:auto;">'+
 230+ 'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:35px;overflow:auto;">'+
227231 gM('loading_timeline')+ '</div>'+
228 - '<div id="' + this.target_sequence_container + '_status" style="position:absolute;left:0px;width:300px;"></div>'+
229 - '<div id="' + this.target_sequence_container + '_save_cancel" style="position:absolute;'+
230 - 'right:0px;bottom:0px;height:25px;overflow:hidden;">'+
 232+ '<div class="seq_status" style="position:absolute;left:0px;width:300px;"></div>'+
 233+ '<div class="seq_save_cancel" style="position:absolute;'+
 234+ 'left:5px;bottom:0px;height:25px;">'+
231235 gM('loading_user_rights') +
232236 '</div>'
233237 );
@@ -262,24 +266,18 @@
263267 rewrite_by_id( this.plObj_id );
264268 setTimeout(this.instance_name +'.checkReadyPlObj()', 25);
265269 },
266 - updateSeqSaveButtons:function(){
 270+ updateSeqSaveButtons:function(){
267271 var _this = this;
268 - var cancel_button = '<a id="mv_cancel_seq_button" href="#" style="border:' +
269 - 'solid gray;font-size:1.2em;" ">' +
270 - gM('edit_cancel') + '</a> ';
271272 if( this.sequenceEditToken ){
272 - $j(this.target_sequence_container+'_save_cancel').html( cancel_button +
273 - '<a style="border:solid gray;font-size:1.2em;" href="#" onClick="'+this.instance_name+'.getSeqOutputJSON()">'+
274 - 'Preview Json Output'+
275 - '</a>' +
276 - '<a style="border:solid gray;font-size:1.2em;" href="#" onClick="'+this.instance_name+'.getSeqOutputHLRDXML()">'+
277 - 'Preview XML Output (will be save shortly) ' +
278 - '</a>');
 273+ $j(this.target_sequence_container+' .seq_save_cancel').html(
 274+ $j.btnHtml( gM('edit_cancel'), 'seq_edit_cancel', 'close') + ' ' +
 275+ $j.btnHtml( gM('edit_save'), 'seq_edit_save', 'close')
 276+ );
279277 }else{
280 - $j(this.target_sequence_container+'_save_cancel').html( cancel_button + gM('no_edit_permissions') );
 278+ $j(this.target_sequence_container+' .seq_save_cancel').html( cancel_button + gM('no_edit_permissions') );
281279 }
282280 //assing bindings
283 - $j('#mv_cancel_seq_button').unbind().click(function(){
 281+ $j(this.target_sequence_container +' .seq_edit_cancel').unbind().click(function(){
284282 var x = window.confirm( gM('edit_cancel_confirm') );
285283 if( x ){
286284 _this.closeModEditor();
@@ -287,6 +285,59 @@
288286 //close request canceled.
289287 }
290288 });
 289+ $j(this.target_sequence_container +' .seq_edit_save').unbind().click(function(){
 290+ //pop up progress dialog ~requesting edit line summary~
 291+ //remove any other save dialog
 292+ $j('#seq_save_dialog').remove();
 293+ $j('body').append('<div id="seq_save_dialog" title="'+ gM('edit_save') +'">' +
 294+ '<span class="mw-summary">'+
 295+ '<label for="seq_save_summary">Edit summary: </label>' +
 296+ '</span>'+
 297+ '<input id="seq_save_summary" tabindex="1" maxlength="200" value="" size="30" name="seq_save_summary"/>'+
 298+ '</div>');
 299+ //dialog:
 300+ $j('#seq_save_dialog').dialog({
 301+ bgiframe: true,
 302+ autoOpen: true,
 303+ modal: true,
 304+ buttons:{
 305+ "Save":function(){
 306+ var saveReq = {
 307+ 'action' : 'edit',
 308+ 'title' : _this.plObj.mTitle,
 309+ //the text is the sequence XML + the description
 310+ 'text' : _this.getSeqOutputHLRDXML() + "\n" +
 311+ _this.plObj.wikiDesc,
 312+ 'token' : _this.sequenceEditToken,
 313+ 'summary' : $j('#seq_save_summary').val()
 314+ };
 315+ //change to progress bar and save:
 316+ $j('#seq_save_dialog').html('<div class="progress" /><br>' +
 317+ gM('saving_wait')
 318+ )
 319+ $j('#seq_save_dialog .progress').progressbar({
 320+ value: 100
 321+ });
 322+ //run the Seq Save Request:
 323+ do_api_req( {
 324+ 'data': saveReq,
 325+ 'url' : _this.getLocalApiUrl()
 326+ },function(data){
 327+ $j('#seq_save_dialog').html( gM('save_done') );
 328+ $j('#seq_save_dialog').dialog('option',
 329+ 'buttons', {
 330+ "Ok": function() {
 331+ $j(this).dialog("close");
 332+ }
 333+ });
 334+ });
 335+ },
 336+ "Cancel":function(){
 337+ $j(this).dialog('close');
 338+ }
 339+ }
 340+ });
 341+ })
291342 },
292343 //display a menu item (hide the rest)
293344 disp:function( item ){
@@ -453,10 +504,9 @@
454505 return this.plObj.interface_url;
455506 },
456507 plReadyInit:function(){
457 - var this_seq = this;
458 - //debugger;
 508+ var _this = this;
459509 js_log('plReadyInit');
460 - js_log( this.plObj );
 510+ js_log( this.plObj );
461511 //give the playlist a pointer to its parent seq:
462512 this.plObj['seqObj'] = this;
463513
@@ -468,33 +518,34 @@
469519 //propagate the edit tokens
470520 //if on an edit page just grab from the form:
471521 this.sequenceEditToken = $j('input[wpEditToken]').val();
472 - if(typeof this.sequenceEditToken == 'undefined' && this.getLocalApiUrl()!=null){
 522+
 523+ if(typeof this.sequenceEditToken == 'undefined' && this.getLocalApiUrl()!=null){
473524 var reqObj = {
474525 'action':'query',
475526 'prop':'info',
476527 'intoken':'edit',
477 - 'titles': this_seq.plObj.mTitle
478 - };
479 -
 528+ 'titles': _this.plObj.mTitle
 529+ };
480530 do_api_req( {
481531 'data': reqObj,
482 - 'url' : this_seq.getLocalApiUrl()
 532+ 'url' : _this.getLocalApiUrl()
483533 },function(data){
 534+ var cat = data;
484535 for(var i in data.query.pages){
485536 if(data.query.pages[i]['edittoken'])
486 - this_seq.sequenceEditToken = data.query.pages[i]['edittoken'];
 537+ _this.sequenceEditToken = data.query.pages[i]['edittoken'];
487538 }
488 - this_seq.updateSeqSaveButtons();
 539+ _this.updateSeqSaveButtons();
489540 }
490541 );
491 - reqObj['titles']=this_seq.plObj.mTalk;
 542+ reqObj['titles']=_this.plObj.mTalk;
492543 do_api_req( {
493544 'data': reqObj,
494 - 'url' : this_seq.getLocalApiUrl()
 545+ 'url' : _this.getLocalApiUrl()
495546 }, function( data ){
496547 for(var j in data.query.pages){
497548 if(data.query.pages[j]['edittoken'])
498 - this_seq.clipboardEditToken = data.query.pages[j]['edittoken'];
 549+ _this.clipboardEditToken = data.query.pages[j]['edittoken'];
499550 }
500551 }
501552 );
@@ -557,7 +608,7 @@
558609 $j("#seq_menu").tabs({
559610 selected:selected_tab,
560611 select: function(event, ui) {
561 - this_seq.disp( $j(ui.tab).attr('id').replace('mv_menu_item_', '') );
 612+ _this.disp( $j(ui.tab).attr('id').replace('mv_menu_item_', '') );
562613 }
563614 //add sorting
564615 }).find(".ui-tabs-nav").sortable({ axis : 'x' });
@@ -576,34 +627,34 @@
577628 $j().keydown(function(e){
578629 js_log('pushed down on:' + e.which);
579630 if( e.which == 16 )
580 - this_seq.key_shift_down = true;
 631+ _this.key_shift_down = true;
581632
582633 if( e.which == 17)
583634 this_seq.key_ctrl_down = true;
584635
585 - if( (e.which == 67 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
586 - this_seq.copySelectedClips();
 636+ if( (e.which == 67 && this_seq.key_ctrl_down) && !_this.inputFocus)
 637+ _this.copySelectedClips();
587638
588 - if( (e.which == 88 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
589 - this_seq.cutSelectedClips();
 639+ if( (e.which == 88 && this_seq.key_ctrl_down) && !_this.inputFocus)
 640+ _this.cutSelectedClips();
590641
591642 //paste cips on v + ctrl while not focused on a text area:
592 - if( (e.which == 86 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
593 - this_seq.pasteClipBoardClips();
 643+ if( (e.which == 86 && this_seq.key_ctrl_down) && !_this.inputFocus)
 644+ _this.pasteClipBoardClips();
594645
595646 });
596647 $j().keyup(function(e){
597648 js_log('key up on ' + e.which);
598649 //user let go of "shift" turn off multi-select
599650 if( e.which == 16 )
600 - this_seq.key_shift_down = false;
 651+ _this.key_shift_down = false;
601652
602653 if( e.which == 17)
603 - this_seq.key_ctrl_down = false;
 654+ _this.key_ctrl_down = false;
604655
605656 //backspace or delete key while not focused on a text area:
606657 if( (e.which == 8 || e.which == 46) && !this_seq.inputFocus)
607 - this_seq.removeSelectedClips();
 658+ _this.removeSelectedClips();
608659 });
609660 },
610661 //check all nodes for focus
@@ -632,13 +683,13 @@
633684 getSeqOutputJSON:function(){
634685 js_log('json output:');
635686 },
636 - getSeqOutputHLRDXML:function(){
 687+ getSeqOutputHLRDXML:function(){
637688 var o='<sequence_hlrd>' +"\n";
638 - o+="\t<head>";
 689+ o+="\t<head>\n";
639690 //get transitions
640691 for(var i in this.plObj.transitions){
641692 var tObj = this.plObj.transitions[i].getAttributeObj();
642 - o+="\t<transition ";
 693+ o+="\t\t<transition ";
643694 for(var j in tObj){
644695 o+=' '+j+'="' + tObj[j] + '"\n\t\t';
645696 }
@@ -663,19 +714,22 @@
664715 var cAttr = curClip.getAttributeObj();
665716 for(var j in cAttr){
666717 var val = (j=='transIn' || j=='transOut') ? cAttr[j].id : cAttr[j];
667 - o+=' '+j+'="' + val + '"\n\t\t\t';
668 - }
669 - o+="/>\n" //close the clip
 718+ o+=j+'="' + val + '"\n\t\t';
 719+ }
 720+ o+=">\n" //close the clip
 721+ for(var pName in curClip.params){
 722+ var pVal = curClip.params[pName];
 723+ o+="\t\t\t" + '<param name="'+ pName + '">' + pVal + '</param>' + "\n";
 724+ }
 725+ o+="\t\t</ref>\n";
670726 }
671 - o+="\n</seq>n";
 727+ o+="\n</seq>\n";
672728 }
673729 o+="\t</body>\n";
674730 //close the tag
675 - o+='</sequence_hlrd>';
 731+ o+='</sequence_hlrd>';
676732
677 - alert('f:getSeqOutputHLRDXML'+ o);
678 -
679 - return false;
 733+ return o;
680734 },
681735 editClip:function(track_inx, clip_inx){
682736 var cObj = this.plObj.tracks[ track_inx ].clips[ clip_inx ];
@@ -788,7 +842,7 @@
789843 if(remove_clip_ary.length !=0 )
790844 this.removeClips(remove_clip_ary);
791845
792 - //doEdit selected clips (updated selecte resource)
 846+ //doEdit selected clips (updated selected resource)
793847 this.doEditSelectedClip();
794848 },
795849 //add a single or set of clips
@@ -1381,7 +1435,14 @@
13821436 this.do_refresh_timeline();
13831437 js_log('zoom out: '+this.timeline_scale);
13841438 },
1385 - do_refresh_timeline:function(){
 1439+ do_refresh_timeline:function( preserve_selection ){
 1440+ //@@todo should "lock" interface while refreshing timeline
 1441+ var pSelClips = [];
 1442+ if(preserve_selection){
 1443+ $j('.mv_selected_clip').each(function(){
 1444+ pSelClips.push( $j(this).parent().attr('id') );
 1445+ });
 1446+ }
13861447 //regen duration
13871448 this.plObj.getDuration( true );
13881449 //refresh player:
@@ -1390,6 +1451,12 @@
13911452 this.render_playheadhead_seeker();
13921453 this.render_tracks();
13931454 this.jt(this.playline_time);
 1455+
 1456+ if(preserve_selection){
 1457+ for(var i=0;i < pSelClips.length; i++){
 1458+ $j('#' + pSelClips[i] + ' .mv_clip_thumb').addClass('mv_selected_clip');
 1459+ }
 1460+ }
13941461 }
13951462
13961463 }
@@ -1411,7 +1478,7 @@
14121479 this.org_control_height = this.pl_layout.control_height;
14131480 //do specific mods:(controls and title are managed by the sequencer)
14141481 this.pl_layout.title_bar_height=0;
1415 - this.pl_layout.control_height=0;
 1482+ this.pl_layout.control_height=0;
14161483 },
14171484 setSliderValue:function( perc ){
14181485 //get the track_clipThumb_height from parent mvSequencer
Index: branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -95,18 +95,28 @@
9696 //maybe we should refactor these into their own classes
9797 //more refactor each media type should be its own class inheriting the shared baseEditType object
9898 edit_types:{
99 - 'duration':{
100 - d:1,
 99+ 'duration':{
101100 'media':['image','template'],
102101 'doEdit':function(target, _this ){
 102+ //(_this is a smilClip instance)
103103 //do clock mouse scroll duration editor
104 - $j(target).html(
105 - _this.getInput
106 - );
 104+ $j(target).html(
 105+ '<label for="ce_dur">Duration: </label>' +
 106+ '<input name="ce_dur" tabindex="1" maxlength="11" value="'+
 107+ seconds2npt( _this.rObj.getDuration() )+
 108+ '" size="10"/>'+
 109+ '</div>'
 110+ ).children("input[name='ce_dur']").change(function(){
 111+ js_log("update duration:" + $j(this).val() );
 112+ //update the parent sequence object:
 113+ _this.rObj.dur = smilParseTime( $j(this).val() );
 114+ //update the playlist:
 115+ _this.p_seqObj.do_refresh_timeline( true );
 116+ });
 117+
107118 }
108119 },
109120 'inoutpoints':{
110 - 'd':1,
111121 'media':['video'],
112122 'doEdit':function(target, _this ){
113123 //do clock mouse scroll duration editor
@@ -121,14 +131,13 @@
122132 $j(target).html(
123133 _this.getSetInOutHtml({
124134 'start_ntp' : start_ntp,
125 - 'end_ntp' : end_ntp
 135+ 'end_ntp' : end_ntp
126136 })
127137 );
128138 _this.setInOutBindings();
129139 }
130140 },
131141 'fileopts':{
132 - 'd':0,
133142 'media':['image','video','template'],
134143 'doEdit':function(target, _this ){
135144 var doEditHtml = function(){
@@ -159,7 +168,7 @@
160169 '<td>' +
161170 _this.rObj.tVars[i] +
162171 '</td>' +
163 - '<td><input type="text" size="15" maxwidth="255" value="';
 172+ '<td><input name="'+_this.rObj.tVars[i]+'" class="ic_tparam" type="text" size="15" maxwidth="255" value="';
164173 if(_this.rObj.params[ _this.rObj.tVars[i] ]){
165174 o+= _this.rObj.params[ _this.rObj.tVars[i] ];
166175 }
@@ -184,6 +193,9 @@
185194
186195 $j(target).html ( o );
187196 //add update bindings
 197+ $j(target + ' .ic_tparam').change(function(){
 198+ js_log("updated tparam" + $j(this).attr("name"));
 199+ })
188200
189201 //update doFocusBindings
190202 if( _this.p_seqObj )
@@ -242,20 +254,16 @@
243255 }else{
244256 doEditHtml();
245257 }
246 -
247 -
248258 }
249259 },
250 - 'panzoom':{
251 - 'd':0,
 260+ 'panzoom':{
252261 'media':['image','video'],
253262 'doEdit':function(target, _this ){
254263 //do clock mouse scroll duration editor
255264 $j(target).html('<h3>Set Position</h3><h3>Set Zoom</h3><h3>Set Crop</h3><h3>Set Aspect</h3>');
256265 }
257266 },
258 - 'overlays':{
259 - 'd':0,
 267+ 'overlays':{
260268 'media':['image','video'],
261269 'doEdit':function(target, _this ){
262270 //do clock mouse scroll duration editor
@@ -263,7 +271,6 @@
264272 }
265273 },
266274 'audio':{
267 - 'd':0,
268275 'media':['image','video', 'template'],
269276 'doEdit':function(target, _this ){
270277 //do clock mouse scroll duration editor
@@ -279,13 +286,16 @@
280287 var tabc ='';
281288 o+= '<div id="mv_submenu_clipedit">';
282289 o+='<ul>';
283 - var selected_tab = 0;
 290+ var first_tab = false;
284291 $j.each(this.edit_types, function(sInx, editType){
285292 //check if the given editType is valid for our given media type
286293 var include = false;
287294 for(var i =0; i < editType.media.length;i++){
288 - if( editType.media[i] == _this.media_type)
 295+ if( editType.media[i] == _this.media_type){
289296 include = true;
 297+ if(!first_tab)
 298+ first_tab = sInx;
 299+ }
290300 }
291301 if(include){
292302 o+= '<li>'+
@@ -300,22 +310,19 @@
301311 $j('#'+this.control_ct).html( o ) ;
302312 //set up bindings:
303313 $j('#mv_submenu_clipedit').tabs({
 314+ selected: 0,
304315 select: function(event, ui) {
305316 _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_smi_', '') );
306 - }
307 - //add sorting
 317+ }
308318 }).addClass('ui-tabs-vertical ui-helper-clearfix');
309319 //close left:
310320 $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left');
311321 //update the default edit display:
312 - _this.doDisplayEdit();
 322+ _this.doDisplayEdit( first_tab );
313323 },
314324 doDisplayEdit:function( edit_type ){
315325 if(!edit_type)
316 - for(var i in this.edit_types){
317 - if(this.edit_types[i].d == 1)
318 - edit_type = i;
319 - }
 326+ return false;
320327 js_log('doDisplayEdit: ' + edit_type );
321328
322329 //do edit interface for that edit type:
Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js
@@ -512,14 +512,16 @@
513513
514514 //make sure we have jQuery
515515 _this.jQueryCheck(function(){
516 - var depReq = new Array();
517 - depReq.push( [
518 - '$j.ui',
519 - 'embedVideo',
520 - '$j.cookie'
521 - ], [
522 - '$j.ui.slider'
523 - ]);
 516+ var depReq = [
 517+ [
 518+ '$j.ui',
 519+ 'embedVideo',
 520+ '$j.cookie'
 521+ ],
 522+ [
 523+ '$j.ui.slider'
 524+ ]
 525+ ];
524526 //add png fix if needed:
525527 if($j.browser.msie || $j.browser.version < 7)
526528 depReq[0].push( '$j.fn.pngFix' );
@@ -764,7 +766,8 @@
765767 [
766768 '$j.ui.dialog',
767769 '$j.ui.droppable',
768 - '$j.ui.draggable',
 770+ '$j.ui.draggable',
 771+ '$j.ui.progressbar',
769772 '$j.ui.sortable',
770773 '$j.ui.resizable',
771774 '$j.ui.slider',
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -201,7 +201,7 @@
202202 $j(embed_video).css({
203203 'width':videoInterface.width,
204204 'height':videoInterface.height
205 - });
 205+ }).html( mv_get_loading_img() );
206206 //inherit the video interface
207207 for(var method in videoInterface){ //for in loop oky in Element context
208208 if(method!='readyState'){ //readyState crashes IE
@@ -225,9 +225,7 @@
226226 //now swap out the video element for the embed_video obj:
227227 $j(video_element).after(embed_video).remove();
228228 //js_log('did swap');
229 - $j('#'+embed_video.id).get(0).on_dom_swap();
230 - //remove loading:
231 - $j('#pre_loading_div_'+embed_video.id).remove();
 229+ $j('#'+embed_video.id).get(0).on_dom_swap();
232230 // now that "embed_video" is stable, do more initialization (if we are ready)
233231 if($j('#'+embed_video.id).get(0).loading_external_data==false &&
234232 $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){
@@ -235,7 +233,7 @@
236234 $j('#'+embed_video.id).get(0).init_with_sources_loaded();
237235 }
238236 js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length);
239 - return true;
 237+ return true;
240238 },
241239 //this should not be needed.
242240 checkClipsReady : function(){

Status & tagging log