Index: branches/js2-work/phase3/js/mwEmbed/modules/UploadWizard/mw.ApiUploadHandler.js |
— | — | @@ -36,14 +36,14 @@ |
37 | 37 | }, |
38 | 38 | |
39 | 39 | |
40 | | - addCompletedCb: function(fn) { |
| 40 | + addCompletedCb: function(f) { |
41 | 41 | var _this = this; |
42 | | - _this.completedCallbacks.push(function() { fn() }); |
| 42 | + _this.completedCallbacks.push(f); |
43 | 43 | }, |
44 | 44 | |
45 | | - addErrorCb: function(fn) { |
| 45 | + addErrorCb: function(f) { |
46 | 46 | var _this = this; |
47 | | - _this.errorCallbacks.push(function() { fn(error) }); |
| 47 | + _this.errorCallbacks.push(f); |
48 | 48 | }, |
49 | 49 | |
50 | 50 | configureForm: function() { |
— | — | @@ -71,6 +71,9 @@ |
72 | 72 | _this.addFormInputIfMissing('token', mw.getConfig('token')); |
73 | 73 | _this.addFormInputIfMissing('action', 'upload'); |
74 | 74 | _this.addFormInputIfMissing('format', 'jsonfm'); |
| 75 | + |
| 76 | + // XXX only for testing, so it stops complaining about dupes |
| 77 | + _this.addFormInputIfMissing('ignorewarnings', '1'); |
75 | 78 | }, |
76 | 79 | |
77 | 80 | addFormInputIfMissing: function(name, value) { |
— | — | @@ -102,7 +105,6 @@ |
103 | 106 | var _this = this; |
104 | 107 | _this.ui.progress(fraction); |
105 | 108 | for (var i = 0; i < _this.progressCallbacks.length; i++) { |
106 | | - debugger; |
107 | 109 | _this.progressCallbacks[i](fraction); |
108 | 110 | } |
109 | 111 | }, |
— | — | @@ -113,9 +115,7 @@ |
114 | 116 | completed: function(result) { |
115 | 117 | console.log("api: upload completed!") |
116 | 118 | var _this = this; |
117 | | - |
118 | 119 | _this.ui.completed(); |
119 | | - |
120 | 120 | for (var i = 0; i < _this.completedCallbacks.length; i++) { |
121 | 121 | _this.completedCallbacks[i](result); |
122 | 122 | } |