r50803 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50802‎ | r50803 | r50804 >
Date:23:52, 19 May 2009
Author:dale
Status:deferred
Tags:
Comment:
update fixes
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg.html (deleted) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Advanced.html (added) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Simple.html (added) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /branches/new-upload/phase3/js2/uploadPage.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js
@@ -586,17 +586,8 @@
587587 loadSet = {
588588 'mvBaseUploadInterface' : 'libAddMedia/mvBaseUploadInterface.js',
589589 '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:
601592 if( initObj.encoder_interface ){
602593 //@@todo would be nice to have a "dependency" map we could use/
603594 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
141 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 @@
9696 js_log('Error: firefogg: missing selector ');
9797 }
9898 },
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+ });
100106 //check if we are rewriting an input or a form:
101107 if( this.form_rewrite ){
102108 this.setupForm();
@@ -115,13 +121,7 @@
116122 if(target.substring(0, 6)=='target'){
117123 //check for the target if missing add to the output:
118124 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);
126126 }
127127 //update the target selector
128128 _this[target] = _this.selector + ' .' + target;
@@ -130,6 +130,15 @@
131131 //output the html
132132 $j( this.selector ).html( out ).show();
133133 },
 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+ },
134143 doControlBindings: function(){
135144 var _this = this;
136145
@@ -183,14 +192,34 @@
184193 }
185194 },
186195 //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+ '>');
188210
189 - js_log('firefogg::setupForm::');
190 - //call the parent form setup
191 - _this.pe_setupForm();
 211+ this.target_input_file_name = this.selector;
192212
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();
194220 },
 221+ getEditForm:function(){
 222+ return $j(this.selector).parents().find("form").get(0);
 223+ },
195224 select_fogg:function(){
196225 var _this = this;
197226 if( _this.fogg.selectVideo() ) {
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
@@ -139,8 +139,7 @@
140140 _this.doUploadSwitch();
141141 }
142142 },
143 - doUploadSwitch:function(){
144 -
 143+ doUploadSwitch:function(){
145144 js_log('mvUPload:doUploadSwitch()');
146145 var _this = this;
147146 //issue a normal post request
Index: branches/new-upload/phase3/js2/uploadPage.js
@@ -15,12 +15,18 @@
1616 'api_url' : wgServer + wgScriptPath + '/api.php',
1717
1818 'new_source_cb' : function( filename ){
19 - $j('#wpDestFile').val( filename )
 19+ $j('#wpDestFile').val( filename );
2020 mwUploadHelper.doDestCheck();
21 - }
 21+ }
2222 });
2323 }else{
2424 //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+ });
2531 }
2632
2733 if( wgAjaxUploadDestCheck ){
@@ -47,7 +53,7 @@
4854 toggleUpType( this.id == 'wpUploadFile' );
4955 }).change(function(){ //also setup the onChange event binding:
5056 if ( wgUploadAutoFill ) {
51 - mvUp.doDestinationFill( this );
 57+ mwUploadHelper.doDestinationFill( this );
5258 }
5359 });
5460 },

Status & tagging log