Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.js |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | function initClearSearchLink() { |
10 | 10 | clearSearch.setAttribute( 'title','Clear' ); |
11 | 11 | clearSearch.addEventListener( 'mousedown', clearSearchBox, true ); |
12 | | - search.addEventListener( 'keyup', _handleClearSearchLink, false ); |
| 12 | + search.addEventListener( 'keyup', handleClearSearchLink, false ); |
13 | 13 | } |
14 | 14 | |
15 | 15 | function navigateToLanguageSelection() { |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | | -function _handleClearSearchLink() { |
| 25 | +function handleClearSearchLink() { |
26 | 26 | if ( clearSearch ) { |
27 | 27 | if ( search.value.length > 0 ) { |
28 | 28 | clearSearch.style.display = 'block'; |
— | — | @@ -58,16 +58,6 @@ |
59 | 59 | } |
60 | 60 | }; |
61 | 61 | |
62 | | -// Also problematic, not working until the page loads... |
63 | | -for( var h = document.getElementsByTagName( 'h2' ), i = 0; i < h.length; i++ ) { |
64 | | - if ( h[i].className == 'section_heading' ) { |
65 | | - h[i].onclick = function() { |
66 | | - var section_idx = parseInt( this.id.replace( /section_(\d+)/, '$1' ) ); |
67 | | - wm_toggle_section( section_idx ); |
68 | | - } |
69 | | - } |
70 | | -}; |
71 | | - |
72 | 62 | // And this... |
73 | 63 | for ( var a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) { |
74 | 64 | a[i].onclick = function() { |
— | — | @@ -75,7 +65,7 @@ |
76 | 66 | wm_reveal_for_hash( this.hash ); |
77 | 67 | } |
78 | 68 | } |
79 | | -}; |
| 69 | +} |
80 | 70 | |
81 | 71 | if ( document.location.hash.indexOf( '#' ) == 0 ) { |
82 | 72 | wm_reveal_for_hash( document.location.hash ); |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -863,17 +863,25 @@ |
864 | 864 | Html::closeElement( 'div' ); |
865 | 865 | // generate the HTML we are going to inject |
866 | 866 | $buttons = Html::element( 'button', |
867 | | - array( 'class' => 'section_heading show', |
868 | | - 'section_id' => $headings ), |
869 | | - $show ) . |
870 | | - Html::element( 'button', |
871 | | - array( 'class' => 'section_heading hide', |
872 | | - 'section_id' => $headings ), |
873 | | - $hide ); |
874 | | - $base .= Html::openElement( 'h2', |
875 | | - array( 'class' => 'section_heading', |
876 | | - 'id' => 'section_' . $headings ) ) . |
877 | | - $buttons . |
| 867 | + array( 'class' => 'section_heading show', |
| 868 | + 'section_id' => $headings ), |
| 869 | + $show ) . |
| 870 | + Html::element( 'button', |
| 871 | + array( 'class' => 'section_heading hide', |
| 872 | + 'section_id' => $headings ), |
| 873 | + $hide ); |
| 874 | + if ( self::$device['supports_javascript'] ) { |
| 875 | + $h2OnClick = 'javascript:wm_toggle_section(' . $headings . ');'; |
| 876 | + $base .= Html::openElement( 'h2', |
| 877 | + array( 'class' => 'section_heading', |
| 878 | + 'id' => 'section_' . $headings, |
| 879 | + 'onclick' => $h2OnClick ) ); |
| 880 | + } else { |
| 881 | + $base .= Html::openElement( 'h2', |
| 882 | + array( 'class' => 'section_heading', |
| 883 | + 'id' => 'section_' . $headings ) ); |
| 884 | + } |
| 885 | + $base .= $buttons . |
878 | 886 | Html::rawElement( 'span', |
879 | 887 | array( 'id' => $headlineId ), |
880 | 888 | $matches[2] ) . |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/_search_webkit.html.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | $languageSelectionText = '<b>' . self::$messages['mobile-frontend-language'] . ':</b><br/>'; |
18 | 18 | $languageSelectionDiv = ( self::$isBetaGroupMember ) ? '<div id="languageselectionsection">' . $languageSelectionText . $languageSelection . '</div>' : ''; |
19 | 19 | |
20 | | -$logoOnClick = (self::$device['supports_javascript']) ? 'onclick="javascript:logoClick();"' : ''; |
| 20 | +$logoOnClick = ( self::$device['supports_javascript'] ) ? 'onclick="javascript:logoClick();"' : ''; |
21 | 21 | |
22 | 22 | $searchWebkitHtml = <<<EOD |
23 | 23 | <div id='header'> |