r112122 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112121‎ | r112122 | r112123 >
Date:17:41, 22 February 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
do not run javascript on any browser < IE 10

currently the mobile site breaks on various versions of
Internet Explorer. This is due to lack of support of things
such as addEventListener, getElementsByClassName, document.querySelector
and XMLHttpRequest

It is feasible that certain people in low bandwidth countries may be using
legacy browsers to access the mobile site of mediawiki instances. We shouldn't
break the site for these people and at least give them a non-javascript version in
the meantime and fix this as demand requires.
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /trunk/extensions/MobileFrontend/javascripts/beta_application.js (modified) (history)
  • /trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/beta_application.js
@@ -212,11 +212,7 @@
213213 }
214214
215215 function bind( type, handler ) {
216 - if ( el.addEventListener ) { // standardised browser
217 - el.addEventListener( type, handler, false );
218 - } else if( el.attachEvent ) {
219 - el.attachEvent( 'on' + type, handler );
220 - }
 216+ el.addEventListener( type, handler, false );
221217 }
222218 return {
223219 addClass: addClass,
Index: trunk/extensions/MobileFrontend/javascripts/application.js
@@ -200,11 +200,7 @@
201201 }
202202
203203 function bind( type, handler ) {
204 - if ( el.addEventListener ) { // standardised browser
205 - el.addEventListener( type, handler, false );
206 - } else if( el.attachEvent ) {
207 - el.attachEvent( 'on' + type, handler );
208 - }
 204+ el.addEventListener( type, handler, false );
209205 }
210206 return {
211207 addClass: addClass,
Index: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php
@@ -71,9 +71,11 @@
7272 {$this->data['contentHtml']}
7373 </div>
7474 {$this->data['footerHtml']}
 75+ <!--[if gt IE 9]><!-->
7576 {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.js?version=01132011120915{$endScriptTag}
7677 {$openSearchScript}
7778 {$filePageScript}
 79+ <!--[endif]-->
7880 </body>
7981 </html>
8082 HTML;

Status & tagging log