Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.min.js |
— | — | @@ -0,0 +1 @@ |
| 2 | +var search=document.getElementById('search');var clearSearch=document.getElementById('clearsearch');initClearSearchLink();function initClearSearchLink(){clearSearch.setAttribute('title','Clear');clearSearch.addEventListener('mousedown',clearSearchBox,true);search.addEventListener('keyup',_handleClearSearchLink,false)}function _handleClearSearchLink(){if(clearSearch){if(search.value.length>0){clearSearch.style.display='block'}else{clearSearch.style.display='none'}}}function clearSearchBox(a){search.value='';clearSearch.style.display='none';if(a){a.preventDefault()}}document.getElementById('logo').onclick=function(){var n=document.getElementById('nav').style;n.display=n.display=='block'?'none':'block'};for(var h=document.getElementsByTagName('h2'),i=0;i<h.length;i++){if(h[i].className=='section_heading'){h[i].onclick=function(){var a=parseInt(this.id.replace(/section_(\d+)/,'$1'));wm_toggle_section(a)}}};for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){a[i].onclick=function(){if(this.hash.indexOf('#')==0){wm_reveal_for_hash(this.hash)}}};if(document.location.hash.indexOf('#')==0){wm_reveal_for_hash(document.location.hash)}updateOrientation();window.scrollTo(0,1);function updateOrientation(){switch(window.orientation){case 0:document.body.setAttribute('class','portrait');break;case 90:case-90:document.body.setAttribute('class','landscape')}}window.onorientationchange=updateOrientation;function wm_reveal_for_hash(a){var b=document.getElementById(a.substr(1));if(b){for(var p=b.parentNode;p&&p.className!='content_block'&&p.className!='section_heading';){p=p.parentNode}if(p&&p.style.display!='block'){var c=parseInt(p.id.split('_')[1]);wm_toggle_section(c)}}}function wm_toggle_section(a){var b=document.getElementById('section_'+a),bb=b.getElementsByTagName('button');for(var i=0;i<=1;i++){var s=bb[i].style;s.display=s.display=='none'||(i&&!s.display)?'inline-block':'none'}for(var i=0,d=['content_','anchor_'];i<=1;i++){var s=document.getElementById(d[i]+a).style;s.display=s.display=='block'?'none':'block'}} |
\ No newline at end of file |
Property changes on: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.min.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -128,6 +128,7 @@ |
129 | 129 | public static $leaveFeedbackURL; |
130 | 130 | public static $mobileRedirectFormAction; |
131 | 131 | public static $isBetaGroupMember = false; |
| 132 | + public static $hideSearchBox = false; |
132 | 133 | |
133 | 134 | public static $messageKeys = array( |
134 | 135 | 'mobile-frontend-show-button', |
— | — | @@ -556,6 +557,12 @@ |
557 | 558 | |
558 | 559 | private function checkUserStatus() { |
559 | 560 | wfProfileIn( __METHOD__ ); |
| 561 | + |
| 562 | + if ( !empty( $_SERVER['HTTP_APPLICATION_VERSION'] ) && |
| 563 | + strpos( $_SERVER['HTTP_APPLICATION_VERSION'], 'Wikipedia Mobile' ) !== false ) { |
| 564 | + self::$hideSearchBox = true; |
| 565 | + } |
| 566 | + |
560 | 567 | $optInCookie = $this->getOptInOutCookie(); |
561 | 568 | if ( !empty( $optInCookie ) && |
562 | 569 | $optInCookie == 1 ) { |
— | — | @@ -1082,6 +1089,9 @@ |
1083 | 1090 | if ( self::$isMainPage ) { |
1084 | 1091 | $contentHtml = $this->DOMParseMainPage( $contentHtml ); |
1085 | 1092 | } |
| 1093 | + |
| 1094 | + $title = htmlspecialchars( self::$title->getText() ); |
| 1095 | + $htmlTitle = htmlspecialchars( self::$htmlTitle ); |
1086 | 1096 | |
1087 | 1097 | if ( strlen( $contentHtml ) > 4000 && $this->contentFormat == 'XHTML' |
1088 | 1098 | && self::$device['supports_javascript'] === true |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/_search_webkit.html.php |
— | — | @@ -8,12 +8,13 @@ |
9 | 9 | $randomButton = self::$messages['mobile-frontend-random-button']; |
10 | 10 | |
11 | 11 | $scriptUrl = wfScript(); |
| 12 | +$searchBoxDisplayNone = ( self::$hideSearchBox ) ? ' style="display: none;" ' : ''; |
12 | 13 | |
13 | 14 | $searchWebkitHtml = <<<EOD |
14 | 15 | <div id='header'> |
15 | 16 | <div id='searchbox'> |
16 | 17 | <img width="35" height="22" alt='Logo' id='logo' src='{$wgMobileFrontendLogo}' /> |
17 | | - <form action='{$scriptUrl}' class='search_bar' method='get'> |
| 18 | + <form action='{$scriptUrl}' class='search_bar' method='get' {$searchBoxDisplayNone}> |
18 | 19 | <input type="hidden" value="Special:Search" name="title" /> |
19 | 20 | <div id="sq" class="divclearable"> |
20 | 21 | <input type="text" name="search" id="search" size="22" value="{$searchField}" /> |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/application.html.php |
— | — | @@ -22,10 +22,11 @@ |
23 | 23 | <head> |
24 | 24 | <title>{$htmlTitle}</title> |
25 | 25 | <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> |
| 26 | + <link href='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/common.css' media='all' rel='Stylesheet' type='text/css' /> |
26 | 27 | <link href='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/{$cssFileName}.css' media='all' rel='Stylesheet' type='text/css' /> |
27 | 28 | <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> |
28 | | - <meta name = "viewport" content = "width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> |
29 | | - ${appleTouchIconTag} |
| 29 | + <meta name = "viewport" content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0," /> |
| 30 | + {$appleTouchIconTag} |
30 | 31 | <script type='text/javascript'> |
31 | 32 | //<![CDATA[ |
32 | 33 | var title = "{$htmlTitle}"; |
— | — | @@ -42,7 +43,7 @@ |
43 | 44 | {$contentHtml} |
44 | 45 | </div> |
45 | 46 | {$footerHtml} |
46 | | - <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js?version=20110920T172820Z"></script> |
| 47 | + <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.min.js?version=20111014T172820Z"></script> |
47 | 48 | </body> |
48 | 49 | </html> |
49 | 50 | EOT; |