Index: trunk/extensions/UploadWizard/UploadWizard.config.php |
— | — | @@ -75,21 +75,6 @@ |
76 | 76 | // The maximum length of the id field. |
77 | 77 | 'idFieldMaxLength' => 25, |
78 | 78 | |
79 | | - // Initial value for the id field. |
80 | | - 'idFieldInitialValue' => '', |
81 | | - |
82 | | - // Initial value for the description field. |
83 | | - 'defaultDescription' => '', |
84 | | - |
85 | | - // Initial value for the latitude field. |
86 | | - 'defaultLat' => '', |
87 | | - |
88 | | - // Initial value for the longitude field. |
89 | | - 'defaultLon' => '', |
90 | | - |
91 | | - // Initial value for the altitude field. |
92 | | - 'defaultAlt' => '', |
93 | | - |
94 | 79 | // 'licenses' is a list of licenses you could possibly use elsewhere, for instance in |
95 | 80 | // licensesOwnWork or licensesThirdParty. |
96 | 81 | // It just describes what licenses go with what wikitext, and how to display them in |
Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php |
— | — | @@ -53,32 +53,11 @@ |
54 | 54 | $this->outputHeader(); |
55 | 55 | |
56 | 56 | // if query string includes 'skiptutorial=true' set config variable to true |
57 | | - $skipTutorial = $wgRequest->getCheck( 'skiptutorial' ); |
58 | | - if ( $skipTutorial ) { |
59 | | - $skip = in_array( $skipTutorial, array( '1', 'true' ) ); |
| 57 | + if ( $wgRequest->getCheck( 'skiptutorial' ) ) { |
| 58 | + $skip = in_array( $wgRequest->getText( 'skiptutorial' ), array( '1', 'true' ) ); |
60 | 59 | UploadWizardConfig::setUrlSetting( 'skipTutorial', $skip ); |
61 | 60 | } |
62 | | - |
63 | | - $categories = $wgRequest->getText( 'categories' ); |
64 | | - if ( $categories ) { |
65 | | - UploadWizardConfig::setUrlSetting( 'defaultCategories', explode( '|', $categories ) ); |
66 | | - } |
67 | | - |
68 | | - $ulrArgs = array( |
69 | | - 'id' => 'idFieldInitialValue', |
70 | | - 'description' => 'defaultDescription', |
71 | | - 'lat' => 'defaultLat', |
72 | | - 'lon' => 'defaultLon', |
73 | | - 'alt' => 'defaultAlt', |
74 | | - ); |
75 | | - |
76 | | - foreach ( $ulrArgs as $arg => $setting ) { |
77 | | - $value = $wgRequest->getText( $arg ); |
78 | | - if ( $value ) { |
79 | | - UploadWizardConfig::setUrlSetting( $setting, $value ); |
80 | | - } |
81 | | - } |
82 | | - |
| 61 | + |
83 | 62 | $this->handleCampaign(); |
84 | 63 | |
85 | 64 | $out = $this->getOutput(); |
— | — | @@ -94,7 +73,6 @@ |
95 | 74 | $this->addJsVars( $subPage ); |
96 | 75 | |
97 | 76 | // dependencies (css, js) |
98 | | - $out->addModuleStyles( 'ext.uploadWizard' ); |
99 | 77 | $out->addModules( 'ext.uploadWizard' ); |
100 | 78 | |
101 | 79 | // where the uploadwizard will go |
Index: trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php |
— | — | @@ -180,9 +180,6 @@ |
181 | 181 | 'idFieldMaxLength' => array( |
182 | 182 | 'type' => 'int', |
183 | 183 | ), |
184 | | - 'idFieldInitialValue' => array( |
185 | | - 'type' => 'text', |
186 | | - ), |
187 | 184 | 'ownWorkOption' => array( |
188 | 185 | 'type' => 'radio', |
189 | 186 | 'options' => array( |
— | — | @@ -214,18 +211,6 @@ |
215 | 212 | 'thanksLabelPage' => array( |
216 | 213 | 'type' => 'text' |
217 | 214 | ), |
218 | | - 'defaultLat' => array( |
219 | | - 'type' => 'text' |
220 | | - ), |
221 | | - 'defaultLon' => array( |
222 | | - 'type' => 'text' |
223 | | - ), |
224 | | - 'defaultAlt' => array( |
225 | | - 'type' => 'text' |
226 | | - ), |
227 | | - 'defaultDescription' => array( |
228 | | - 'type' => 'text' |
229 | | - ), |
230 | 215 | ); |
231 | 216 | |
232 | 217 | foreach ( $globalConfig['licenses'] as $licenseName => $licenseDate ) { |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -323,14 +323,9 @@ |
324 | 324 | 'mwe-upwiz-campaign-conf-idField' => 'ID field wikitext. Example: <nowiki>{{Rijksmonument|$1}}</nowiki>. Blank to not display field:', |
325 | 325 | 'mwe-upwiz-campaign-conf-idFieldLabel' => 'ID field label text:', |
326 | 326 | 'mwe-upwiz-campaign-conf-idFieldLabelPage' => 'Page name with text for the ID field label. $1 is replaced with the language code:', |
327 | | - 'mwe-upwiz-campaign-conf-idFieldInitialValue' => 'Initial value for the ID field.', |
328 | 327 | 'mwe-upwiz-campaign-conf-headerLabelPage' => 'Page containing text to display above the UploadWizard interface. $1 is replaced with the language code:', |
329 | 328 | 'mwe-upwiz-campaign-conf-thanksLabelPage' => 'Page containing text to display on top of the "Use" page. $1 is replaced with the language code:', |
330 | 329 | 'mwe-upwiz-campaign-conf-idFieldMaxLength' => 'Maximum length of the text in the ID field', |
331 | | - 'mwe-upwiz-campaign-conf-defaultLat' => 'Default latitude', |
332 | | - 'mwe-upwiz-campaign-conf-defaultLon' => 'Default longitude', |
333 | | - 'mwe-upwiz-campaign-conf-defaultAlt' => 'Default altitude', |
334 | | - 'mwe-upwiz-campaign-conf-defaultDescription' => 'Default description', |
335 | 330 | |
336 | 331 | // Coolcats |
337 | 332 | 'mw-coolcats-confirm-new-title' => 'Confirm new category', |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js |
— | — | @@ -460,45 +460,28 @@ |
461 | 461 | * @param selector jquery-compatible selector, for a single element |
462 | 462 | */ |
463 | 463 | moveFileInputToCover: function( selector ) { |
464 | | - var _this = this; |
465 | | - var update = function() { |
466 | | - var $covered = $j( selector ); |
| 464 | + var $covered = $j( selector ); |
467 | 465 | |
468 | | - _this.fileCtrlContainer |
469 | | - .css( $covered.position() ) |
470 | | - .css( 'marginTop', $covered.css( 'marginTop' ) ) |
471 | | - .css( 'marginRight', $covered.css( 'marginRight' ) ) |
472 | | - .css( 'marginBottom', $covered.css( 'marginBottom' ) ) |
473 | | - .css( 'marginLeft', $covered.css( 'marginLeft' ) ) |
474 | | - .width( $covered.outerWidth() ) |
475 | | - .height( $covered.outerHeight() ); |
| 466 | + this.fileCtrlContainer |
| 467 | + .css( $covered.position() ) |
| 468 | + .css( 'marginTop', $covered.css( 'marginTop' ) ) |
| 469 | + .css( 'marginRight', $covered.css( 'marginRight' ) ) |
| 470 | + .css( 'marginBottom', $covered.css( 'marginBottom' ) ) |
| 471 | + .css( 'marginLeft', $covered.css( 'marginLeft' ) ) |
| 472 | + .width( $covered.outerWidth() ) |
| 473 | + .height( $covered.outerHeight() ); |
476 | 474 | |
477 | | - _this.fileCtrlContainer.css( { 'z-index': 1 } ); |
| 475 | + this.fileCtrlContainer.css( { 'z-index': 1 } ); |
478 | 476 | |
479 | | - // shift the file input over with negative margins, |
480 | | - // internal to the overflow-containing div, so the div shows all button |
481 | | - // and none of the textfield-like input |
482 | | - _this.$fileInputCtrl.css( { |
483 | | - 'margin-left': '-' + ~~( _this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px', |
484 | | - 'margin-top' : '-' + ~~( _this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px' |
485 | | - } ); |
486 | | - } |
| 477 | + // shift the file input over with negative margins, |
| 478 | + // internal to the overflow-containing div, so the div shows all button |
| 479 | + // and none of the textfield-like input |
| 480 | + this.$fileInputCtrl.css( { |
| 481 | + 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px', |
| 482 | + 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px' |
| 483 | + } ); |
487 | 484 | |
488 | | - if (this.moveFileInputInterval) { |
489 | | - window.clearInterval(this.moveFileInputInterval); |
490 | | - } |
491 | | - this.moveFileInputInterval = window.setInterval(function() { |
492 | | - update(); |
493 | | - }, 500); |
494 | | - update(); |
495 | | - }, |
496 | 485 | |
497 | | - hideFileInput: function() { |
498 | | - if (this.moveFileInputInterval) { |
499 | | - window.clearInterval(this.moveFileInputInterval); |
500 | | - } |
501 | | - this.moveFileInputInterval = null; |
502 | | - // Should we actually hide it? |
503 | 486 | }, |
504 | 487 | |
505 | 488 | /** |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -746,7 +746,6 @@ |
747 | 747 | } else { |
748 | 748 | $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', true ); |
749 | 749 | $j( _this.uploadToAdd.ui.div ).hide(); |
750 | | - _this.uploadToAdd.ui.hideFileInput(); |
751 | 750 | } |
752 | 751 | |
753 | 752 | |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * @param languageCode -- string |
6 | 6 | * @param firstRequired -- boolean -- the first description is required and should be validated and displayed a bit differently |
7 | 7 | */ |
8 | | -mw.UploadWizardDescription = function( languageCode, required, initialValue ) { |
| 8 | +mw.UploadWizardDescription = function( languageCode, required ) { |
9 | 9 | var _this = this; |
10 | 10 | mw.UploadWizardDescription.prototype.count++; |
11 | 11 | _this.id = 'description' + mw.UploadWizardDescription.prototype.count; |
— | — | @@ -37,10 +37,6 @@ |
38 | 38 | .attr( 'title', gM( 'mwe-upwiz-tooltip-description' ) ) |
39 | 39 | .growTextArea(); |
40 | 40 | |
41 | | - if ( initialValue !== undefined ) { |
42 | | - _this.input.val( initialValue ); |
43 | | - } |
44 | | - |
45 | 41 | // descriptions |
46 | 42 | _this.div = $j('<div class="mwe-upwiz-details-descriptions-container ui-helper-clearfix"></div>' ) |
47 | 43 | .append( errorLabelDiv, fieldnameDiv, _this.languageMenu, _this.input ); |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -170,11 +170,7 @@ |
171 | 171 | _this.latInput = $j( '<input type="text" id="' + latId + '" name="' + latId + '" class="mwe-loc-lat" size="10"/>' ); |
172 | 172 | _this.lonInput = $j( '<input type="text" id="' + lonId + '" name="' + lonId + '" class="mwe-loc-lon" size="10"/>' ); |
173 | 173 | _this.altInput = $j( '<input type="text" id="' + altId + '" name="' + altId + '" class="mwe-loc-alt" size="10"/>' ); |
174 | | - |
175 | | - _this.latInput.val( mw.UploadWizard.config.defaultLat ); |
176 | | - _this.lonInput.val( mw.UploadWizard.config.defaultLon ); |
177 | | - _this.altInput.val( mw.UploadWizard.config.defaultAlt ); |
178 | | - |
| 174 | + |
179 | 175 | var latDiv = $j( '<div class="mwe-location-lat"></div>' ) |
180 | 176 | .append( $j ( '<div class="mwe-location-lat-label"></div>' ).append( gM( 'mwe-upwiz-location-lat' ) ) ) |
181 | 177 | .append( _this.latInput ); |
— | — | @@ -221,9 +217,7 @@ |
222 | 218 | 'name': idFieldId, |
223 | 219 | 'class': 'mwe-idfield', |
224 | 220 | 'maxlength': mw.UploadWizard.config.idFieldMaxLength |
225 | | - } ); |
226 | | - |
227 | | - _this.idFieldInput.val( mw.UploadWizard.config.idFieldInitialValue ); |
| 221 | + } ); |
228 | 222 | |
229 | 223 | _this.$form.append( |
230 | 224 | $j( '<div class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' + idFieldId + '" generated="true"/></div>' ), |
— | — | @@ -335,13 +329,7 @@ |
336 | 330 | |
337 | 331 | mw.UploadWizardUtil.makeToggler( moreDetailsCtrlDiv, moreDetailsDiv ); |
338 | 332 | |
339 | | - _this.addDescription( |
340 | | - !mw.UploadWizard.config.idField, |
341 | | - mw.config.get( 'wgUserLanguage' ), |
342 | | - false, |
343 | | - mw.UploadWizard.config.defaultDescription |
344 | | - ); |
345 | | - |
| 333 | + _this.addDescription( !mw.UploadWizard.config.idField, mw.config.get( 'wgUserLanguage' ), false ); |
346 | 334 | $j( containerDiv ).append( _this.div ); |
347 | 335 | |
348 | 336 | if ( mw.config.get( 'UploadWizardConfig' ).useTitleBlacklistApi ) { |
— | — | @@ -554,7 +542,7 @@ |
555 | 543 | /** |
556 | 544 | * Add a new description |
557 | 545 | */ |
558 | | - addDescription: function( required, languageCode, allowRemove, initialValue ) { |
| 546 | + addDescription: function( required, languageCode, allowRemove ) { |
559 | 547 | var _this = this; |
560 | 548 | if ( required === undefined ) { |
561 | 549 | required = false; |
— | — | @@ -568,7 +556,7 @@ |
569 | 557 | allowRemove = true; |
570 | 558 | } |
571 | 559 | |
572 | | - var description = new mw.UploadWizardDescription( languageCode, required, initialValue ); |
| 560 | + var description = new mw.UploadWizardDescription( languageCode, required ); |
573 | 561 | |
574 | 562 | if ( !required && allowRemove ) { |
575 | 563 | $j( description.div ).append( |