Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1605,7 +1605,7 @@ |
1606 | 1606 | * to ensure that client-side caches do not keep obsolete copies of global |
1607 | 1607 | * styles. |
1608 | 1608 | */ |
1609 | | -$wgStyleVersion = '244'; |
| 1609 | +$wgStyleVersion = '245'; |
1610 | 1610 | |
1611 | 1611 | |
1612 | 1612 | # Server-side caching: |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -183,6 +183,8 @@ |
184 | 184 | * @return UploadForm |
185 | 185 | */ |
186 | 186 | protected function getUploadForm( $message = '', $sessionKey = '' ) { |
| 187 | + global $wgOut; |
| 188 | + |
187 | 189 | # Initialize form |
188 | 190 | $form = new UploadForm( $this->watchCheck(), $this->mForReUpload, $sessionKey ); |
189 | 191 | $form->setTitle( $this->getTitle() ); |
— | — | @@ -196,12 +198,20 @@ |
197 | 199 | $form->addPreText( '<div id="uploadtext">' . wfMsgExt( 'uploadtext', 'parse' ) . '</div>'); |
198 | 200 | # Add upload error message |
199 | 201 | $form->addPreText( $message ); |
| 202 | + |
| 203 | + # Add footer to form |
| 204 | + $uploadFooter = wfMsgNoTrans( 'uploadfooter' ); |
| 205 | + if ( $uploadFooter != '-' && !wfEmptyMsg( 'uploadfooter', $uploadFooter ) ) { |
| 206 | + $form->addPostText( '<div id="mw-upload-footer-message">' |
| 207 | + . $wgOut->parse( $uploadFooter ) . "</div>\n" ); |
| 208 | + } |
| 209 | + |
| 210 | + return $form; |
200 | 211 | |
201 | | - return $form; |
202 | 212 | } |
203 | 213 | |
204 | 214 | /** |
205 | | - * TODO: DOCUMENT |
| 215 | + * Shows the "view X deleted revivions link"" |
206 | 216 | */ |
207 | 217 | protected function showViewDeletedLinks() { |
208 | 218 | global $wgOut, $wgUser; |
— | — | @@ -644,7 +654,10 @@ |
645 | 655 | } |
646 | 656 | |
647 | 657 | /** |
648 | | - * |
| 658 | + * Get the descriptor of the fieldset that contains the file source |
| 659 | + * selection. The section is 'source' |
| 660 | + * |
| 661 | + * @return array Descriptor array |
649 | 662 | */ |
650 | 663 | protected function getSourceSection() { |
651 | 664 | global $wgLang, $wgUser, $wgRequest; |
— | — | @@ -710,8 +723,11 @@ |
711 | 724 | return $descriptor; |
712 | 725 | } |
713 | 726 | |
| 727 | + |
714 | 728 | /** |
715 | | - * |
| 729 | + * Get the messages indicating which extensions are preferred and prohibitted. |
| 730 | + * |
| 731 | + * @return string HTML string containing the message |
716 | 732 | */ |
717 | 733 | protected function getExtensionsMessage() { |
718 | 734 | # Print a list of allowed file extensions, if so configured. We ignore |
— | — | @@ -745,7 +761,10 @@ |
746 | 762 | } |
747 | 763 | |
748 | 764 | /** |
749 | | - * |
| 765 | + * Get the descriptor of the fieldset that contains the file description |
| 766 | + * input. The section is 'description' |
| 767 | + * |
| 768 | + * @return array Descriptor array |
750 | 769 | */ |
751 | 770 | protected function getDescriptionSection() { |
752 | 771 | global $wgUser, $wgOut; |
— | — | @@ -773,6 +792,10 @@ |
774 | 793 | 'cols' => $cols, |
775 | 794 | 'rows' => 8, |
776 | 795 | ), |
| 796 | + 'EditTools' => array( |
| 797 | + 'type' => 'edittools', |
| 798 | + 'section' => 'description', |
| 799 | + ), |
777 | 800 | 'License' => array( |
778 | 801 | 'type' => 'select', |
779 | 802 | 'class' => 'Licenses', |
— | — | @@ -784,13 +807,6 @@ |
785 | 808 | if ( $this->mForReUpload ) |
786 | 809 | $descriptor['DestFile']['readonly'] = true; |
787 | 810 | |
788 | | - global $wgUseAjax, $wgAjaxLicensePreview; |
789 | | - if ( $wgUseAjax && $wgAjaxLicensePreview ) |
790 | | - $descriptor['AjaxLicensePreview'] = array( |
791 | | - 'class' => 'UploadAjaxLicensePreview', |
792 | | - 'section' => 'description' |
793 | | - ); |
794 | | - |
795 | 811 | global $wgUseCopyrightUpload; |
796 | 812 | if ( $wgUseCopyrightUpload ) { |
797 | 813 | $descriptor['UploadCopyStatus'] = array( |
— | — | @@ -811,7 +827,10 @@ |
812 | 828 | } |
813 | 829 | |
814 | 830 | /** |
815 | | - * |
| 831 | + * Get the descriptor of the fieldset that contains the upload options, |
| 832 | + * such as "watch this file". The section is 'options' |
| 833 | + * |
| 834 | + * @return array Descriptor array |
816 | 835 | */ |
817 | 836 | protected function getOptionsSection() { |
818 | 837 | global $wgOut; |
— | — | @@ -829,26 +848,14 @@ |
830 | 849 | 'label-message' => 'ignorewarnings', |
831 | 850 | 'section' => 'options', |
832 | 851 | ), |
833 | | - 'EditTools' => array( |
834 | | - 'type' => 'edittools', |
835 | | - 'section' => 'options', |
836 | | - ), |
837 | 852 | ); |
838 | 853 | |
839 | | - $uploadFooter = wfMsgNoTrans( 'uploadfooter' ); |
840 | | - if ( $uploadFooter != '-' && !wfEmptyMsg( 'uploadfooter', $uploadFooter ) ) |
841 | | - $descriptor['UploadFooter'] = array( |
842 | | - 'type' => 'info', |
843 | | - 'id' => 'mw-upload-footer-message', |
844 | | - 'default' => $wgOut->parse( $uploadFooter ), |
845 | | - ); |
846 | | - |
847 | 854 | return $descriptor; |
848 | 855 | |
849 | 856 | } |
850 | 857 | |
851 | 858 | /** |
852 | | - * |
| 859 | + * Add the upload JS and show the form. |
853 | 860 | */ |
854 | 861 | public function show() { |
855 | 862 | $this->addUploadJS(); |
— | — | @@ -856,7 +863,10 @@ |
857 | 864 | } |
858 | 865 | |
859 | 866 | /** |
860 | | - * |
| 867 | + * Add upload JS to $wgOut |
| 868 | + * |
| 869 | + * @param bool $autofill Whether or not to autofill the destination |
| 870 | + * filename text box |
861 | 871 | */ |
862 | 872 | protected function addUploadJS( $autofill = true ) { |
863 | 873 | global $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; |
— | — | @@ -886,6 +896,11 @@ |
887 | 897 | } |
888 | 898 | } |
889 | 899 | |
| 900 | + /** |
| 901 | + * Empty function; submission is handled elsewhere. |
| 902 | + * |
| 903 | + * @return bool false |
| 904 | + */ |
890 | 905 | function trySubmit() { |
891 | 906 | return false; |
892 | 907 | } |
— | — | @@ -893,7 +908,7 @@ |
894 | 909 | } |
895 | 910 | |
896 | 911 | /** |
897 | | - * TODO: DOCUMENT |
| 912 | + * A form field that contains a radio box in the label |
898 | 913 | */ |
899 | 914 | class UploadSourceField extends HTMLTextField { |
900 | 915 | function getLabelHtml() { |
— | — | @@ -921,15 +936,3 @@ |
922 | 937 | } |
923 | 938 | } |
924 | 939 | |
925 | | -/** |
926 | | - * TODO: Document |
927 | | - * TODO: This can be migrated to JS only |
928 | | - */ |
929 | | -class UploadAjaxLicensePreview extends HTMLFormField { |
930 | | - public function getTableRow( $value ) { |
931 | | - return "<tr><td></td><td id=\"mw-license-preview\"></td></tr>\n"; |
932 | | - } |
933 | | - public function getInputHTML( $value ) { |
934 | | - return ''; |
935 | | - } |
936 | | -} |
\ No newline at end of file |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2131,7 +2131,7 @@ |
2132 | 2132 | 'destfilename' => 'Destination filename:', |
2133 | 2133 | 'upload-maxfilesize' => 'Maximum file size: $1', |
2134 | 2134 | 'upload-description' => 'File description', |
2135 | | -'upload-options' => '', # do not translate or duplicate this message to other languages |
| 2135 | +'upload-options' => 'Upload options', |
2136 | 2136 | 'watchthisupload' => 'Watch this file', |
2137 | 2137 | 'filewasdeleted' => 'A file of this name has been previously uploaded and subsequently deleted. |
2138 | 2138 | You should check the $1 before proceeding to upload it again.', |
Index: trunk/phase3/skins/common/upload.js |
— | — | @@ -55,9 +55,26 @@ |
56 | 56 | optionsTable.appendChild( row ); |
57 | 57 | } |
58 | 58 | |
59 | | - // License selector check |
60 | | - document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck; |
| 59 | + if ( wgAjaxLicensePreview ) { |
| 60 | + // License selector check |
| 61 | + document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck; |
61 | 62 | |
| 63 | + // License selector table row |
| 64 | + var wpLicense = document.getElementById( 'wpLicense' ); |
| 65 | + var wpLicenseRow = wpLicense.parentNode.parentNode; |
| 66 | + var wpLicenseTbody = wpLicenseRow.parentNode; |
| 67 | + |
| 68 | + var row = document.createElement( 'tr' ); |
| 69 | + var td = document.createElement( 'td' ); |
| 70 | + row.appendChild( td ); |
| 71 | + td = document.createElement( 'td' ); |
| 72 | + td.id = 'mw-license-preview'; |
| 73 | + row.appendChild( td ); |
| 74 | + |
| 75 | + wpLicenseTbody.insertBefore( row, wpLicenseRow.nextSibling ); |
| 76 | + } |
| 77 | + |
| 78 | + |
62 | 79 | // fillDestFile setup |
63 | 80 | for ( var i = 0; i < wgUploadSourceIds.length; i++ ) |
64 | 81 | document.getElementById( wgUploadSourceIds[i] ).onchange = function (e) { |