Index: trunk/phase3/skins/common/upload.js |
— | — | @@ -8,9 +8,7 @@ |
9 | 9 | } |
10 | 10 | } |
11 | 11 | // We might show a preview |
12 | | - if( wgAjaxLicensePreview ) { |
13 | | - wgUploadLicenseObj.fetchPreview( selection ); |
14 | | - } |
| 12 | + wgUploadLicenseObj.fetchPreview( selection ); |
15 | 13 | } |
16 | 14 | |
17 | 15 | function licenseSelectorFixup() { |
— | — | @@ -36,6 +34,8 @@ |
37 | 35 | 'timeoutID': false, |
38 | 36 | |
39 | 37 | 'keypress': function () { |
| 38 | + if ( !wgAjaxUploadDestCheck || !sajax_init_object() ) return; |
| 39 | + |
40 | 40 | // Find file to upload |
41 | 41 | var destFile = document.getElementById('wpDestFile'); |
42 | 42 | var warningElt = document.getElementById( 'wpDestFile-warning' ); |
— | — | @@ -48,15 +48,18 @@ |
49 | 49 | window.clearTimeout( this.timeoutID ); |
50 | 50 | } |
51 | 51 | // Check response cache |
52 | | - if ( this.nameToCheck in this.responseCache ) { |
53 | | - this.setWarning(this.responseCache[this.nameToCheck]); |
54 | | - return; |
| 52 | + for (cached in this.responseCache) { |
| 53 | + if (this.nameToCheck == cached) { |
| 54 | + this.setWarning(this.responseCache[this.nameToCheck]); |
| 55 | + return; |
| 56 | + } |
55 | 57 | } |
56 | 58 | |
57 | 59 | this.timeoutID = window.setTimeout( 'wgUploadWarningObj.timeout()', this.delay ); |
58 | 60 | }, |
59 | 61 | |
60 | 62 | 'checkNow': function (fname) { |
| 63 | + if ( !wgAjaxUploadDestCheck || !sajax_init_object() ) return; |
61 | 64 | if ( this.timeoutID ) { |
62 | 65 | window.clearTimeout( this.timeoutID ); |
63 | 66 | } |
— | — | @@ -65,6 +68,7 @@ |
66 | 69 | }, |
67 | 70 | |
68 | 71 | 'timeout' : function() { |
| 72 | + if ( !wgAjaxUploadDestCheck || !sajax_init_object() ) return; |
69 | 73 | injectSpinner( document.getElementById( 'wpDestFile' ), 'destcheck' ); |
70 | 74 | |
71 | 75 | // Get variables into local scope so that they will be preserved for the |
— | — | @@ -131,9 +135,7 @@ |
132 | 136 | var destFile = document.getElementById('wpDestFile'); |
133 | 137 | if (destFile) { |
134 | 138 | destFile.value = fname; |
135 | | - if ( wgAjaxUploadDestCheck ) { |
136 | | - wgUploadWarningObj.checkNow(fname) ; |
137 | | - } |
| 139 | + wgUploadWarningObj.checkNow(fname) ; |
138 | 140 | } |
139 | 141 | } |
140 | 142 | |
— | — | @@ -142,18 +144,19 @@ |
143 | 145 | 'responseCache' : { '' : '' }, |
144 | 146 | |
145 | 147 | 'fetchPreview': function( license ) { |
146 | | - if( license == "" ) { |
147 | | - this.showPreview( "" ); |
148 | | - } else if( license in this.responseCache ) { |
149 | | - this.showPreview( this.responseCache[license] ); |
150 | | - } else { |
151 | | - injectSpinner( document.getElementById( 'wpLicense' ), 'license' ); |
152 | | - sajax_do_call( 'UploadForm::ajaxGetLicensePreview', [license], |
153 | | - function( result ) { |
154 | | - wgUploadLicenseObj.processResult( result, license ); |
155 | | - } |
156 | | - ); |
| 148 | + if( !wgAjaxLicensePreview || !sajax_init_object() ) return; |
| 149 | + for (cached in this.responseCache) { |
| 150 | + if (cached == license) { |
| 151 | + this.showPreview( this.responseCache[license] ); |
| 152 | + return; |
| 153 | + } |
157 | 154 | } |
| 155 | + injectSpinner( document.getElementById( 'wpLicense' ), 'license' ); |
| 156 | + sajax_do_call( 'UploadForm::ajaxGetLicensePreview', [license], |
| 157 | + function( result ) { |
| 158 | + wgUploadLicenseObj.processResult( result, license ); |
| 159 | + } |
| 160 | + ); |
158 | 161 | }, |
159 | 162 | |
160 | 163 | 'processResult' : function( result, license ) { |
Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -725,7 +725,9 @@ |
726 | 726 | var cb = inputs[i]; |
727 | 727 | if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) |
728 | 728 | continue; |
729 | | - cb.index = checkboxes.push(cb) - 1; |
| 729 | + var end = checkboxes.length; |
| 730 | + checkboxes[end] = cb; |
| 731 | + cb.index = end; |
730 | 732 | cb.onmouseup = checkboxMouseupHandler; |
731 | 733 | } |
732 | 734 | |
— | — | @@ -890,11 +892,13 @@ |
891 | 893 | var arrRegExpClassNames = new Array(); |
892 | 894 | if(typeof oClassNames == "object"){ |
893 | 895 | for(var i=0; i<oClassNames.length; i++){ |
894 | | - arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)")); |
| 896 | + arrRegExpClassNames[arrRegExpClassNames.length] = |
| 897 | + new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"); |
895 | 898 | } |
896 | 899 | } |
897 | 900 | else{ |
898 | | - arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)")); |
| 901 | + arrRegExpClassNames[arrRegExpClassNames.length] = |
| 902 | + new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"); |
899 | 903 | } |
900 | 904 | var oElement; |
901 | 905 | var bMatchesAll; |
— | — | @@ -908,7 +912,7 @@ |
909 | 913 | } |
910 | 914 | } |
911 | 915 | if(bMatchesAll){ |
912 | | - arrReturnElements.push(oElement); |
| 916 | + arrReturnElements[arrReturnElements.length] = oElement; |
913 | 917 | } |
914 | 918 | } |
915 | 919 | return (arrReturnElements) |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1201,7 +1201,7 @@ |
1202 | 1202 | * to ensure that client-side caches don't keep obsolete copies of global |
1203 | 1203 | * styles. |
1204 | 1204 | */ |
1205 | | -$wgStyleVersion = '87'; |
| 1205 | +$wgStyleVersion = '88'; |
1206 | 1206 | |
1207 | 1207 | |
1208 | 1208 | # Server-side caching: |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -313,6 +313,7 @@ |
314 | 314 | * (bug 8054) Return search page for empty search requests with ugly URLs |
315 | 315 | * (bug 10572) Force refresh after clearing visitation timestamps on watchlist |
316 | 316 | * (bug 10631) Warn when illegal characters are removed from filename at upload |
| 317 | +* Fix several JavaScript bugs under MSIE 5/Macintosh |
317 | 318 | |
318 | 319 | == API changes since 1.10 == |
319 | 320 | |