Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | _this.authorInput = $j('<textarea class="mwe-author mwe-long-textarea" name="author" rows="1" cols="40"></textarea>' ) |
208 | 208 | .growTextArea() |
209 | 209 | .attr( 'title', gM( 'mwe-upwiz-tooltip-author' ) ); |
210 | | - licenseInputDiv = $j( '<div class="mwe-upwiz-deed-license"></div>' ); |
| 210 | + licenseInputDiv = $j( '<div></div>' ); |
211 | 211 | _this.licenseInput = new mw.UploadWizardLicenseInput( licenseInputDiv, |
212 | 212 | undefined, |
213 | 213 | mw.UploadWizard.config.licensesThirdParty, |
— | — | @@ -397,7 +397,6 @@ |
398 | 398 | _this.deed = deed; |
399 | 399 | if ( deed === mw.UploadWizardNullDeed ) { |
400 | 400 | $j( _this ).trigger( 'chooseNullDeed' ); |
401 | | - //_this.trigger( 'isNotReady' ); |
402 | 401 | _this.$selector |
403 | 402 | .find( 'input.mwe-accept-deed' ) |
404 | 403 | .attr( 'checked', false ); |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js |
— | — | @@ -51,6 +51,7 @@ |
52 | 52 | */ |
53 | 53 | function appendLicenses( $el, config ) { |
54 | 54 | if ( !mw.isDefined( config['licenses'] && typeof config['licenses'] === 'object' ) ) { |
| 55 | + console.log( config ); |
55 | 56 | throw new Error( "improper license config" ); |
56 | 57 | } |
57 | 58 | $j.each( config['licenses'], function( i, name ) { |
— | — | @@ -104,18 +105,28 @@ |
105 | 106 | throw new Error( 'improper config' ); |
106 | 107 | } |
107 | 108 | var $group = $j( '<div></div>' ).addClass( 'mwe-upwiz-deed-license-group' ); |
| 109 | + // if there is no header, just append licenses to the group div. |
| 110 | + var $body = $group; |
| 111 | + // if there is a header, make a toggle-to-expand div and append to that instead. |
108 | 112 | if ( mw.isDefined( group['head'] ) ) { |
109 | | - $group.append( $j( '<p></p>' ).addClass( 'mwe-upwiz-deed-license-group-head' ).msg( group.head, _this.count ) ); |
| 113 | + var $head = $j( '<div></div>' ).append( |
| 114 | + $j( '<a>' ) |
| 115 | + .addClass( 'mwe-upwiz-deed-license-group-head mwe-upwiz-toggler' ) |
| 116 | + .msg( group.head, _this.count ) |
| 117 | + ); |
| 118 | + $body = $j( '<div></div>' ).addClass( 'mwe-upwiz-toggler-content' ).css( { 'marginBottom': '1em' } ); |
| 119 | + $group.append( $head, $body ).collapseToggle(); |
110 | 120 | } |
111 | 121 | if ( mw.isDefined( group['subhead'] ) ) { |
112 | | - $group.append( $j( '<p></p>' ).addClass( 'mwe-upwiz-deed-license-group-subhead' ).msg( group.subhead, _this.count ) ); |
| 122 | + $body.append( $j( '<div></div>' ).addClass( 'mwe-upwiz-deed-license-group-subhead' ).msg( group.subhead, _this.count ) ); |
113 | 123 | } |
114 | 124 | var $licensesDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-deed-license' ); |
115 | 125 | appendLicenses( $licensesDiv, group ); |
116 | | - $group.append( $licensesDiv ); |
| 126 | + $body.append( $licensesDiv ); |
117 | 127 | _this.$selector.append( $group ); |
118 | 128 | } ); |
119 | 129 | |
| 130 | + |
120 | 131 | } else { |
121 | 132 | appendLicenses( _this.$selector, config ); |
122 | 133 | } |
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css |
— | — | @@ -626,6 +626,10 @@ |
627 | 627 | background: url('images/toggle-open.png') no-repeat left center; |
628 | 628 | } |
629 | 629 | |
| 630 | +.mwe-upwiz-toggler-content { |
| 631 | + padding-left: 18px; |
| 632 | +} |
| 633 | + |
630 | 634 | .mwe-upwiz-toggled { |
631 | 635 | margin-top: 1em; |
632 | 636 | } |
— | — | @@ -682,16 +686,6 @@ |
683 | 687 | #upload-wizard .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } |
684 | 688 | #upload-wizard .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } |
685 | 689 | |
686 | | -.mwe-upwiz-deed-license-group { |
687 | | - margin-top: 1em; |
688 | | - margin-bottom: 1.5em; |
689 | | -} |
690 | | - |
691 | | -.mwe-upwiz-deed-license-group-head { |
692 | | - font-weight: bold; |
693 | | - margin-bottom: 0em; |
694 | | -} |
695 | | - |
696 | 690 | .mwe-upwiz-deed-license-group-subhead { |
697 | 691 | color: #797979; |
698 | 692 | margin-top: 0em; |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -1550,6 +1550,31 @@ |
1551 | 1551 | return this; |
1552 | 1552 | }; |
1553 | 1553 | |
| 1554 | + /** |
| 1555 | + * jQuery plugin - collapse toggle |
| 1556 | + * Given an element, makes contained elements of class mw-collapsible-toggle clickable to show/reveal |
| 1557 | + * contained element(s) of class mw-collapsible-content. |
| 1558 | + * |
| 1559 | + * Somewhat recapitulates mw.UploadWizardUtil.makeToggler, |
| 1560 | + * toggle() in vector.collapsibleNav.js, not to mention jquery.collapsible |
| 1561 | + * but none of those do what we want, or are inaccessible to us |
| 1562 | + */ |
| 1563 | + jQuery.fn.collapseToggle = function() { |
| 1564 | + var $el = this; |
| 1565 | + var $contents = $el.find( '.mwe-upwiz-toggler-content' ).hide(); |
| 1566 | + var $toggle = $el.find( '.mwe-upwiz-toggler' ).addClass( 'mwe-upwiz-more-options' ); |
| 1567 | + $toggle.click( function( e ) { |
| 1568 | + e.stopPropagation(); |
| 1569 | + if ( $toggle.hasClass( 'mwe-upwiz-toggler-open' ) ) { |
| 1570 | + $contents.slideUp( 250 ); |
| 1571 | + $toggle.removeClass( 'mwe-upwiz-toggler-open' ); |
| 1572 | + } else { |
| 1573 | + $contents.slideDown( 250 ); |
| 1574 | + $toggle.addClass( 'mwe-upwiz-toggler-open' ); |
| 1575 | + } |
| 1576 | + } ); |
| 1577 | + return this; |
| 1578 | + }; |
1554 | 1579 | |
1555 | 1580 | $j.validator.setDefaults( { |
1556 | 1581 | debug: true, |