Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Sequence_Editor.html |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | "http://www.w3.org/TR/html4/loose.dtd"> |
4 | 4 | <html> |
5 | 5 | <head> |
6 | | - <title>Simple SMIL example</title> |
| 6 | + <title>SMIL Sequence Editor example</title> |
7 | 7 | <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
8 | 8 | <script type="text/javascript"> |
9 | 9 | mwAddOnloadHook(function(){ |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
5 | 5 | <title>Firefogg - Make Ogg Video in your Browser</title> |
6 | 6 | <!-- <script type="text/javascript" src="../jsScriptLoader.php?class=mv_embed"></script> --> |
7 | | - <script type="text/javascript" src="../jsScriptLoader.php?class=mv_embed"></script> |
| 7 | + <script type="text/javascript" src="../mv_embed.js"></script> |
8 | 8 | <style type="text/css" media="all">@import "http://www.firefogg.org/css/style.css";</style> |
9 | 9 | <style type="text/css" media="all"> |
10 | 10 | .install{ |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -34,7 +34,11 @@ |
35 | 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>" |
36 | 36 | }); |
37 | 37 | var default_remote_search_options = { |
38 | | - 'profile':'mediawiki_edit', 'target_container':null, //the div that will hold the search interface |
| 38 | + 'profile':'mediawiki_edit', |
| 39 | + 'target_container':null, //the div that will hold the search interface |
| 40 | + //if using a modeal dialog (instead of target_container) how close to the edge of the window should we go: |
| 41 | + 'modal_edge_padding':'20px', |
| 42 | + |
39 | 43 | 'target_invocation': null, //the button or link that will invoke the search interface |
40 | 44 | |
41 | 45 | 'default_provider_id':'all', //all or one of the content_providers ids |
— | — | @@ -56,7 +60,8 @@ |
57 | 61 | 'cFileNS':'File', //what is the cannonical namespace for images |
58 | 62 | //@@todo (should get that from the api or inpage vars) |
59 | 63 | |
60 | | - 'enable_upload_tab':true, // if we want to enable an uploads tab: |
| 64 | + 'enable_upload_tab':true, // if we want to enable an uploads tab: |
| 65 | + |
61 | 66 | } |
62 | 67 | if(typeof wgServer == 'undefined') |
63 | 68 | wgServer = ''; |
— | — | @@ -296,6 +301,7 @@ |
297 | 302 | |
298 | 303 | cUpLoader : null, |
299 | 304 | cEdit : null, |
| 305 | + dmodalCss : null, |
300 | 306 | |
301 | 307 | init: function( iObj ){ |
302 | 308 | var _this = this; |
— | — | @@ -320,7 +326,17 @@ |
321 | 327 | } |
322 | 328 | } |
323 | 329 | } |
324 | | - |
| 330 | + //set up the default model config: |
| 331 | + this.dmodalCss = { |
| 332 | + 'width':'auto', |
| 333 | + 'height':'auto', |
| 334 | + 'top' : this.modal_edge_padding, |
| 335 | + 'left' : this.modal_edge_padding, |
| 336 | + 'right' : this.modal_edge_padding, |
| 337 | + 'bottom': this.modal_edge_padding |
| 338 | + } |
| 339 | + |
| 340 | + |
325 | 341 | //set up the target invocation: |
326 | 342 | if( $j(this.target_invocation).length==0 ){ |
327 | 343 | js_error("RemoteSearchDriver:: no target invocation provided") |
— | — | @@ -345,7 +361,7 @@ |
346 | 362 | if(_this.target_textbox) |
347 | 363 | _this.getTexboxSelection(); |
348 | 364 | |
349 | | - $j(_this.target_container).dialog('open'); |
| 365 | + $j(_this.target_container).dialog('open').parent('.ui-dialog').css( _this.dmodalCss ); |
350 | 366 | }); |
351 | 367 | }, |
352 | 368 | //gets the in and out points for insert position or grabs the selected text for search |
— | — | @@ -402,9 +418,7 @@ |
403 | 419 | layout = _this.getMaxModalLayout(); |
404 | 420 | $j(_this.target_container).dialog({ |
405 | 421 | bgiframe: true, |
406 | | - autoOpen: true, |
407 | | - width: 800, |
408 | | - height: 600, |
| 422 | + autoOpen: true, |
409 | 423 | modal: true, |
410 | 424 | buttons: { |
411 | 425 | 'Cancel': function() { |
— | — | @@ -414,9 +428,27 @@ |
415 | 429 | close: function() { |
416 | 430 | js_log('closed modal'); |
417 | 431 | } |
| 432 | + }).parent('.ui-dialog').css( _this.dmodalCss ) |
| 433 | + //@@bind on resize to disable css dialog to update dmodelCss |
| 434 | + .bind('resizestart', function(event, ui) { |
| 435 | + _this.dmodalCss = {}; |
| 436 | + $j(this).css({}); |
| 437 | + }) |
| 438 | + //bind on drag to remove preset style as well |
| 439 | + .bind('dragstart', function(event, ui) { |
| 440 | + _this.dmodalCss = {}; |
| 441 | + $j(this).css({}); |
| 442 | + }) |
| 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', |
| 446 | + 'left':'0px', |
| 447 | + 'right':'0px', |
| 448 | + 'bottom':'0px' |
418 | 449 | }); |
419 | | - //for some reaons the width does not "stick on init: |
420 | | - //$j(_this.target_container).dialog('option', 'width', 800); |
| 450 | + |
| 451 | + |
| 452 | + |
421 | 453 | /*var resizeTimer = false; |
422 | 454 | $j(window).bind('resize', function() { |
423 | 455 | var adjustModal = function(){ |
— | — | @@ -502,9 +534,10 @@ |
503 | 535 | doUploadInteface:function(){ |
504 | 536 | var _this = this; |
505 | 537 | mv_set_loading('#tab-upload'); |
| 538 | + $j('#tab-upload').html('upload interface goes here ;)'); |
506 | 539 | |
507 | 540 | //todo include firefogg support: |
508 | | - mvJsLoader.doLoad( [ |
| 541 | + /*mvJsLoader.doLoad( [ |
509 | 542 | 'mvUploader' |
510 | 543 | ],function(){ |
511 | 544 | _this.cUpLoader = new mvUploader({ |
— | — | @@ -519,13 +552,16 @@ |
520 | 553 | }); |
521 | 554 | } |
522 | 555 | }); |
523 | | - }); |
| 556 | + }); */ |
524 | 557 | }, |
525 | 558 | runSearch: function(){ |
526 | 559 | js_log("f:runSearch::" + this.disp_item); |
527 | 560 | //draw_direct_flag |
528 | 561 | var draw_direct_flag = true; |
529 | | - |
| 562 | + if(!this.content_providers[this.disp_item]) { |
| 563 | + js_log("can't run search for:" + this.disp_item); |
| 564 | + return false; |
| 565 | + } |
530 | 566 | cp = this.content_providers[this.disp_item]; |
531 | 567 | |
532 | 568 | //check if we need to update: |
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | $j(this).dialog('close'); |
130 | 130 | } |
131 | 131 | }, |
132 | | - }).css({ |
| 132 | + }).parent('.ui-dialog').css({ |
133 | 133 | 'width':'auto', |
134 | 134 | 'height':'auto', |
135 | 135 | 'top' : '10px', |
Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -116,7 +116,8 @@ |
117 | 117 | //setup normal replacement of j with jquery |
118 | 118 | var jsName = ( gClasses[i].substr(0,3) == '$j.' ) ? opt['j_replace'] + gClasses[i].substr(3) : gClasses[i]; |
119 | 119 | mvClassPaths[ gClasses[i] ] = path + jsName + '.js'; |
120 | | - }else{ |
| 120 | + }else{ |
| 121 | + //assume object with key:path: |
121 | 122 | mvClassPaths[i] = path + gClasses[ i ]; |
122 | 123 | } |
123 | 124 | } |
— | — | @@ -135,7 +136,7 @@ |
136 | 137 | lcPaths('',{ |
137 | 138 | 'mv_embed' : 'mv_embed.js', |
138 | 139 | 'window.jQuery' : 'jquery/jquery-1.3.2.js', |
139 | | - '$j.fn.pngFix' : 'jquery.pngFix.js', |
| 140 | + '$j.fn.pngFix' : 'jquery/plugins/jquery.pngFix.js', |
140 | 141 | '$j.fn.autocomplete': 'jquery/plugins/jquery.autocomplete.js', |
141 | 142 | '$j.fn.hoverIntent' : 'jquery/plugins/jquery.hoverIntent.js', |
142 | 143 | '$j.fn.datePicker' : 'jquery/plugins/jquery.datePicker.js', |
— | — | @@ -176,7 +177,7 @@ |
177 | 178 | '$j.ui.selectable', |
178 | 179 | ], |
179 | 180 | {'j_replace':''}); |
180 | | - |
| 181 | +//add mediaLibs |
181 | 182 | lcPaths('libAddMedia/', [ |
182 | 183 | 'mvFirefogg', |
183 | 184 | 'mvAdvFirefogg', |
— | — | @@ -196,7 +197,7 @@ |
197 | 198 | lcPaths( 'libClipEdit/', [ |
198 | 199 | 'mvClipEdit' |
199 | 200 | ]) |
200 | | -//libEmbedObj: |
| 201 | +//libEmbedObj (we could load all these clasess in embedVideo): |
201 | 202 | lcPaths( 'libEmbedVideo/', [ |
202 | 203 | 'embedVideo', |
203 | 204 | 'flashEmbed', |
— | — | @@ -427,6 +428,27 @@ |
428 | 429 | } |
429 | 430 | } |
430 | 431 | this.ptime=this.ctime; |
| 432 | + }, |
| 433 | + doLoadDepMode:function(loadChain, callback){ |
| 434 | + //firefox executes js ~in-order of it being included~ so just directly issue request: |
| 435 | + if( $j.browser.firefox ){ |
| 436 | + var loadSet = []; |
| 437 | + for(var i=0; i< loadChain.length;i++){ |
| 438 | + for(var j=0;j<loadChain[i].length;j++){ |
| 439 | + loadSet.push(loadChain[i][j]); |
| 440 | + } |
| 441 | + } |
| 442 | + doLoad(loadSet, callback); |
| 443 | + }else{ |
| 444 | + //safair and IE tend to execute out of order so load with dependenciy checks |
| 445 | + mvJsLoader.doLoad(loadChain.shift(),function(){ |
| 446 | + if(loadChain.length!=0){ |
| 447 | + mvJsLoader.doLoadDepMode(loadChain, callback); |
| 448 | + }else{ |
| 449 | + callback(); |
| 450 | + } |
| 451 | + }); |
| 452 | + } |
431 | 453 | }, |
432 | 454 | checkLoading:function(){ |
433 | 455 | var loading=0; |
— | — | @@ -490,29 +512,22 @@ |
491 | 513 | |
492 | 514 | //make sure we have jQuery |
493 | 515 | _this.jQueryCheck(function(){ |
494 | | - baseReq = [ |
| 516 | + var depReq = new Array(); |
| 517 | + depReq.push( [ |
495 | 518 | '$j.ui', |
496 | 519 | 'embedVideo', |
497 | 520 | '$j.cookie' |
498 | | - ]; |
499 | | - var secReq = new Array(); |
500 | | - //IE & safari appear to load things out of order running j.slider before j.ui is ready |
501 | | - //load ui depenent scripts in a second request: |
502 | | - if($j.browser.msie || $j.browser.safari){ |
503 | | - secReq.push( '$j.ui.slider' ); |
504 | | - //ie6 yay! |
505 | | - if($j.browser.version <= 6){ |
506 | | - secReq.push( '$j.fn.pngFix' ); |
507 | | - } |
508 | | - }else{ |
509 | | - baseReq.push('$j.ui.slider'); |
510 | | - } |
511 | | - _this.doLoad(baseReq,function(){ |
512 | | - _this.doLoad(secReq,function(){ |
513 | | - embedTypes.init(); |
514 | | - callback(); |
515 | | - }); |
516 | | - }); |
| 521 | + ], [ |
| 522 | + '$j.ui.slider' |
| 523 | + ]); |
| 524 | + //add png fix if needed: |
| 525 | + if($j.browser.msie || $j.browser.version < 7) |
| 526 | + depReq[0].push( '$j.fn.pngFix' ); |
| 527 | + |
| 528 | + _this.doLoadDepMode(depReq,function(){ |
| 529 | + embedTypes.init(); |
| 530 | + callback(); |
| 531 | + }); |
517 | 532 | }); |
518 | 533 | }, |
519 | 534 | addLoadEvent:function(fn){ |
— | — | @@ -710,22 +725,24 @@ |
711 | 726 | loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css' ); |
712 | 727 | //load all the req libs: |
713 | 728 | mvJsLoader.jQueryCheck(function(){ |
714 | | - //load search specifc extra stuff |
715 | | - mvJsLoader.doLoad([ |
716 | | - 'remoteSearchDriver', |
717 | | - '$j.cookie', |
718 | | - '$j.ui', |
719 | | - '$j.ui.resizable', |
720 | | - '$j.ui.draggable', |
721 | | - '$j.ui.dialog', |
722 | | - '$j.ui.tabs', |
723 | | - '$j.ui.sortable' |
| 729 | + //load with staged dependeinces (for ie and safari that don't execute in order) |
| 730 | + mvJsLoader.doLoadDepMode([ |
| 731 | + ['remoteSearchDriver', |
| 732 | + '$j.cookie', |
| 733 | + '$j.ui' |
| 734 | + ],[ |
| 735 | + '$j.ui.resizable', |
| 736 | + '$j.ui.draggable', |
| 737 | + '$j.ui.dialog', |
| 738 | + '$j.ui.tabs', |
| 739 | + '$j.ui.sortable' |
| 740 | + ] |
724 | 741 | ], function(){ |
725 | 742 | iObj['instance_name']= 'rsdMVRS'; |
726 | 743 | _global['rsdMVRS'] = new remoteSearchDriver( iObj ); |
727 | 744 | if( callback ) |
728 | 745 | callback(); |
729 | | - }); |
| 746 | + }); |
730 | 747 | }); |
731 | 748 | } |
732 | 749 | $.fn.sequencer = function( iObj, callback){ |
— | — | @@ -735,15 +752,16 @@ |
736 | 753 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css'); |
737 | 754 | loadExternalCss( mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css'); |
738 | 755 | //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page) |
739 | | - mvJsLoader.embedVideoCheck(function(){ |
740 | | - var firstLoadSet =[ |
| 756 | + mvJsLoader.embedVideoCheck(function(){ |
| 757 | + //load playlist object and then jquery ui stuff: |
| 758 | + mvJsLoader.doLoadDepMode([ |
| 759 | + [ |
741 | 760 | 'mvPlayList', |
742 | 761 | '$j.ui', |
743 | 762 | '$j.contextMenu', |
744 | 763 | 'mvSequencer' |
745 | | - ]; |
746 | | - var secondLoadSet =[]; |
747 | | - var uiDepLibs = [ |
| 764 | + ], |
| 765 | + [ |
748 | 766 | '$j.ui.dialog', |
749 | 767 | '$j.ui.droppable', |
750 | 768 | '$j.ui.draggable', |
— | — | @@ -751,25 +769,15 @@ |
752 | 770 | '$j.ui.resizable', |
753 | 771 | '$j.ui.slider', |
754 | 772 | '$j.ui.tabs' |
755 | | - ]; |
756 | | - if($j.browser.msie || $j.browser.safari){ |
757 | | - for(var i=0;i<uiDepLibs.length;i++) |
758 | | - secondLoadSet.push( uiDepLibs[i]); |
759 | | - }else{ |
760 | | - for(var i=0;i<uiDepLibs.length;i++) |
761 | | - firstLoadSet.push( uiDepLibs[i]); |
762 | | - } |
763 | | - //load playlist object and drag,drop,resize,hoverintent,libs |
764 | | - mvJsLoader.doLoad(firstLoadSet,function(){ |
765 | | - mvJsLoader.doLoad(secondLoadSet,function(){ |
766 | | - js_log('calling new mvSequencer'); |
767 | | - //init the sequence object (it will take over from there) no more than one mvSeq obj for now: |
768 | | - if(!_global['mvSeq']){ |
769 | | - _global['mvSeq'] = new mvSequencer(iObj); |
770 | | - }else{ |
771 | | - js_log('mvSeq already init'); |
772 | | - } |
773 | | - }); |
| 773 | + ] |
| 774 | + ], function(){ |
| 775 | + js_log('calling new mvSequencer'); |
| 776 | + //init the sequence object (it will take over from there) no more than one mvSeq obj for now: |
| 777 | + if(!_global['mvSeq']){ |
| 778 | + _global['mvSeq'] = new mvSequencer(iObj); |
| 779 | + }else{ |
| 780 | + js_log('mvSeq already init'); |
| 781 | + } |
774 | 782 | }); |
775 | 783 | }); |
776 | 784 | } |
— | — | @@ -781,39 +789,28 @@ |
782 | 790 | loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css' ); |
783 | 791 | // @@todo should refactor mvAdvFirefogg as jQuery plugin |
784 | 792 | iObj['selector'] = this.selector; |
785 | | - loadSet = [ |
786 | | - 'mvBaseUploadInterface', |
787 | | - 'mvFirefogg', |
788 | | - '$j.ui' |
789 | | - ]; |
790 | | - var eiLoadSet = [ |
791 | | - 'mvAdvFirefogg', |
792 | | - '$j.cookie', |
793 | | - '$j.ui.accordion', |
794 | | - '$j.ui.slider', |
795 | | - '$j.ui.datepicker' |
796 | | - ] |
797 | | - var secondLoadSet = []; |
798 | | - //IE* ~sometimes~ executes things out of order on DOM inserted scripts |
799 | | - //*(kind of pointless anyway since IE does not support firefogg |
800 | | - // but if you want firefog to drive the "is not supported" msg here you go ;) |
801 | | - if($.browser.msie || $j.browser.safari){ |
802 | | - secondLoadSet = [ |
| 793 | + var loadSet = [ |
| 794 | + [ |
| 795 | + 'mvBaseUploadInterface', |
| 796 | + 'mvFirefogg', |
| 797 | + '$j.ui' |
| 798 | + ], |
| 799 | + [ |
803 | 800 | '$j.ui.progressbar', |
804 | | - '$j.ui.dialog' |
| 801 | + '$j.ui.dialog' |
805 | 802 | ] |
806 | | - for(var i=0;i < eiLoadSet.length; i++) |
807 | | - secondLoadSet[i] = eiLoadSet[i]; |
808 | | - }else{ |
809 | | - loadSet.push( '$j.ui.progressbar' ); |
810 | | - loadSet.push( '$j.ui.dialog' ); |
811 | | - for(var i=0;i < eiLoadSet.length; i++) |
812 | | - loadSet.push( eiLoadSet[i] ); |
813 | | - } |
| 803 | + ]; |
| 804 | + if( iObj.encoder_interface ){ |
| 805 | + loadSet.push([ |
| 806 | + 'mvAdvFirefogg', |
| 807 | + '$j.cookie', |
| 808 | + '$j.ui.accordion', |
| 809 | + '$j.ui.slider', |
| 810 | + '$j.ui.datepicker' |
| 811 | + ]); |
| 812 | + } |
814 | 813 | //make sure we have everything loaded that we need: |
815 | | - mvJsLoader.doLoad( loadSet, function(){ |
816 | | - mvJsLoader.doLoad( secondLoadSet, function(){ |
817 | | - if(secondLoadSet) |
| 814 | + mvJsLoader.doLoadDepMode( loadSet, function(){ |
818 | 815 | js_log('firefogg libs loaded. target select:' + iObj.selector); |
819 | 816 | //select interface provicer based on if we want to include the encoder interface or not: |
820 | 817 | if(iObj.encoder_interface){ |
— | — | @@ -823,7 +820,6 @@ |
824 | 821 | } |
825 | 822 | if(myFogg) |
826 | 823 | myFogg.doRewrite( callback ); |
827 | | - }); |
828 | 824 | }); |
829 | 825 | } |
830 | 826 | |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/vlcEmbed.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | 'stop':true, |
12 | 12 | 'fullscreen':true, |
13 | 13 | 'time_display':true, |
14 | | - 'volume_control':false, |
| 14 | + 'volume_control':true, |
15 | 15 | |
16 | 16 | 'playlist_driver':true, //if the object supports playlist functions |
17 | 17 | 'overlay':false |
— | — | @@ -241,6 +241,12 @@ |
242 | 242 | this.vlc.playlist.togglePause(); |
243 | 243 | } |
244 | 244 | }, |
| 245 | + toggleMute:function(){ |
| 246 | + this.parent_toggleMute(); |
| 247 | + this.getVLC(); |
| 248 | + if(this.vlc) |
| 249 | + this.vlc.audio.toggleMute(); |
| 250 | + }, |
245 | 251 | fullscreen : function(){ |
246 | 252 | if(this.vlc){ |
247 | 253 | if(this.vlc.video) |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -164,12 +164,25 @@ |
165 | 165 | '$j.ui.dialog' |
166 | 166 | ], function(){ |
167 | 167 | $j('playlist').each(function(){ |
168 | | - //create new playlist interface: |
169 | | - var plObj = new mvPlayList( this ); |
170 | | - mvEmbed.swapEmbedVideoElement(this, plObj); |
171 | | - var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height; |
172 | | - //move into a blocking display container with height + controls + title height: |
173 | | - $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
| 168 | + //check if we are in sequence mode load sequence libs (if not already loaded) |
| 169 | + if( $j(this).attr('sequencer')=="true" ){ |
| 170 | + var pl_element = this; |
| 171 | + //load the mv_sequencer and the json util lib: |
| 172 | + mvJsLoader.doLoad([ |
| 173 | + 'mvSeqPlayList' |
| 174 | + ],function(){ |
| 175 | + var seqObj = new mvSeqPlayList( pl_element ); |
| 176 | + mvEmbed.swapEmbedVideoElement( pl_element, seqObj ); |
| 177 | + } |
| 178 | + ); |
| 179 | + }else{ |
| 180 | + //create new playlist interface: |
| 181 | + var plObj = new mvPlayList( this ); |
| 182 | + mvEmbed.swapEmbedVideoElement(this, plObj); |
| 183 | + var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height; |
| 184 | + //move into a blocking display container with height + controls + title height: |
| 185 | + $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
| 186 | + } |
174 | 187 | }); |
175 | 188 | }); |
176 | 189 | } |