Index: trunk/extensions/UploadWizard/UploadWizard.config.php |
— | — | @@ -224,6 +224,11 @@ |
225 | 225 | 'type' => 'and', |
226 | 226 | 'licenseGroups' => array( |
227 | 227 | array( |
| 228 | + 'head' => 'mwe-upwiz-license-none-applicable-head', |
| 229 | + 'subhead' => 'mwe-upwiz-license-none-applicable-subhead', |
| 230 | + 'special' => 'none' |
| 231 | + ), |
| 232 | + array( |
228 | 233 | // This should be a list of all CC licenses we can reasonably expect to find around the web |
229 | 234 | 'head' => 'mwe-upwiz-license-cc-head', |
230 | 235 | 'subhead' => 'mwe-upwiz-license-cc-subhead', |
— | — | @@ -266,10 +271,11 @@ |
267 | 272 | ) |
268 | 273 | ), |
269 | 274 | array( |
270 | | - 'head' => 'mwe-upwiz-license-none-applicable-head', |
271 | | - 'subhead' => 'mwe-upwiz-license-none-applicable-subhead', |
272 | | - 'special' => 'delete' |
273 | | - ) |
| 275 | + 'head' => 'mwe-upwiz-license-custom-head', |
| 276 | + 'subhead' => 'mwe-upwiz-license-custom-subhead', |
| 277 | + 'special' => 'custom' |
| 278 | + ), |
| 279 | + |
274 | 280 | ), |
275 | 281 | 'defaults' => array(), |
276 | 282 | ), |
— | — | @@ -277,7 +283,7 @@ |
278 | 284 | |
279 | 285 | // Default thumbnail width |
280 | 286 | 'thumbnailWidth' => 100, |
281 | | - |
| 287 | + |
282 | 288 | // Max thumbnail height: |
283 | 289 | 'thumbnailMaxHeight' => 100, |
284 | 290 | |
Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -338,6 +338,7 @@ |
339 | 339 | 'mwe-upwiz-license-misc', |
340 | 340 | 'mwe-upwiz-license-custom-head', |
341 | 341 | 'mwe-upwiz-license-custom-subhead', |
| 342 | + 'mwe-upwiz-license-custom-preview', |
342 | 343 | 'mwe-upwiz-license-none-applicable-head', |
343 | 344 | 'mwe-upwiz-license-none-applicable-subhead', |
344 | 345 | 'mwe-upwiz-license-none-applicable', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -261,9 +261,11 @@ |
262 | 262 | 'mwe-upwiz-license-custom-head' => 'Experts only: enter the code for a license not shown here', |
263 | 263 | 'mwe-upwiz-license-custom-subhead' => 'Enter wikitext that will add a license template to your uploads.', |
264 | 264 | |
265 | | - 'mwe-upwiz-license-none-applicable-head' => 'I do not know if any of the above choices apply or not! Help!', |
266 | | - 'mwe-upwiz-license-none-applicable-subhead' => 'If you are not absolutely sure what the intentions of the original author were then please do not upload {{PLURAL:$1|this file|these files}} to this site. Press the button below to abandon {{PLURAL:$1|this upload|these uploads}} -- do not worry, nothing has been published yet.', |
| 265 | + 'mwe-upwiz-license-none-applicable-head' => 'I don\'t know', |
| 266 | + 'mwe-upwiz-license-none-applicable-subhead' => 'Please explain where you got the image. If it is not published under a suitable license it will be deleted without further notice.', |
267 | 267 | |
| 268 | + 'mwe-upwiz-license-custom-preview' => 'Preview', |
| 269 | + |
268 | 270 | 'mwe-upwiz-license-none-applicable' => 'Abandon {{PLURAL:$1|this upload|these uploads}} without publishing', |
269 | 271 | 'mwe-upwiz-license-confirm-remove' => 'Are you sure you want to remove {{PLURAL:$1|this upload|these uploads}}?', |
270 | 272 | 'mwe-upwiz-license-confirm-remove-title' => 'Confirm remove', |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js |
— | — | @@ -394,10 +394,6 @@ |
395 | 395 | // set the "value" to be the null deed; which will cause an error if the data is submitted. |
396 | 396 | _this.choose( mw.UploadWizardNullDeed ); |
397 | 397 | |
398 | | - // set the "delete associated upload" option, if available |
399 | | - // this has a somewhat nasty & twisted dependency on the licenses config, since if you enable the 'special delete' |
400 | | - // option there, you have to remember to pass a deleter here |
401 | | - _this.bindDeleter(); |
402 | 398 | }; |
403 | 399 | |
404 | 400 | |
— | — | @@ -498,40 +494,6 @@ |
499 | 495 | |
500 | 496 | remove: function() { |
501 | 497 | this.$selector.html(''); |
502 | | - }, |
503 | | - |
504 | | - /** |
505 | | - * This is a bit of a hack -- originally deeds were not supposed to know what uploads they applied to, |
506 | | - * the associated upload would just read that data when it needed to, or rebind itself on the fly. |
507 | | - * Unfortunately it's starting to become a bit messed up; to make deleting work, now the deeds know about the uploads, |
508 | | - * and the uploads know about the deeds. Really ought to be that there is some channel of communication that the uploads |
509 | | - * listen to, which could include a 'delete yourself' event. |
510 | | - * So, what this does: |
511 | | - * In the event that our license config includes the "special" item for i-don't-know-what-the-license-is, |
512 | | - * this will create a button there that deletes all the associated uploads. |
513 | | - */ |
514 | | - bindDeleter: function() { |
515 | | - var deedChooser = this; |
516 | | - |
517 | | - if ( !mw.isDefined( deedChooser.deleteDialog ) ) { |
518 | | - deedChooser.deleteDialog = mw.UploadWizardDeleteDialog( |
519 | | - deedChooser.uploads, |
520 | | - gM( 'mwe-upwiz-license-confirm-remove-title' ), |
521 | | - gM( 'mwe-upwiz-license-confirm-remove', deedChooser.uploads.length ) |
522 | | - ); |
523 | | - } |
524 | | - |
525 | | - $j( deedChooser.$selector.find( '.mwe-upwiz-license-special-delete' ) ).each( function() { |
526 | | - $j( this ).append( |
527 | | - $j( '<button type="button" name="abandon"></button>' ) |
528 | | - .msg( 'mwe-upwiz-license-none-applicable', deedChooser.uploads.length ) |
529 | | - .button() |
530 | | - .addClass( 'ui-button-text ui-button-textonly' ) |
531 | | - .click( function() { |
532 | | - deedChooser.deleteDialog.dialog( 'open' ); |
533 | | - } ) |
534 | | - ); |
535 | | - } ); |
536 | 498 | } |
537 | 499 | |
538 | 500 | }; // end UploadWizardDeed.prototype |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | * 'defaults' => array of template string names (can be empty array), |
9 | 9 | * 'licenses' => array of template string names (matching keys in mw.UploadWizard.config.licenses) |
10 | 10 | * optional: 'licenseGroups' => groups of licenses, with more explanation |
11 | | - * optional: 'special' => String -- indicates, don't put licenses here, instead leave a placeholder div, with class based on this string. |
| 11 | + * optional: 'special' => String -- indicates, don't put licenses here, instead use a special widget |
12 | 12 | * @param {Numbe} count of the things we are licensing (it matters to some texts) |
13 | 13 | */ |
14 | 14 | |
— | — | @@ -121,8 +121,24 @@ |
122 | 122 | } |
123 | 123 | var $licensesDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-deed-license' ); |
124 | 124 | if ( mw.isDefined( group['special'] ) ) { |
125 | | - // put a placeholder in our interface for our caller to place some special interface in |
126 | | - $licensesDiv.append( $j( '<div></div>' ).addClass( 'mwe-upwiz-license-special-' + group.special ) ); |
| 125 | + switch ( group['special'] ) { |
| 126 | + case 'custom': |
| 127 | + $licensesDiv.append( |
| 128 | + $j( '<div></div>' ).css( { 'width': '100%' } ).append( |
| 129 | + $j( '<div></div>' ).css( { 'float': 'right', 'width': '9em', 'padding-left': '1em' } ).append( |
| 130 | + $j( '<span></span>' ).button( { label: gM( 'mwe-upwiz-license-custom-preview' ) } ).css( { 'width': '8em' } ) |
| 131 | + ), |
| 132 | + $j( '<div></div>' ).css( { 'margin-right': '10em' } ).append( |
| 133 | + $j( '<textarea></textarea>' ).growTextArea().css( { 'width': '100%' } ) |
| 134 | + ), |
| 135 | + $j( '<div></div>' ).css( { 'clear':'both' } ) |
| 136 | + ) |
| 137 | + ); |
| 138 | + break; |
| 139 | + case 'none': |
| 140 | + default: |
| 141 | + break; |
| 142 | + } |
127 | 143 | } else { |
128 | 144 | appendLicenses( $licensesDiv, group ); |
129 | 145 | } |
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css |
— | — | @@ -442,7 +442,7 @@ |
443 | 443 | } |
444 | 444 | |
445 | 445 | .mwe-upwiz-deed-license { |
446 | | - margin-left: 24px; |
| 446 | + margin-left: 1.5em; |
447 | 447 | } |
448 | 448 | |
449 | 449 | #mwe-upwiz-macro-deeds { |
— | — | @@ -615,7 +615,7 @@ |
616 | 616 | |
617 | 617 | .mwe-upwiz-toggler { |
618 | 618 | margin-bottom: 0; |
619 | | - padding: 4px 0 3px 18px; |
| 619 | + padding-left: 1.5em; |
620 | 620 | /* @embed */ |
621 | 621 | background: url('images/toggle.png') no-repeat left center; |
622 | 622 | } |
— | — | @@ -626,7 +626,7 @@ |
627 | 627 | } |
628 | 628 | |
629 | 629 | .mwe-upwiz-toggler-content { |
630 | | - padding-left: 18px; |
| 630 | + padding-left: 1.5em; |
631 | 631 | } |
632 | 632 | |
633 | 633 | .mwe-upwiz-toggled { |