Index: trunk/phase3/skins/common/mwsuggest.js |
— | — | @@ -112,6 +112,11 @@ |
113 | 113 | /** Init Result objects and event handlers */ |
114 | 114 | function os_initHandlers( name, formname, element ) { |
115 | 115 | var r = new os_Results( name, formname ); |
| 116 | + var formElement = document.getElementById( formname ); |
| 117 | + if( !formElement ) { |
| 118 | + // Older browsers (Opera 8) cannot get form elements |
| 119 | + return; |
| 120 | + } |
116 | 121 | // event handler |
117 | 122 | os_hookEvent( element, 'keyup', function( event ) { os_eventKeyup( event ); } ); |
118 | 123 | os_hookEvent( element, 'keydown', function( event ) { os_eventKeydown( event ); } ); |
— | — | @@ -126,7 +131,7 @@ |
127 | 132 | element.setAttribute( 'autocomplete', 'off' ); |
128 | 133 | } |
129 | 134 | // stopping handler |
130 | | - os_hookEvent( document.getElementById( formname ), 'submit', function( event ) { return os_eventOnsubmit( event ); } ); |
| 135 | + os_hookEvent( formElement, 'submit', function( event ) { return os_eventOnsubmit( event ); } ); |
131 | 136 | os_map[name] = r; |
132 | 137 | // toggle link |
133 | 138 | if( document.getElementById( r.toggle ) == null ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | variable {{REVISIONMONTH1}} when unpadded version is needed. |
167 | 167 | * Special:Userrights didn't recognize user as changing his/her own rights if user did not capitalize first letter of username. |
168 | 168 | * (bug 23507) Add styles for printing wikitables |
| 169 | +* (bug 19586) Avoid JS errors in mwsuggest when using old browsers such as Opera 8. |
169 | 170 | |
170 | 171 | === API changes in 1.17 === |
171 | 172 | * (bug 22738) Allow filtering by action type on query=logevent |