Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js |
— | — | @@ -219,14 +219,21 @@ |
220 | 220 | * @return {jQuery} wrapped textarea |
221 | 221 | */ |
222 | 222 | createCustomWikiTextInterface: function( $input ) { |
223 | | - var _this = this; |
| 223 | + var _this = this, |
| 224 | + keydownTimeout; |
224 | 225 | |
225 | 226 | var nameId = $input.attr( 'id' ) + '_custom'; |
226 | 227 | var $textarea = $j( '<textarea></textarea>' ) |
227 | 228 | .attr( { id: nameId, name: nameId } ) |
228 | 229 | .growTextArea() |
229 | 230 | .focus( function() { _this.setInput( $input, true ); } ) |
230 | | - .keydown( function() { _this.$selector.trigger( 'changeLicenses' ); } ) |
| 231 | + .keydown( function() { |
| 232 | + window.clearTimeout( keydownTimeout ); |
| 233 | + keydownTimeout = window.setTimeout( |
| 234 | + function() { _this.$selector.trigger( 'changeLicenses' ); }, |
| 235 | + 2000 |
| 236 | + ); |
| 237 | + } ) |
231 | 238 | .css( { |
232 | 239 | 'width': '100%', |
233 | 240 | 'font-family': 'monospace' |
— | — | @@ -479,8 +486,10 @@ |
480 | 487 | var templates = []; |
481 | 488 | accumTemplates( ast, templates ); |
482 | 489 | |
| 490 | + // TODO config |
483 | 491 | var topCat = new mw.Title( 'License tags', 'category' ); |
484 | 492 | |
| 493 | + // TODO caching |
485 | 494 | var found = false; |
486 | 495 | function recurseCategories( desiredCatTitle, title, depthToContinue ) { |
487 | 496 | if ( depthToContinue === 0 ) { |