Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/opensearch.js |
— | — | @@ -14,6 +14,33 @@ |
15 | 15 | var sq = document.getElementById( 'sq' ); |
16 | 16 | var sb = document.getElementById( 'searchbox' ); |
17 | 17 | |
| 18 | +function hideResults() { |
| 19 | + results.style.display = 'none'; |
| 20 | +} |
| 21 | + |
| 22 | +document.onmousedown = function() { |
| 23 | + whichElement(event); |
| 24 | +} |
| 25 | +results.onmousedown = function() { |
| 26 | + whichElement(event); |
| 27 | +} |
| 28 | + |
| 29 | +function whichElement(e) { |
| 30 | + if (!e) { |
| 31 | + var e = window.event; |
| 32 | + e.target = e.srcElement; |
| 33 | + e.cancelBubble = true; |
| 34 | + } else { |
| 35 | + e.stopPropagation(); |
| 36 | + if (e.target.className == "suggestion-result" || |
| 37 | + e.target.className == "search-result-item" || |
| 38 | + e.target.className == "sq-val-update" ) { |
| 39 | + } else { |
| 40 | + hideResults(); |
| 41 | + } |
| 42 | + } |
| 43 | +} |
| 44 | + |
18 | 45 | function updateSearchWidth() { |
19 | 46 | if ( sq && search && sb && results ) { |
20 | 47 | var iw = ( document.documentElement.clientWidth ) ? document.documentElement.clientWidth : document.body.clientWidth; |
— | — | @@ -108,7 +135,7 @@ |
109 | 136 | var section = sections[i]; |
110 | 137 | var rel = i + 1; |
111 | 138 | section.value = section.value.replace( /^(?:\/\/|[^\/]+)*\//, '/' ); |
112 | | - html = html + "<div class=\"suggestions-result\" rel=\"" + rel + "\" title=\"" + section.label + "\"><a href='" + section.value + "'>" + section.label + "</a><a class=\"sq-val-update\" href=\"javascript:sqValUpdate('" + section.label + "');\"> + </a></div>"; |
| 139 | + html = html + "<div class=\"suggestions-result\" rel=\"" + rel + "\" title=\"" + section.label + "\"><a class=\"search-result-item\" href='" + section.value + "'>" + section.label + "</a><a class=\"sq-val-update\" href=\"javascript:sqValUpdate('" + section.label + "');\"> + </a></div>"; |
113 | 140 | if ( i < ( sections.length - 1 ) ) { |
114 | 141 | html = html + '<hr />'; |
115 | 142 | } |
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/application.html.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | $endScriptTag = '"></script>'; |
20 | 20 | $javaScriptPath = $wgExtensionAssetsPath . '/MobileFrontend/javascripts/'; |
21 | 21 | |
22 | | -$openSearchScript = ( self::$isBetaGroupMember ) ? $startScriptTag . $javaScriptPath . 'opensearch.js?version=10282011121527' . $endScriptTag : ''; |
| 22 | +$openSearchScript = ( self::$isBetaGroupMember ) ? $startScriptTag . $javaScriptPath . 'opensearch.js?version=10282011124424' . $endScriptTag : ''; |
23 | 23 | |
24 | 24 | $applicationHtml = <<<EOT |
25 | 25 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |