Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -30,8 +30,8 @@ |
31 | 31 | "cc_nd_title": "No Derivative Works", |
32 | 32 | "cc_sa_title": "Share Alike", |
33 | 33 | "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>" |
36 | 36 | }); |
37 | 37 | var default_remote_search_options = { |
38 | 38 | 'profile':'mediawiki_edit', |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | |
303 | 303 | cUpLoader : null, |
304 | 304 | cEdit : null, |
305 | | - dmodalCss : null, |
| 305 | + dmodalCss : {}, |
306 | 306 | |
307 | 307 | init: function( iObj ){ |
308 | 308 | var _this = this; |
— | — | @@ -414,8 +414,8 @@ |
415 | 415 | _this.target_container = '#rsd_modal_target'; |
416 | 416 | js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id')); |
417 | 417 | 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(); |
420 | 420 | $j(_this.target_container).dialog({ |
421 | 421 | bgiframe: true, |
422 | 422 | autoOpen: true, |
— | — | @@ -428,7 +428,7 @@ |
429 | 429 | close: function() { |
430 | 430 | js_log('closed modal'); |
431 | 431 | } |
432 | | - }).parent('.ui-dialog').css( _this.dmodalCss ) |
| 432 | + }).css({'height':'100%'}).parent('.ui-dialog').css( _this.dmodalCss ) |
433 | 433 | //@@bind on resize to disable css dialog to update dmodelCss |
434 | 434 | .bind('resizestart', function(event, ui) { |
435 | 435 | _this.dmodalCss = {}; |
— | — | @@ -438,17 +438,17 @@ |
439 | 439 | .bind('dragstart', function(event, ui) { |
440 | 440 | _this.dmodalCss = {}; |
441 | 441 | $j(this).css({}); |
442 | | - }) |
| 442 | + }); |
443 | 443 | //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', |
446 | 446 | 'left':'0px', |
447 | 447 | 'right':'0px', |
448 | 448 | 'bottom':'0px' |
449 | 449 | }); |
| 450 | + js_log('done setup of target_container: '+ $j(_this.target_container +'~ .ui-dialog-buttonpane').length); |
450 | 451 | |
451 | 452 | |
452 | | - |
453 | 453 | /*var resizeTimer = false; |
454 | 454 | $j(window).bind('resize', function() { |
455 | 455 | var adjustModal = function(){ |
— | — | @@ -692,8 +692,8 @@ |
693 | 693 | if( this.disp_item == 'combined' ){ |
694 | 694 | //combined results are harder to error handle just ignore that repo |
695 | 695 | 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>'); |
698 | 698 | } |
699 | 699 | return false; |
700 | 700 | } |
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js |
— | — | @@ -117,9 +117,10 @@ |
118 | 118 | doEditor:function(){ |
119 | 119 | //black out the page: |
120 | 120 | //$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({ |
124 | 125 | bgiframe: true, |
125 | 126 | autoOpen: true, |
126 | 127 | modal: true, |
— | — | @@ -128,6 +129,9 @@ |
129 | 130 | $j(this).dialog('close'); |
130 | 131 | } |
131 | 132 | }, |
| 133 | + }).css({ |
| 134 | + "position":"relative", |
| 135 | + "height": "90%" |
132 | 136 | }).parent('.ui-dialog').css({ |
133 | 137 | 'width':'auto', |
134 | 138 | 'height':'auto', |
— | — | @@ -135,7 +139,7 @@ |
136 | 140 | 'left' : '10px', |
137 | 141 | 'right' : '10px', |
138 | 142 | 'bottom': '10px' |
139 | | - }); |
| 143 | + });*/ |
140 | 144 | //@@todo clone the playlist (for faster startup) |
141 | 145 | /*var this_plObj_Clone = $j('#'+this.id).get(0).cloneNode(true); |
142 | 146 | this_plObj_Clone.sequencer=true; |
— | — | @@ -484,7 +488,8 @@ |
485 | 489 | $j( $j.btnHtml('edit', 'editBtn_'+this.id, 'pencil', |
486 | 490 | {'style':'position:absolute;right:0;;font-size:x-small;height:10px;margin-bottom:0;padding-bottom:7px;padding-top:0;'} ) |
487 | 491 | ).click(function(){ |
488 | | - _this.doEditor(); |
| 492 | + _this.doEditor(); |
| 493 | + return false; |
489 | 494 | }).appendTo('#ptitle_'+this.id); |
490 | 495 | $j('.editBtn_'+this.id).btnBind(); |
491 | 496 | } |
— | — | @@ -1683,18 +1688,24 @@ |
1684 | 1689 | js_log('f:doParse smilPlaylist'); |
1685 | 1690 | //@@todo get/parse meta that we are intersted in: |
1686 | 1691 | 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 | + }; |
1688 | 1700 | $j.each(meta_tags, function(i,meta_elm){ |
1689 | 1701 | //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 | + } |
1699 | 1710 | }); |
1700 | 1711 | //add transition objects: |
1701 | 1712 | var transition_tags = this.data.getElementsByTagName('transition'); |
— | — | @@ -1720,13 +1731,14 @@ |
1721 | 1732 | } |
1722 | 1733 | } |
1723 | 1734 | }); |
1724 | | - }); |
| 1735 | + }); |
1725 | 1736 | js_log("done proc seq tags"); |
1726 | 1737 | return true; |
1727 | 1738 | }, |
1728 | 1739 | tryAddMedia:function(mediaElement, order, track_id){ |
1729 | 1740 | js_log('SMIL:tryAddMedia:' + mediaElement); |
1730 | 1741 | //set up basic mvSMILClip send it the mediaElemnt & mvClip init: |
| 1742 | + var clipObj = {}; |
1731 | 1743 | var clipObj = new mvSMILClip(mediaElement, |
1732 | 1744 | { |
1733 | 1745 | "id":'p_' + this.id + '_c_' + order, |
— | — | @@ -1774,7 +1786,8 @@ |
1775 | 1787 | instanceOf:'mvSMILClip', |
1776 | 1788 | params : {}, //support param as child of ref clips per SMIL spec |
1777 | 1789 | init:function(sClipElm, mvClipInit){ |
1778 | | - _this = this; |
| 1790 | + _this = this; |
| 1791 | + this.params = {}; |
1779 | 1792 | //make new mvCLip with ClipInit vals |
1780 | 1793 | var myMvClip = new mvClip( mvClipInit ); |
1781 | 1794 | |
— | — | @@ -1828,16 +1841,14 @@ |
1829 | 1842 | //if unset type and we have innerHTML assume text/html type |
1830 | 1843 | if( !this.type && this.wholeText ){ |
1831 | 1844 | this.type = 'text/html'; |
1832 | | - } |
1833 | | - |
| 1845 | + } |
1834 | 1846 | //also grab andy child param elements if present: |
1835 | | - if( sClipElm.getElementsByTagName('param')[0] ){ |
| 1847 | + if( sClipElm.getElementsByTagName('param')[0] ){ |
1836 | 1848 | for(var i=0; i< sClipElm.getElementsByTagName('param').length; i++){ |
1837 | 1849 | this.params[ sClipElm.getElementsByTagName('param')[i].getAttribute("name") ] = |
1838 | 1850 | sClipElm.getElementsByTagName('param')[i].firstChild.nodeValue; |
1839 | 1851 | } |
1840 | | - } |
1841 | | - |
| 1852 | + } |
1842 | 1853 | return this; |
1843 | 1854 | }, |
1844 | 1855 | //returns the values of supported_attributes: |
— | — | @@ -2004,7 +2015,13 @@ |
2005 | 2016 | * (probably have to use a Time object to fully support the smil spec |
2006 | 2017 | */ |
2007 | 2018 | 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 | + } |
2009 | 2026 | } |
2010 | 2027 | //stores a list pointers to active clips (maybe this should just be a property of clips (but results in lots of seeks) |
2011 | 2028 | var activeClipList = function(){ |
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -33,6 +33,8 @@ |
34 | 34 | |
35 | 35 | "edit_clip" : "Edit Clip", |
36 | 36 | "edit_save" : "Save Changes", |
| 37 | + "saving_wait": "Save in Progress (please wait)", |
| 38 | + "save_done" : "Save Done", |
37 | 39 | "edit_cancel" : "Cancel Edit", |
38 | 40 | "edit_cancel_confirm" : "Are you sure you want to cancel your edit. Changes will be lost", |
39 | 41 | |
— | — | @@ -100,7 +102,9 @@ |
101 | 103 | //stores the clipboard edit token (if user has rights to edit their User page) |
102 | 104 | clipboardEditToken:null, |
103 | 105 | //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, |
105 | 109 | |
106 | 110 | |
107 | 111 | |
— | — | @@ -222,11 +226,11 @@ |
223 | 227 | '<div id="'+this.sequence_tools_id+'" style="position:absolute;' + |
224 | 228 | 'left:0px;right:'+(this.video_width+15)+'px;top:0px;height:'+(this.video_height+23)+'px;"/>'+ |
225 | 229 | '<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;">'+ |
227 | 231 | 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;">'+ |
231 | 235 | gM('loading_user_rights') + |
232 | 236 | '</div>' |
233 | 237 | ); |
— | — | @@ -262,24 +266,18 @@ |
263 | 267 | rewrite_by_id( this.plObj_id ); |
264 | 268 | setTimeout(this.instance_name +'.checkReadyPlObj()', 25); |
265 | 269 | }, |
266 | | - updateSeqSaveButtons:function(){ |
| 270 | + updateSeqSaveButtons:function(){ |
267 | 271 | 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> '; |
271 | 272 | 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 | + ); |
279 | 277 | }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') ); |
281 | 279 | } |
282 | 280 | //assing bindings |
283 | | - $j('#mv_cancel_seq_button').unbind().click(function(){ |
| 281 | + $j(this.target_sequence_container +' .seq_edit_cancel').unbind().click(function(){ |
284 | 282 | var x = window.confirm( gM('edit_cancel_confirm') ); |
285 | 283 | if( x ){ |
286 | 284 | _this.closeModEditor(); |
— | — | @@ -287,6 +285,59 @@ |
288 | 286 | //close request canceled. |
289 | 287 | } |
290 | 288 | }); |
| 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 | + }) |
291 | 342 | }, |
292 | 343 | //display a menu item (hide the rest) |
293 | 344 | disp:function( item ){ |
— | — | @@ -453,10 +504,9 @@ |
454 | 505 | return this.plObj.interface_url; |
455 | 506 | }, |
456 | 507 | plReadyInit:function(){ |
457 | | - var this_seq = this; |
458 | | - //debugger; |
| 508 | + var _this = this; |
459 | 509 | js_log('plReadyInit'); |
460 | | - js_log( this.plObj ); |
| 510 | + js_log( this.plObj ); |
461 | 511 | //give the playlist a pointer to its parent seq: |
462 | 512 | this.plObj['seqObj'] = this; |
463 | 513 | |
— | — | @@ -468,33 +518,34 @@ |
469 | 519 | //propagate the edit tokens |
470 | 520 | //if on an edit page just grab from the form: |
471 | 521 | 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){ |
473 | 524 | var reqObj = { |
474 | 525 | 'action':'query', |
475 | 526 | 'prop':'info', |
476 | 527 | 'intoken':'edit', |
477 | | - 'titles': this_seq.plObj.mTitle |
478 | | - }; |
479 | | - |
| 528 | + 'titles': _this.plObj.mTitle |
| 529 | + }; |
480 | 530 | do_api_req( { |
481 | 531 | 'data': reqObj, |
482 | | - 'url' : this_seq.getLocalApiUrl() |
| 532 | + 'url' : _this.getLocalApiUrl() |
483 | 533 | },function(data){ |
| 534 | + var cat = data; |
484 | 535 | for(var i in data.query.pages){ |
485 | 536 | if(data.query.pages[i]['edittoken']) |
486 | | - this_seq.sequenceEditToken = data.query.pages[i]['edittoken']; |
| 537 | + _this.sequenceEditToken = data.query.pages[i]['edittoken']; |
487 | 538 | } |
488 | | - this_seq.updateSeqSaveButtons(); |
| 539 | + _this.updateSeqSaveButtons(); |
489 | 540 | } |
490 | 541 | ); |
491 | | - reqObj['titles']=this_seq.plObj.mTalk; |
| 542 | + reqObj['titles']=_this.plObj.mTalk; |
492 | 543 | do_api_req( { |
493 | 544 | 'data': reqObj, |
494 | | - 'url' : this_seq.getLocalApiUrl() |
| 545 | + 'url' : _this.getLocalApiUrl() |
495 | 546 | }, function( data ){ |
496 | 547 | for(var j in data.query.pages){ |
497 | 548 | if(data.query.pages[j]['edittoken']) |
498 | | - this_seq.clipboardEditToken = data.query.pages[j]['edittoken']; |
| 549 | + _this.clipboardEditToken = data.query.pages[j]['edittoken']; |
499 | 550 | } |
500 | 551 | } |
501 | 552 | ); |
— | — | @@ -557,7 +608,7 @@ |
558 | 609 | $j("#seq_menu").tabs({ |
559 | 610 | selected:selected_tab, |
560 | 611 | 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_', '') ); |
562 | 613 | } |
563 | 614 | //add sorting |
564 | 615 | }).find(".ui-tabs-nav").sortable({ axis : 'x' }); |
— | — | @@ -576,34 +627,34 @@ |
577 | 628 | $j().keydown(function(e){ |
578 | 629 | js_log('pushed down on:' + e.which); |
579 | 630 | if( e.which == 16 ) |
580 | | - this_seq.key_shift_down = true; |
| 631 | + _this.key_shift_down = true; |
581 | 632 | |
582 | 633 | if( e.which == 17) |
583 | 634 | this_seq.key_ctrl_down = true; |
584 | 635 | |
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(); |
587 | 638 | |
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(); |
590 | 641 | |
591 | 642 | //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(); |
594 | 645 | |
595 | 646 | }); |
596 | 647 | $j().keyup(function(e){ |
597 | 648 | js_log('key up on ' + e.which); |
598 | 649 | //user let go of "shift" turn off multi-select |
599 | 650 | if( e.which == 16 ) |
600 | | - this_seq.key_shift_down = false; |
| 651 | + _this.key_shift_down = false; |
601 | 652 | |
602 | 653 | if( e.which == 17) |
603 | | - this_seq.key_ctrl_down = false; |
| 654 | + _this.key_ctrl_down = false; |
604 | 655 | |
605 | 656 | //backspace or delete key while not focused on a text area: |
606 | 657 | if( (e.which == 8 || e.which == 46) && !this_seq.inputFocus) |
607 | | - this_seq.removeSelectedClips(); |
| 658 | + _this.removeSelectedClips(); |
608 | 659 | }); |
609 | 660 | }, |
610 | 661 | //check all nodes for focus |
— | — | @@ -632,13 +683,13 @@ |
633 | 684 | getSeqOutputJSON:function(){ |
634 | 685 | js_log('json output:'); |
635 | 686 | }, |
636 | | - getSeqOutputHLRDXML:function(){ |
| 687 | + getSeqOutputHLRDXML:function(){ |
637 | 688 | var o='<sequence_hlrd>' +"\n"; |
638 | | - o+="\t<head>"; |
| 689 | + o+="\t<head>\n"; |
639 | 690 | //get transitions |
640 | 691 | for(var i in this.plObj.transitions){ |
641 | 692 | var tObj = this.plObj.transitions[i].getAttributeObj(); |
642 | | - o+="\t<transition "; |
| 693 | + o+="\t\t<transition "; |
643 | 694 | for(var j in tObj){ |
644 | 695 | o+=' '+j+'="' + tObj[j] + '"\n\t\t'; |
645 | 696 | } |
— | — | @@ -663,19 +714,22 @@ |
664 | 715 | var cAttr = curClip.getAttributeObj(); |
665 | 716 | for(var j in cAttr){ |
666 | 717 | 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"; |
670 | 726 | } |
671 | | - o+="\n</seq>n"; |
| 727 | + o+="\n</seq>\n"; |
672 | 728 | } |
673 | 729 | o+="\t</body>\n"; |
674 | 730 | //close the tag |
675 | | - o+='</sequence_hlrd>'; |
| 731 | + o+='</sequence_hlrd>'; |
676 | 732 | |
677 | | - alert('f:getSeqOutputHLRDXML'+ o); |
678 | | - |
679 | | - return false; |
| 733 | + return o; |
680 | 734 | }, |
681 | 735 | editClip:function(track_inx, clip_inx){ |
682 | 736 | var cObj = this.plObj.tracks[ track_inx ].clips[ clip_inx ]; |
— | — | @@ -788,7 +842,7 @@ |
789 | 843 | if(remove_clip_ary.length !=0 ) |
790 | 844 | this.removeClips(remove_clip_ary); |
791 | 845 | |
792 | | - //doEdit selected clips (updated selecte resource) |
| 846 | + //doEdit selected clips (updated selected resource) |
793 | 847 | this.doEditSelectedClip(); |
794 | 848 | }, |
795 | 849 | //add a single or set of clips |
— | — | @@ -1381,7 +1435,14 @@ |
1382 | 1436 | this.do_refresh_timeline(); |
1383 | 1437 | js_log('zoom out: '+this.timeline_scale); |
1384 | 1438 | }, |
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 | + } |
1386 | 1447 | //regen duration |
1387 | 1448 | this.plObj.getDuration( true ); |
1388 | 1449 | //refresh player: |
— | — | @@ -1390,6 +1451,12 @@ |
1391 | 1452 | this.render_playheadhead_seeker(); |
1392 | 1453 | this.render_tracks(); |
1393 | 1454 | 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 | + } |
1394 | 1461 | } |
1395 | 1462 | |
1396 | 1463 | } |
— | — | @@ -1411,7 +1478,7 @@ |
1412 | 1479 | this.org_control_height = this.pl_layout.control_height; |
1413 | 1480 | //do specific mods:(controls and title are managed by the sequencer) |
1414 | 1481 | this.pl_layout.title_bar_height=0; |
1415 | | - this.pl_layout.control_height=0; |
| 1482 | + this.pl_layout.control_height=0; |
1416 | 1483 | }, |
1417 | 1484 | setSliderValue:function( perc ){ |
1418 | 1485 | //get the track_clipThumb_height from parent mvSequencer |
Index: branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js |
— | — | @@ -95,18 +95,28 @@ |
96 | 96 | //maybe we should refactor these into their own classes |
97 | 97 | //more refactor each media type should be its own class inheriting the shared baseEditType object |
98 | 98 | edit_types:{ |
99 | | - 'duration':{ |
100 | | - d:1, |
| 99 | + 'duration':{ |
101 | 100 | 'media':['image','template'], |
102 | 101 | 'doEdit':function(target, _this ){ |
| 102 | + //(_this is a smilClip instance) |
103 | 103 | //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 | + |
107 | 118 | } |
108 | 119 | }, |
109 | 120 | 'inoutpoints':{ |
110 | | - 'd':1, |
111 | 121 | 'media':['video'], |
112 | 122 | 'doEdit':function(target, _this ){ |
113 | 123 | //do clock mouse scroll duration editor |
— | — | @@ -121,14 +131,13 @@ |
122 | 132 | $j(target).html( |
123 | 133 | _this.getSetInOutHtml({ |
124 | 134 | 'start_ntp' : start_ntp, |
125 | | - 'end_ntp' : end_ntp |
| 135 | + 'end_ntp' : end_ntp |
126 | 136 | }) |
127 | 137 | ); |
128 | 138 | _this.setInOutBindings(); |
129 | 139 | } |
130 | 140 | }, |
131 | 141 | 'fileopts':{ |
132 | | - 'd':0, |
133 | 142 | 'media':['image','video','template'], |
134 | 143 | 'doEdit':function(target, _this ){ |
135 | 144 | var doEditHtml = function(){ |
— | — | @@ -159,7 +168,7 @@ |
160 | 169 | '<td>' + |
161 | 170 | _this.rObj.tVars[i] + |
162 | 171 | '</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="'; |
164 | 173 | if(_this.rObj.params[ _this.rObj.tVars[i] ]){ |
165 | 174 | o+= _this.rObj.params[ _this.rObj.tVars[i] ]; |
166 | 175 | } |
— | — | @@ -184,6 +193,9 @@ |
185 | 194 | |
186 | 195 | $j(target).html ( o ); |
187 | 196 | //add update bindings |
| 197 | + $j(target + ' .ic_tparam').change(function(){ |
| 198 | + js_log("updated tparam" + $j(this).attr("name")); |
| 199 | + }) |
188 | 200 | |
189 | 201 | //update doFocusBindings |
190 | 202 | if( _this.p_seqObj ) |
— | — | @@ -242,20 +254,16 @@ |
243 | 255 | }else{ |
244 | 256 | doEditHtml(); |
245 | 257 | } |
246 | | - |
247 | | - |
248 | 258 | } |
249 | 259 | }, |
250 | | - 'panzoom':{ |
251 | | - 'd':0, |
| 260 | + 'panzoom':{ |
252 | 261 | 'media':['image','video'], |
253 | 262 | 'doEdit':function(target, _this ){ |
254 | 263 | //do clock mouse scroll duration editor |
255 | 264 | $j(target).html('<h3>Set Position</h3><h3>Set Zoom</h3><h3>Set Crop</h3><h3>Set Aspect</h3>'); |
256 | 265 | } |
257 | 266 | }, |
258 | | - 'overlays':{ |
259 | | - 'd':0, |
| 267 | + 'overlays':{ |
260 | 268 | 'media':['image','video'], |
261 | 269 | 'doEdit':function(target, _this ){ |
262 | 270 | //do clock mouse scroll duration editor |
— | — | @@ -263,7 +271,6 @@ |
264 | 272 | } |
265 | 273 | }, |
266 | 274 | 'audio':{ |
267 | | - 'd':0, |
268 | 275 | 'media':['image','video', 'template'], |
269 | 276 | 'doEdit':function(target, _this ){ |
270 | 277 | //do clock mouse scroll duration editor |
— | — | @@ -279,13 +286,16 @@ |
280 | 287 | var tabc =''; |
281 | 288 | o+= '<div id="mv_submenu_clipedit">'; |
282 | 289 | o+='<ul>'; |
283 | | - var selected_tab = 0; |
| 290 | + var first_tab = false; |
284 | 291 | $j.each(this.edit_types, function(sInx, editType){ |
285 | 292 | //check if the given editType is valid for our given media type |
286 | 293 | var include = false; |
287 | 294 | 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){ |
289 | 296 | include = true; |
| 297 | + if(!first_tab) |
| 298 | + first_tab = sInx; |
| 299 | + } |
290 | 300 | } |
291 | 301 | if(include){ |
292 | 302 | o+= '<li>'+ |
— | — | @@ -300,22 +310,19 @@ |
301 | 311 | $j('#'+this.control_ct).html( o ) ; |
302 | 312 | //set up bindings: |
303 | 313 | $j('#mv_submenu_clipedit').tabs({ |
| 314 | + selected: 0, |
304 | 315 | select: function(event, ui) { |
305 | 316 | _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_smi_', '') ); |
306 | | - } |
307 | | - //add sorting |
| 317 | + } |
308 | 318 | }).addClass('ui-tabs-vertical ui-helper-clearfix'); |
309 | 319 | //close left: |
310 | 320 | $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left'); |
311 | 321 | //update the default edit display: |
312 | | - _this.doDisplayEdit(); |
| 322 | + _this.doDisplayEdit( first_tab ); |
313 | 323 | }, |
314 | 324 | doDisplayEdit:function( edit_type ){ |
315 | 325 | 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; |
320 | 327 | js_log('doDisplayEdit: ' + edit_type ); |
321 | 328 | |
322 | 329 | //do edit interface for that edit type: |
Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -512,14 +512,16 @@ |
513 | 513 | |
514 | 514 | //make sure we have jQuery |
515 | 515 | _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 | + ]; |
524 | 526 | //add png fix if needed: |
525 | 527 | if($j.browser.msie || $j.browser.version < 7) |
526 | 528 | depReq[0].push( '$j.fn.pngFix' ); |
— | — | @@ -764,7 +766,8 @@ |
765 | 767 | [ |
766 | 768 | '$j.ui.dialog', |
767 | 769 | '$j.ui.droppable', |
768 | | - '$j.ui.draggable', |
| 770 | + '$j.ui.draggable', |
| 771 | + '$j.ui.progressbar', |
769 | 772 | '$j.ui.sortable', |
770 | 773 | '$j.ui.resizable', |
771 | 774 | '$j.ui.slider', |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | $j(embed_video).css({ |
203 | 203 | 'width':videoInterface.width, |
204 | 204 | 'height':videoInterface.height |
205 | | - }); |
| 205 | + }).html( mv_get_loading_img() ); |
206 | 206 | //inherit the video interface |
207 | 207 | for(var method in videoInterface){ //for in loop oky in Element context |
208 | 208 | if(method!='readyState'){ //readyState crashes IE |
— | — | @@ -225,9 +225,7 @@ |
226 | 226 | //now swap out the video element for the embed_video obj: |
227 | 227 | $j(video_element).after(embed_video).remove(); |
228 | 228 | //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(); |
232 | 230 | // now that "embed_video" is stable, do more initialization (if we are ready) |
233 | 231 | if($j('#'+embed_video.id).get(0).loading_external_data==false && |
234 | 232 | $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){ |
— | — | @@ -235,7 +233,7 @@ |
236 | 234 | $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
237 | 235 | } |
238 | 236 | js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
239 | | - return true; |
| 237 | + return true; |
240 | 238 | }, |
241 | 239 | //this should not be needed. |
242 | 240 | checkClipsReady : function(){ |