Permalink
Browse files

Added Patch file needed to make MF work with app

  • Loading branch information...
1 parent e2ffcf7 commit e790c5658f32c09724f242825139d17b2973860e @yuvipanda committed Apr 3, 2012
Showing with 37 additions and 0 deletions.
  1. +37 −0 mf-to-app.patch
View
@@ -0,0 +1,37 @@
+diff --git a/javascripts/application.js b/javascripts/application.js
+index c20aa16..51d9324 100644
+--- a/javascripts/application.js
++++ b/javascripts/application.js
+@@ -4,7 +4,7 @@ MobileFrontend = (function() {
+ var utilities;
+
+ function message( name ) {
+- return mwMobileFrontendConfig.messages[name] || '';
++ return mw.message( name );
+ }
+
+ function init() {
+diff --git a/javascripts/toggle.js b/javascripts/toggle.js
+index 19d0b72..c2f07ac 100644
+--- a/javascripts/toggle.js
++++ b/javascripts/toggle.js
+@@ -7,18 +7,7 @@ MobileFrontend.toggle = (function() {
+ var i, a, heading, h2, btns = [], buttons,
+ sectionHeadings = [];
+
+- h2 = document.getElementsByTagName( 'H2' );
+- for( i = 0; i < h2.length; i++) {
+- heading = h2[i];
+- if( u( heading ).hasClass( 'section_heading') ) {
+- sectionHeadings.push( heading );
+- // TODO: remove in future
+- buttons = heading.getElementsByTagName( 'button' );
+- for( a = 0; a < buttons.length; a++ ) {
+- btns.push( buttons[a] );
+- }
+- }
+- }
++ sectionHeadings = document.getElementsByClassName( 'section_heading' );
+
+ // TODO: remove in future - currently enables toggling in Wikipedia Mobile App v < 1.1
+ window.wm_toggle_section = wm_toggle_section;

0 comments on commit e790c56

Please sign in to comment.