Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -586,17 +586,8 @@ |
587 | 587 | loadSet = { |
588 | 588 | 'mvBaseUploadInterface' : 'libAddMedia/mvBaseUploadInterface.js', |
589 | 589 | 'mvFirefogg' : 'libAddMedia/mvFirefogg.js' |
590 | | - }; |
591 | | - |
592 | | - //see if we need to load the advanced firefog controls and associated ui components: |
593 | | - $j(this.selector).each(function(){ |
594 | | - if( this.tagName.toLowerCase() != 'input' ){ |
595 | | - initObj.form_rewrite = false; |
596 | | - //if not an input tag (we probably want to load the full encoder interface) |
597 | | - if( typeof initObj.encoder_interface == 'undefined' ) |
598 | | - initObj.encoder_interface = true; |
599 | | - } |
600 | | - }); |
| 590 | + }; |
| 591 | + //see if we need to load the advanced firefog controls and associated ui components: |
601 | 592 | if( initObj.encoder_interface ){ |
602 | 593 | //@@todo would be nice to have a "dependency" map we could use/ |
603 | 594 | loadSet['mvAdvFirefogg'] = 'libAddMedia/mvAdvFirefogg.js'; |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg.html |
— | — | @@ -1,39 +0,0 @@ |
2 | | -<!DOCTYPE HTML> |
3 | | -<html><head> |
4 | | -<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
5 | | - <title>Firefogg - Make Ogg Video in your Browser</title> |
6 | | - <!-- <script type="text/javascript" src="../jsScriptLoader.php?class=mv_embed&urid=da&debug=true"></script> --> |
7 | | - <script type="text/javascript" src="../mv_embed.js"></script> |
8 | | -<style type="text/css" media="all">@import "http://www.firefogg.org/css/style.css";</style> |
9 | | -<style type="text/css" media="all"> |
10 | | -.install{ |
11 | | -display:none; |
12 | | -} |
13 | | -input{ |
14 | | -font-size:150%; |
15 | | -} |
16 | | -</style> |
17 | | -<script type="text/javascript"> |
18 | | -mwAddOnloadHook(function(){ |
19 | | - $j('#control_container').firefogg({ |
20 | | - 'encoder_interface' : false, |
21 | | - 'encode_local' : true |
22 | | - }); |
23 | | -}); |
24 | | -</script> |
25 | | -</head><body> |
26 | | -<div id="main"> |
27 | | - <h1><a href="http://www.firefogg.org/index.html"><img |
28 | | -src="http://www.firefogg.org/png/firefogg.png" alt="Firefogg"></a><br> |
29 | | -Make Ogg Video</h1> |
30 | | -<br><br><br> |
31 | | -<center> |
32 | | - <div style="width:500px"> |
33 | | - <div style="float:left;height:400px" id="control_container"></div> |
34 | | - <br><br> |
35 | | - <!-- <span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a> & <a href="http://jqueryui.com/">jquery.ui</a> Supports |
36 | | - <a href="javascript:(function(){if%20(!/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){alert('Sorry,%20due%20to%20security%20restrictions,%20this%20tool%20only%20works%20in%20Firefox');%20return%20false;%20};%20if(window.jquitr){%20jquitr.addThemeRoller();%20}%20else{%20jquitr%20=%20{};%20jquitr.s%20=%20document.createElement('script');%20jquitr.s.src%20=%20'http://jqueryui.com/themeroller/developertool/developertool.js.php';%20document.getElementsByTagName('head')[0].appendChild(jquitr.s);}%20})();">custom themes</a>, <b>remix me</b> |
37 | | - </span> --> |
38 | | - </div> |
39 | | -</center> |
40 | | -</body></html> |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Advanced.html |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<!DOCTYPE HTML> |
| 3 | +<html><head> |
| 4 | +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 | + <title>Firefogg - Make Ogg Video in your Browser</title> |
| 6 | + <!-- <script type="text/javascript" src="../jsScriptLoader.php?class=mv_embed"></script> --> |
| 7 | + <script type="text/javascript" src="../mv_embed.js"></script> |
| 8 | +<style type="text/css" media="all">@import "http://www.firefogg.org/css/style.css";</style> |
| 9 | +<style type="text/css" media="all"> |
| 10 | +.install{ |
| 11 | +display:none; |
| 12 | +} |
| 13 | +input{ |
| 14 | +font-size:150%; |
| 15 | +} |
| 16 | +</style> |
| 17 | +<script type="text/javascript"> |
| 18 | +mwAddOnloadHook(function(){ |
| 19 | + $j('#control_container').firefogg({ |
| 20 | + 'encoder_interface' : true, |
| 21 | + 'encode_local' : true |
| 22 | + }); |
| 23 | +}); |
| 24 | +</script> |
| 25 | +</head><body> |
| 26 | +<div id="main"> |
| 27 | + <h1><a href="http://www.firefogg.org/index.html"><img |
| 28 | +src="http://www.firefogg.org/png/firefogg.png" alt="Firefogg"></a><br> |
| 29 | +Make Ogg Video</h1> |
| 30 | +<br><br><br> |
| 31 | +<center> |
| 32 | + <div style="width:500px"> |
| 33 | + <div style="float:left;height:400px" id="control_container"></div> |
| 34 | + <br><br> |
| 35 | + <!-- <span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a> & <a href="http://jqueryui.com/">jquery.ui</a> Supports |
| 36 | + <a href="javascript:(function(){if%20(!/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){alert('Sorry,%20due%20to%20security%20restrictions,%20this%20tool%20only%20works%20in%20Firefox');%20return%20false;%20};%20if(window.jquitr){%20jquitr.addThemeRoller();%20}%20else{%20jquitr%20=%20{};%20jquitr.s%20=%20document.createElement('script');%20jquitr.s.src%20=%20'http://jqueryui.com/themeroller/developertool/developertool.js.php';%20document.getElementsByTagName('head')[0].appendChild(jquitr.s);}%20})();">custom themes</a>, <b>remix me</b> |
| 37 | + </span> --> |
| 38 | + </div> |
| 39 | +</center> |
| 40 | +</body></html> |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Simple.html |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<!DOCTYPE HTML> |
| 3 | +<html><head> |
| 4 | +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 | + <title>Firefogg - Make Ogg Video in your Browser</title> |
| 6 | + <!-- <script type="text/javascript" src="../jsScriptLoader.php?class=mv_embed&urid=da&debug=true"></script> --> |
| 7 | + <script type="text/javascript" src="../mv_embed.js"></script> |
| 8 | +<style type="text/css" media="all">@import "http://www.firefogg.org/css/style.css";</style> |
| 9 | +<style type="text/css" media="all"> |
| 10 | +.install{ |
| 11 | +display:none; |
| 12 | +} |
| 13 | +input{ |
| 14 | +font-size:150%; |
| 15 | +} |
| 16 | +</style> |
| 17 | +<script type="text/javascript"> |
| 18 | +mwAddOnloadHook(function(){ |
| 19 | + $j('#control_container').firefogg({ |
| 20 | + 'encoder_interface' : false, |
| 21 | + 'encode_local' : true |
| 22 | + }); |
| 23 | +}); |
| 24 | +</script> |
| 25 | +</head><body> |
| 26 | +<div id="main"> |
| 27 | + <h1><a href="http://www.firefogg.org/index.html"><img |
| 28 | +src="http://www.firefogg.org/png/firefogg.png" alt="Firefogg"></a><br> |
| 29 | +Make Ogg Video</h1> |
| 30 | +<br><br><br> |
| 31 | +<center> |
| 32 | + <div style="width:500px"> |
| 33 | + <div style="float:left;height:400px" id="control_container"></div> |
| 34 | + <br><br> |
| 35 | + <!-- <span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a> & <a href="http://jqueryui.com/">jquery.ui</a> Supports |
| 36 | + <a href="javascript:(function(){if%20(!/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){alert('Sorry,%20due%20to%20security%20restrictions,%20this%20tool%20only%20works%20in%20Firefox');%20return%20false;%20};%20if(window.jquitr){%20jquitr.addThemeRoller();%20}%20else{%20jquitr%20=%20{};%20jquitr.s%20=%20document.createElement('script');%20jquitr.s.src%20=%20'http://jqueryui.com/themeroller/developertool/developertool.js.php';%20document.getElementsByTagName('head')[0].appendChild(jquitr.s);}%20})();">custom themes</a>, <b>remix me</b> |
| 37 | + </span> --> |
| 38 | + </div> |
| 39 | +</center> |
| 40 | +</body></html> |
Property changes on: branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Simple.html |
___________________________________________________________________ |
Added: svn:mergeinfo |
1 | 41 | Merged /trunk/phase3/js2/mv_embed/example_usage/Make_Ogg.html:r46619-47809 |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -95,7 +95,13 @@ |
96 | 96 | js_log('Error: firefogg: missing selector '); |
97 | 97 | } |
98 | 98 | }, |
99 | | - doRewrite:function( callback ){ |
| 99 | + doRewrite:function( callback ){ |
| 100 | + var _this = this; |
| 101 | + $j(this.selector).each(function(){ |
| 102 | + if( this.tagName.toLowerCase() == 'input' ){ |
| 103 | + _this.form_rewrite = true; |
| 104 | + } |
| 105 | + }); |
100 | 106 | //check if we are rewriting an input or a form: |
101 | 107 | if( this.form_rewrite ){ |
102 | 108 | this.setupForm(); |
— | — | @@ -115,13 +121,7 @@ |
116 | 122 | if(target.substring(0, 6)=='target'){ |
117 | 123 | //check for the target if missing add to the output: |
118 | 124 | if( _this[target] === false){ |
119 | | - if( target.substr(7,3)=='btn'){ |
120 | | - out+='<input class="' + target + '" type="button" value="' + gM( 'fogg-' + target.substring(11)) + '"/> '; |
121 | | - }else if(target.substr(7,5)=='input'){ |
122 | | - out+='<input class="' + target + '" type="text" value="' + gM( 'fogg-' + target.substring(11)) + '"/> '; |
123 | | - }else{ |
124 | | - out+='<div class="' + target + '">'+ gM('fogg-'+ target.substring(7)) + '</div> '; |
125 | | - } |
| 125 | + out+= _this.getTargetHtml(target); |
126 | 126 | } |
127 | 127 | //update the target selector |
128 | 128 | _this[target] = _this.selector + ' .' + target; |
— | — | @@ -130,6 +130,15 @@ |
131 | 131 | //output the html |
132 | 132 | $j( this.selector ).html( out ).show(); |
133 | 133 | }, |
| 134 | + getTargetHtml:function(target){ |
| 135 | + if( target.substr(7,3)=='btn'){ |
| 136 | + return '<input class="' + target + '" type="button" value="' + gM( 'fogg-' + target.substring(11)) + '"/> '; |
| 137 | + }else if(target.substr(7,5)=='input'){ |
| 138 | + return '<input class="' + target + '" type="text" value="' + gM( 'fogg-' + target.substring(11)) + '"/> '; |
| 139 | + }else{ |
| 140 | + return '<div class="' + target + '">'+ gM('fogg-'+ target.substring(7)) + '</div> '; |
| 141 | + } |
| 142 | + }, |
134 | 143 | doControlBindings: function(){ |
135 | 144 | var _this = this; |
136 | 145 | |
— | — | @@ -183,14 +192,34 @@ |
184 | 193 | } |
185 | 194 | }, |
186 | 195 | //assume input target |
187 | | - setupForm: function(){ |
| 196 | + setupForm: function(){ |
| 197 | + js_log('firefogg::setupForm::'); |
| 198 | + |
| 199 | + //call the parent form setup |
| 200 | + this.pe_setupForm(); |
| 201 | + <input type="file" size="60" id="wpUploadFile" name="wpUploadFile" tabindex="1"/> |
| 202 | + //change the file browser to type text: |
| 203 | + $j(this.selector).replaceWith('<input type="text" ' + |
| 204 | + 'size="' + $j(this.selector).attr('size') + '" ' + |
| 205 | + 'id="' + $j(this.selector).attr('id') + '" ' + |
| 206 | + 'name="' + $j(this.selector).attr("name") + '" ' + |
| 207 | + 'tabindex="' + $j(this.selector).attr('tabindex') + '" '+ |
| 208 | + 'class="' + $j(this.selector).attr('class') + '" ' + |
| 209 | + '>'); |
188 | 210 | |
189 | | - js_log('firefogg::setupForm::'); |
190 | | - //call the parent form setup |
191 | | - _this.pe_setupForm(); |
| 211 | + this.target_input_file_name = this.selector; |
192 | 212 | |
193 | | - //firefogg is always "enabled" with passthrough mode (if not uploading video) |
| 213 | + $j(this.selector).after( |
| 214 | + this.getTargetHtml('target_btn_select_file') |
| 215 | + ); |
| 216 | + //check for the other inline status indicator targets: |
| 217 | + |
| 218 | + //update the bindings: |
| 219 | + this.doControlBindings(); |
194 | 220 | }, |
| 221 | + getEditForm:function(){ |
| 222 | + return $j(this.selector).parents().find("form").get(0); |
| 223 | + }, |
195 | 224 | select_fogg:function(){ |
196 | 225 | var _this = this; |
197 | 226 | if( _this.fogg.selectVideo() ) { |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -139,8 +139,7 @@ |
140 | 140 | _this.doUploadSwitch(); |
141 | 141 | } |
142 | 142 | }, |
143 | | - doUploadSwitch:function(){ |
144 | | - |
| 143 | + doUploadSwitch:function(){ |
145 | 144 | js_log('mvUPload:doUploadSwitch()'); |
146 | 145 | var _this = this; |
147 | 146 | //issue a normal post request |
Index: branches/new-upload/phase3/js2/uploadPage.js |
— | — | @@ -15,12 +15,18 @@ |
16 | 16 | 'api_url' : wgServer + wgScriptPath + '/api.php', |
17 | 17 | |
18 | 18 | 'new_source_cb' : function( filename ){ |
19 | | - $j('#wpDestFile').val( filename ) |
| 19 | + $j('#wpDestFile').val( filename ); |
20 | 20 | mwUploadHelper.doDestCheck(); |
21 | | - } |
| 21 | + } |
22 | 22 | }); |
23 | 23 | }else{ |
24 | 24 | //we can try and do basic upload profile support ( http status monitoring, progress box for browsers that support it etc. ) |
| 25 | + mvJsLoader.doLoad({ |
| 26 | + 'mvBaseUploadInterface': 'libAddMedia/mvBaseUploadInterface.js' |
| 27 | + },function(){ |
| 28 | + myUp = new mvBaseUploadInterface( { 'api_url' : wgServer + wgScriptPath + '/api.php' } ); |
| 29 | + myUp.setupForm(); |
| 30 | + }); |
25 | 31 | } |
26 | 32 | |
27 | 33 | if( wgAjaxUploadDestCheck ){ |
— | — | @@ -47,7 +53,7 @@ |
48 | 54 | toggleUpType( this.id == 'wpUploadFile' ); |
49 | 55 | }).change(function(){ //also setup the onChange event binding: |
50 | 56 | if ( wgUploadAutoFill ) { |
51 | | - mvUp.doDestinationFill( this ); |
| 57 | + mwUploadHelper.doDestinationFill( this ); |
52 | 58 | } |
53 | 59 | }); |
54 | 60 | }, |