Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/DeviceDetection.php |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | 'footmenu' => 'default', |
156 | 156 | 'with_layout' => 'application', |
157 | 157 | 'css_file_name' => 'blackberry', |
158 | | - 'supports_javascript' => true, |
| 158 | + 'supports_javascript' => false, |
159 | 159 | 'disable_zoom' => true, |
160 | 160 | 'parser' => 'html', |
161 | 161 | 'disable_links' => true, |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.js |
— | — | @@ -1,49 +1,45 @@ |
2 | | -// Ideally, this would be loaded in the head and activated by a script at the bottom, |
3 | | -// I think, rather than attached to an onload... |
4 | | -window.onload = function() { |
5 | | - // I don't think this makes sense. Loading this here means that this button |
6 | | - // won't function until the page is loaded. It would probably be an |
7 | | - // improvement to just attach an onclick straight into the html. |
8 | | - document.getElementById( 'logo' ).onclick = function() { |
9 | | - var n = document.getElementById( 'nav' ).style; |
10 | | - n.display = n.display == 'block' ? 'none' : 'block'; |
11 | | - }; |
| 2 | +// I don't think this makes sense. Loading this here means that this button |
| 3 | +// won't function until the page is loaded. It would probably be an |
| 4 | +// improvement to just attach an onclick straight into the html. |
| 5 | +document.getElementById( 'logo' ).onclick = function() { |
| 6 | + var n = document.getElementById( 'nav' ).style; |
| 7 | + n.display = n.display == 'block' ? 'none' : 'block'; |
| 8 | +}; |
12 | 9 | |
13 | | - // Also problematic, not working until the page loads... |
14 | | - for( var h = document.getElementsByTagName( 'h2' ), i = 0; i < h.length; i++ ) { |
15 | | - if ( h[i].className == 'section_heading' ) { |
16 | | - h[i].onclick = function() { |
17 | | - var section_idx = parseInt( this.id.replace( /section_(\d+)/, '$1' ) ); |
18 | | - wm_toggle_section( section_idx ); |
19 | | - } |
| 10 | +// Also problematic, not working until the page loads... |
| 11 | +for( var h = document.getElementsByTagName( 'h2' ), i = 0; i < h.length; i++ ) { |
| 12 | + if ( h[i].className == 'section_heading' ) { |
| 13 | + h[i].onclick = function() { |
| 14 | + var section_idx = parseInt( this.id.replace( /section_(\d+)/, '$1' ) ); |
| 15 | + wm_toggle_section( section_idx ); |
20 | 16 | } |
21 | | - }; |
| 17 | + } |
| 18 | +}; |
22 | 19 | |
23 | | - // And this... |
24 | | - for ( var a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) { |
25 | | - a[i].onclick = function() { |
26 | | - if ( this.hash.indexOf( '#' ) == 0 ) { |
27 | | - wm_reveal_for_hash( this.hash ); |
28 | | - } |
| 20 | +// And this... |
| 21 | +for ( var a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) { |
| 22 | + a[i].onclick = function() { |
| 23 | + if ( this.hash.indexOf( '#' ) == 0 ) { |
| 24 | + wm_reveal_for_hash( this.hash ); |
29 | 25 | } |
30 | | - }; |
31 | | - |
32 | | - if ( document.location.hash.indexOf( '#' ) == 0 ) { |
33 | | - wm_reveal_for_hash( document.location.hash ); |
34 | 26 | } |
| 27 | +}; |
35 | 28 | |
36 | | - updateOrientation(); |
| 29 | +if ( document.location.hash.indexOf( '#' ) == 0 ) { |
| 30 | + wm_reveal_for_hash( document.location.hash ); |
| 31 | +} |
37 | 32 | |
38 | | - // Try to scroll and hide URL bar |
39 | | - window.scrollTo( 0, 1 ); |
| 33 | +updateOrientation(); |
40 | 34 | |
41 | | - // This is a global. I don't know why. |
42 | | - decode = document.getElementById( 'searchField' ); |
43 | | - decode.value = unescape( decode.value ); |
44 | | - decode = document.getElementsByTagName( 'title' )[0]; |
45 | | - decode.innerHTML = unescape( decode.innerHTML ); |
46 | | -}; |
| 35 | +// Try to scroll and hide URL bar |
| 36 | +window.scrollTo( 0, 1 ); |
47 | 37 | |
| 38 | +// This is a global. I don't know why. |
| 39 | +decode = document.getElementById( 'searchField' ); |
| 40 | +decode.value = unescape( decode.value ); |
| 41 | +decode = document.getElementsByTagName( 'title' )[0]; |
| 42 | +decode.innerHTML = unescape( decode.innerHTML ); |
| 43 | + |
48 | 44 | /** |
49 | 45 | * updateOrientation checks the current orientation, sets the body's class |
50 | 46 | * attribute to portrait, landscapeLeft, or landscapeRight, |
— | — | @@ -87,4 +83,4 @@ |
88 | 84 | var s = document.getElementById( d[i] + section_id ).style; |
89 | 85 | s.display = s.display == 'block' ? 'none' : 'block'; |
90 | 86 | } |
91 | | -} |
\ No newline at end of file |
| 87 | +} |
Property changes on: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
92 | 88 | Merged /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php:r97563,97592 |
93 | 89 | Merged /trunk/extensions/MobileFrontend/MobileFrontend.php:r97556 |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/application.html.php |
— | — | @@ -34,7 +34,6 @@ |
35 | 35 | } |
36 | 36 | //]]> |
37 | 37 | </script> |
38 | | - <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js?version=20110912T172820Z"></script> |
39 | 38 | </head> |
40 | 39 | <body> |
41 | 40 | {$searchWebkitHtml} |
— | — | @@ -43,6 +42,7 @@ |
44 | 43 | {$contentHtml} |
45 | 44 | </div> |
46 | 45 | {$footerHtml} |
| 46 | + <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js?version=20110919T172820Z"></script> |
47 | 47 | </body> |
48 | 48 | </html> |
49 | 49 | EOT; |
Property changes on: branches/wmf/1.18wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
50 | 50 | Merged /branches/wmf/1.17wmf1/extensions/MobileFrontend:r97563,97592 |
51 | 51 | Merged /trunk/extensions/MobileFrontend:r97556 |