Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -36,20 +36,15 @@ |
37 | 37 | 'mwe-upwiz-remaining' => '$1 {{PLURAL:$1|file|files}} remaining', |
38 | 38 | 'mwe-upwiz-deeds-intro' => "Thank you! Now we need to set a license for these files, so everyone can legally view or modify them. First, we will have to know where you got them.", |
39 | 39 | 'mwe-upwiz-details-intro' => 'Now we need some basic information about the files.', |
40 | | - 'mwe-upwiz-source-ownwork' => 'This file is my own work.', |
41 | | - 'mwe-upwiz-source-ownwork-plural' => 'These files are my own work.', |
42 | | - 'mwe-upwiz-source-ownwork-assert' => 'I, $1, the copyright holder of this work, hereby grant anyone the right to use this work for any purpose, as long as they credit me and share derivative work under the same terms.', |
43 | | - 'mwe-upwiz-source-ownwork-assert-plural' => 'I, $1, the copyright holder of these works, hereby grant anyone the right to use these works for any purpose, as long as they credit me and share derivative work under the same terms.', |
44 | | - 'mwe-upwiz-source-ownwork-assert-custom' => 'I, $1, the copyright holder of this work, hereby publish this work under the following license(s):', |
45 | | - 'mwe-upwiz-source-ownwork-assert-custom-plural' => 'I, $1, the copyright holder of these works, hereby publish these works under the following license(s):', |
| 40 | + 'mwe-upwiz-source-ownwork' => '{{PLURAL:$1|This file is|These files are}} my own work.', |
| 41 | + 'mwe-upwiz-source-ownwork-assert' => 'I, $2, the copyright holder of {{PLURAL:$1|this work|these works}}, hereby grant anyone the right to use {{PLURAL:$1|this work|these works}} for any purpose, as long as they credit me and share derivative work under the same terms.', |
| 42 | + 'mwe-upwiz-source-ownwork-assert-custom' => 'I, $2, the copyright holder of {{PLURAL:$1|this work|these works}}, hereby publish {{PLURAL:$1|this work|these works}} under the following license(s):', |
46 | 43 | 'mwe-upwiz-source-ownwork-assert-note' => 'This means you release your work under a double Creative Commons Attribution ShareAlike and GFDL license.', |
47 | 44 | 'mwe-upwiz-source-permission' => 'Their author gave you explicit permission to upload them', |
48 | | - 'mwe-upwiz-source-thirdparty' => 'This file is not my own work.', |
49 | | - 'mwe-upwiz-source-thirdparty-plural' => 'These files are not my own work.', |
| 45 | + 'mwe-upwiz-source-thirdparty' => '{{PLURAL:$1|This file is|These files are}} not my own work.', |
50 | 46 | 'mwe-upwiz-source-thirdparty-intro' => 'Please enter the address where you found each file.', |
51 | | - 'mwe-upwiz-source-thirdparty-custom-plural-intro' => 'If all files have the same source, author, and copyright status, you may enter them only once for all of them.', |
52 | | - 'mwe-upwiz-source-thirdparty-license' => 'The copyright holder of this work published it under the following license(s):', |
53 | | - 'mwe-upwiz-source-thirdparty-license-plural' => 'The copyright holder of these works published them under the following license(s):', |
| 47 | + 'mwe-upwiz-source-thirdparty-custom-multiple-intro' => 'If all files have the same source, author, and copyright status, you may enter them only once for all of them.', |
| 48 | + 'mwe-upwiz-source-thirdparty-license' => 'The copyright holder of {{PLURAL:$1|this work|these works}} published {{PLURAL:$1|it|them}} under the following license(s):', |
54 | 49 | 'mwe-upwiz-source-thirdparty-accept' => 'OK', |
55 | 50 | 'mwe-upwiz-source-custom' => 'Did you know? You can <a href="$1">customize</a> the default options you see here.', |
56 | 51 | 'mwe-upwiz-more-options' => 'more options...', |
— | — | @@ -108,6 +103,7 @@ |
109 | 104 | 'mwe-upwiz-file-need-file' => 'Please add an upload first.', |
110 | 105 | 'mwe-upwiz-file-need-start' => 'Please press this button to start your uploads.', |
111 | 106 | 'mwe-upwiz-file-need-complete' => 'Please wait until all files have finished uploading.', |
| 107 | + 'mwe-upwiz-deeds-need-deed' => 'Please explain where you got {{PLURAL:$1|this file|these files}} and how this site can use {{PLURAL:$1|it|them}}, by selecting one of the options.', |
112 | 108 | ); |
113 | 109 | |
114 | 110 | /** Message documentation (Message documentation) |
Index: trunk/extensions/UploadWizard/js/mw.UploadWizard.js |
— | — | @@ -966,7 +966,6 @@ |
967 | 967 | // descriptions |
968 | 968 | _this.descriptionsDiv = $j( '<div class="mwe-upwiz-details-descriptions mwe-upwiz-details-input"></div>' ); |
969 | 969 | |
970 | | - // XXX use plurals |
971 | 970 | _this.descriptionAdder = $j( '<a class="mwe-upwiz-desc-add"/>' ) |
972 | 971 | .attr( 'href', '#' ) |
973 | 972 | .html( gM( 'mwe-upwiz-desc-add-0' ) ) |
— | — | @@ -1896,17 +1895,16 @@ |
1897 | 1896 | |
1898 | 1897 | var customDeed = $j.extend( new mw.UploadWizardDeed(), { |
1899 | 1898 | isReady: function() { return true; }, |
1900 | | - setQuantity: function( n ) { return; } |
| 1899 | + setQuantity: function() { return; } |
1901 | 1900 | } ); |
1902 | 1901 | |
1903 | 1902 | $j( '#mwe-upwiz-deeds-custom' ).append( |
1904 | | - $j( '<div id="mwe-upwiz-deeds-later" />' ) |
| 1903 | + $j( '<div id="mwe-upwiz-deeds-later-div" />' ) |
1905 | 1904 | .hide() |
1906 | 1905 | .append( $j( '<label>' ) |
1907 | 1906 | .append( |
1908 | | - $j( '<input />') |
1909 | | - .attr( { type: 'checkbox', value: 'deeds-later' } ) |
1910 | | - .addClass( 'mwe-accept-deed' ) |
| 1907 | + $j( '<input id="mwe-upwiz-deeds-later" ' |
| 1908 | + + 'type="checkbox" value="deeds-later" class="mwe-accept-deed" />') |
1911 | 1909 | .click( function() { |
1912 | 1910 | if ( $j( this ).is( ':checked' ) ) { |
1913 | 1911 | _this.deedChooser.showDeedChoice(); |
— | — | @@ -1924,9 +1922,9 @@ |
1925 | 1923 | $j( _this.deedChooser ).bind( 'setQuantityEvent', function() { |
1926 | 1924 | mw.log( "checking this deedchooser count " + _this.deedChooser.count ); |
1927 | 1925 | if ( _this.deedChooser.count > 1 ) { |
1928 | | - $j( '#mwe-upwiz-deeds-later' ).show(); |
| 1926 | + $j( '#mwe-upwiz-deeds-later-div' ).show(); |
1929 | 1927 | } else { |
1930 | | - $j( '#mwe-upwiz-deeds-later' ).hide(); |
| 1928 | + $j( '#mwe-upwiz-deeds-later-div' ).hide(); |
1931 | 1929 | } |
1932 | 1930 | } ); |
1933 | 1931 | |
— | — | @@ -1934,7 +1932,13 @@ |
1935 | 1933 | $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) ); |
1936 | 1934 | |
1937 | 1935 | $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next').click( function() { |
1938 | | - _this.moveToStep('details'); |
| 1936 | + if ( $j( '#mwe-upwiz-deeds-later-checkbox' ).is( ':checked' ) |
| 1937 | + || |
| 1938 | + _this.deedChooser.isReady() ) { |
| 1939 | + _this.moveToStep('details'); |
| 1940 | + } else { |
| 1941 | + _this.deedChooser.deed.showValidationTips(); |
| 1942 | + } |
1939 | 1943 | } ); |
1940 | 1944 | |
1941 | 1945 | // XXX perhaps we should defer this until we click next |
— | — | @@ -2419,8 +2423,11 @@ |
2420 | 2424 | mw.UploadWizardNullDeed = $j.extend( new mw.UploadWizardDeed(), { |
2421 | 2425 | isReady: function() { return false; }, |
2422 | 2426 | |
2423 | | - setQuantity: function( n ) { return; } |
2424 | | - |
| 2427 | + setQuantity: function() { return; }, |
| 2428 | + |
| 2429 | + showValidationTips: function() { |
| 2430 | + alert( gM( 'mwe-upwiz-deeds-need-deed', _this.uploads.length ) ); |
| 2431 | + } |
2425 | 2432 | } ); |
2426 | 2433 | |
2427 | 2434 | |
— | — | @@ -2476,6 +2483,10 @@ |
2477 | 2484 | |
2478 | 2485 | mw.UploadWizardDeedChooser.prototype = { |
2479 | 2486 | |
| 2487 | + isReady: function() { |
| 2488 | + return ( typeof this.deed !== 'undefined' && this.deed.isReady() ); |
| 2489 | + }, |
| 2490 | + |
2480 | 2491 | count: 0, |
2481 | 2492 | |
2482 | 2493 | attach: function( upload ) { |
— | — | @@ -2495,15 +2506,13 @@ |
2496 | 2507 | setQuantity: function() { |
2497 | 2508 | var _this = this; |
2498 | 2509 | mw.log( "setting quantity of deed to " + _this.count ); |
2499 | | - var isPlural = _this.count > 1; |
2500 | 2510 | $j.each( [ 'ownwork', 'thirdparty' ], function (i, key) { |
2501 | 2511 | |
2502 | 2512 | // fix the deed title that opens and closes |
2503 | | - gMkey = isPlural ? key + '-plural' : key; |
2504 | 2513 | $j( _this.selector ) |
2505 | 2514 | .find( '.mwe-upwiz-macro-deed-' + key) |
2506 | 2515 | .find( '.mwe-upwiz-deed-name' ) |
2507 | | - .html( gM( 'mwe-upwiz-source-' + gMkey ) ); |
| 2516 | + .html( gM( 'mwe-upwiz-source-' + key, _this.count ) ); |
2508 | 2517 | |
2509 | 2518 | // any other internal strings in the deed |
2510 | 2519 | if ( _this.deeds[key] ) { |
— | — | @@ -2669,25 +2678,26 @@ |
2670 | 2679 | } |
2671 | 2680 | } ); |
2672 | 2681 | |
2673 | | - _this.setQuantity( 1 ); |
| 2682 | + _this.count = 1; |
| 2683 | + _this.setQuantity(); |
2674 | 2684 | |
2675 | 2685 | |
2676 | 2686 | }, |
2677 | 2687 | |
2678 | 2688 | |
2679 | | - setQuantity: function( n ) { |
| 2689 | + setQuantity: function() { |
2680 | 2690 | var _this = this; |
2681 | | - var plural = n > 1 ? '-plural' : ''; |
2682 | 2691 | $j( _this.deedChooser.selector ) |
2683 | 2692 | .find( 'p.mwe-upwiz-source-ownwork-assert' ) |
2684 | | - .html( gM( 'mwe-upwiz-source-ownwork-assert' + plural, |
2685 | | - $j( '<input />' ) |
2686 | | - .attr( { name: 'author' } ) |
2687 | | - .addClass( 'mwe-upwiz-sign' ) ) ); |
| 2693 | + .html( gM( 'mwe-upwiz-source-ownwork-assert', |
| 2694 | + _this.count, |
| 2695 | + '<input name="author" class="mwe-upwiz-sign" />' ) |
| 2696 | + ); |
2688 | 2697 | |
2689 | 2698 | $j( _this.deedChooser.selector ) |
2690 | 2699 | .find( 'p.mwe-upwiz-source-ownwork-assert-custom' ) |
2691 | | - .html( gM( 'mwe-upwiz-source-ownwork-assert-custom' + plural, |
| 2700 | + .html( gM( 'mwe-upwiz-source-ownwork-assert-custom', |
| 2701 | + _this.count, |
2692 | 2702 | '<span class="mwe-custom-author-input"></span>' ) ); |
2693 | 2703 | |
2694 | 2704 | // have to add the author input this way -- gM() will flatten it to a string and we'll lose it as a dom object |
— | — | @@ -2762,34 +2772,36 @@ |
2763 | 2773 | $j( deedChooser.selector ).find( '.mwe-upwiz-macro-deed-thirdparty .mwe-upwiz-deed-form' ).append( |
2764 | 2774 | $j( '<div class="mwe-upwiz-deed-form-internal"/>' ) |
2765 | 2775 | .append( |
2766 | | - $j( '<div class="mwe-upwiz-source-thirdparty-custom-plural-intro" />' ), |
2767 | | - $j( '<div />' ) |
2768 | | - .addClass( "mwe-upwiz-thirdparty-fields" ) |
2769 | | - .append( $j( '<label />' ) |
2770 | | - .attr( { 'for' : 'source' } ) |
2771 | | - .text( gM( 'mwe-upwiz-source' ) ) ) |
2772 | | - .append( sourceInput ), |
2773 | | - $j( '<div />' ) |
2774 | | - .addClass( "mwe-upwiz-thirdparty-fields" ) |
2775 | | - .append( $j( '<label />' ) |
2776 | | - .attr( { 'for' : 'author' } ) |
2777 | | - .text( gM( 'mwe-upwiz-author' ) ) ) |
2778 | | - .append( authorInput ), |
2779 | | - $j( '<div />' ).addClass( 'mwe-upwiz-thirdparty-license' ) |
2780 | | - .text( gM( 'mwe-upwiz-source-thirdparty-license' ) ), |
| 2776 | + $j( '<div class="mwe-upwiz-source-thirdparty-custom-multiple-intro" />' ), |
| 2777 | + $j( '<div class="mwe-upwiz-thirdparty-fields" />' ) |
| 2778 | + .append( $j( '<label for="source"/>' ).text( gM( 'mwe-upwiz-source' ) ), |
| 2779 | + sourceInput ), |
| 2780 | + $j( '<div class="mwe-upwiz-thirdparty-fields" />' ) |
| 2781 | + .append( $j( '<label for="author"/>' ).text( gM( 'mwe-upwiz-author' ) ), |
| 2782 | + authorInput ), |
| 2783 | + $j( '<div class="mwe-upwiz-thirdparty-license" />' ), |
2781 | 2784 | licenseInputDiv |
2782 | 2785 | ) |
2783 | 2786 | ); |
2784 | 2787 | |
2785 | | - thirdPartyDeed.setQuantity( 1 ); |
| 2788 | + _this.count = 1; |
| 2789 | + _this.setQuantity(); |
| 2790 | + |
2786 | 2791 | }, |
2787 | 2792 | |
2788 | | - |
2789 | | - setQuantity: function( n ) { |
| 2793 | + setQuantity: function() { |
2790 | 2794 | var _this = this; |
2791 | 2795 | $j( _this.deedChooser.selector ) |
2792 | | - .find( 'div.mwe-upwiz-source-thirdparty-custom-plural-intro' ) |
2793 | | - .html( n > 1 ? gM( 'mwe-upwiz-source-thirdparty-custom-plural-intro' ) : '' ); |
| 2796 | + .find( 'div.mwe-upwiz-source-thirdparty-custom-multiple-intro' ) |
| 2797 | + .html( _this.count > 1 ? gM( 'mwe-upwiz-source-thirdparty-custom-multiple-intro' ) : '' ); |
| 2798 | + |
| 2799 | + $j( _this.deedChooser.selector ) |
| 2800 | + .find( 'div.mwe-upwiz-thirdparty-license' ) |
| 2801 | + .text( gM( 'mwe-upwiz-source-thirdparty-license', _this.count ) ); |
| 2802 | + }, |
| 2803 | + |
| 2804 | + showValidationTips: function() { |
| 2805 | + // TBD |
2794 | 2806 | } |
2795 | 2807 | |
2796 | 2808 | |