Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js |
— | — | @@ -1,3 +1,5 @@ |
| 2 | +var showText = "show", hideText = "hide"; |
| 3 | + |
2 | 4 | window.MobileFrontendTests = { |
3 | 5 | cleanFixtures: function() { |
4 | 6 | // note the ZeroRatedMobileAccess extension attaches a banner to the qunit test suite |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js |
— | — | @@ -3,18 +3,13 @@ |
4 | 4 | MobileFrontend.opensearch = (function() { |
5 | 5 | var apiUrl = '/api.php', timer = -1, typingDelay = 500, |
6 | 6 | numResults = 15, term, |
7 | | - results = document.getElementById( 'results' ), |
8 | 7 | search = document.getElementById( 'search' ), |
9 | 8 | sq = document.getElementById( 'sq' ), |
10 | 9 | sb = document.getElementById( 'searchbox' ), |
11 | | - logo = document.getElementById( 'logo' ), |
12 | | - goButton = document.getElementById( 'goButton' ), |
13 | 10 | content = document.getElementById( 'content' ), |
14 | 11 | footer = document.getElementById( 'footer' ), |
15 | | - zeroRatedBanner = document.getElementById( 'zero-rated-banner' ) || |
16 | | - document.getElementById( 'zero-rated-banner-red' ), |
17 | 12 | clearSearch = document.getElementById( 'clearsearch' ), |
18 | | - focused = false, ol = {}, |
| 13 | + focused = false, |
19 | 14 | u = MobileFrontend.utils; |
20 | 15 | |
21 | 16 | if ( scriptPath ) { |
— | — | @@ -40,8 +35,7 @@ |
41 | 36 | resetViewPort(); |
42 | 37 | |
43 | 38 | search.onfocus = function() { |
44 | | - var pE, pT, pTT, rrd, rrdD, |
45 | | - removeResultsEl; |
| 39 | + var rrd, rrdD; |
46 | 40 | sb = document.getElementById( 'searchbox' ); |
47 | 41 | sq = document.getElementById( 'sq' ); |
48 | 42 | content = document.getElementById( 'content' ); |
— | — | @@ -51,25 +45,8 @@ |
52 | 46 | if ( !focused ) { |
53 | 47 | MobileFrontend.utils( document.body ).addClass( 'full-screen-search' ); |
54 | 48 | |
55 | | - pE = document.getElementById( 'placeholder' ); |
56 | | - if ( !pE ) { |
57 | | - pT = document.createElement( 'span' ); |
58 | | - pTT = document.createTextNode(placeholder); |
59 | | - pT.setAttribute( 'id', 'placeholder' ); |
60 | | - pT.appendChild(pTT); |
61 | | - sb.insertBefore( pT, sb.firstChild ); |
62 | | - } |
63 | | - pE = document.getElementById( 'placeholder' ); |
64 | | - if ( pE ) { |
65 | | - pE.style.display = 'block'; |
66 | | - } |
67 | | - |
68 | | - if ( pE && search.value !== '' ) { |
69 | | - pE.style.display = 'none'; |
70 | | - } |
71 | | - |
72 | | - removeResultsEl = document.getElementById( 'remove-results' ); |
73 | | - if ( !removeResultsEl ) { |
| 49 | + rrd = document.getElementById( 'remove-results' ); |
| 50 | + if ( !rrd ) { |
74 | 51 | rrd = document.createElement( 'a' ); |
75 | 52 | rrd.setAttribute( 'href', '#' ); |
76 | 53 | rrd.setAttribute( 'id', 'remove-results' ); |
— | — | @@ -85,12 +62,7 @@ |
86 | 63 | |
87 | 64 | function removeResults() { |
88 | 65 | MobileFrontend.utils( document.body ).removeClass( 'full-screen-search' ); |
89 | | - var removeResultsEl, pE = document.getElementById( 'placeholder' ); |
90 | 66 | |
91 | | - if ( pE ) { |
92 | | - pE.style.display = 'none'; |
93 | | - } |
94 | | - |
95 | 67 | if ( focused ) { |
96 | 68 | focused = false; |
97 | 69 | } |
— | — | @@ -182,8 +154,8 @@ |
183 | 155 | } |
184 | 156 | |
185 | 157 | function htmlEntities( str ) { |
186 | | - var text = document.createTextNode( str ); |
187 | | - var el = document.createElement( 'div' ); |
| 158 | + var text = document.createTextNode( str ), |
| 159 | + el = document.createElement( 'div' ); |
188 | 160 | el.appendChild( text ); |
189 | 161 | return el.innerHTML; |
190 | 162 | } |
— | — | @@ -202,12 +174,12 @@ |
203 | 175 | search.focus(); |
204 | 176 | } |
205 | 177 | if ( !sections || sections.length < 1 ) { |
206 | | - results.innerHTML = "<div class=\"suggestions-results\" title=\"No Results\">No Results</div>"; |
| 178 | + results.innerHTML = '<ul class="suggestions-results" title="No Results"><li class="suggestions-result">No Results</li></div>'; |
207 | 179 | } else { |
208 | 180 | if( results.firstChild ) { |
209 | 181 | results.removeChild( results.firstChild ); |
210 | 182 | } |
211 | | - suggestions = document.createElement( 'div' ); |
| 183 | + suggestions = document.createElement( 'ul' ); |
212 | 184 | suggestions.className = 'suggestions-results'; |
213 | 185 | results.appendChild( suggestions ); |
214 | 186 | suggestionListener = function() { |
— | — | @@ -217,7 +189,7 @@ |
218 | 190 | |
219 | 191 | for ( i = 0; i < sections.length; i++ ) { |
220 | 192 | section = sections[i]; |
221 | | - suggestionsResult = document.createElement( 'div' ); |
| 193 | + suggestionsResult = document.createElement( 'li' ); |
222 | 194 | link = document.createElement( 'a' ); |
223 | 195 | suggestionsResult.setAttribute( 'title', section.label ); |
224 | 196 | suggestionsResult.className = 'suggestions-result'; |
— | — | @@ -244,17 +216,9 @@ |
245 | 217 | } |
246 | 218 | } |
247 | 219 | |
248 | | - function handleDefaultText() { |
249 | | - var pE = document.getElementById( 'placeholder' ); |
250 | | - if ( pE ) { |
251 | | - pE.style.display = 'none'; |
252 | | - } |
253 | | - } |
254 | | - |
255 | 220 | function initClearSearch() { |
256 | 221 | var clearSearch = document.getElementById( 'clearsearch' ), |
257 | | - search = document.getElementById( 'search' ), |
258 | | - results = document.getElementById( 'results' ); |
| 222 | + search = document.getElementById( 'search' ); |
259 | 223 | function handleClearSearchLink() { |
260 | 224 | if ( clearSearch ) { |
261 | 225 | if ( search.value.length > 0 ) { |
— | — | @@ -278,7 +242,6 @@ |
279 | 243 | } |
280 | 244 | u( clearSearch ).bind( 'mousedown', clearSearchBox ); |
281 | 245 | u( search ).bind( 'keyup', handleClearSearchLink ); |
282 | | - u( search ).bind( 'keydown', handleDefaultText ); |
283 | 246 | u( search ).bind( 'click', onFocusHandler ); |
284 | 247 | } |
285 | 248 | |
— | — | @@ -288,7 +251,6 @@ |
289 | 252 | document.body.onmousedown = whichElement; |
290 | 253 | document.body.ontouchstart = whichElement; |
291 | 254 | results.ontouchstart = whichElement; |
292 | | - search.onpaste = handleDefaultText; |
293 | 255 | } |
294 | 256 | init(); |
295 | 257 | initClearSearch(); |
— | — | @@ -301,4 +263,4 @@ |
302 | 264 | removeResults: removeResults |
303 | 265 | }; |
304 | 266 | |
305 | | -}()); |
\ No newline at end of file |
| 267 | +}()); |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | html, |
3 | | -body { |
4 | | - margin: 0; |
5 | | - padding: 0; |
6 | | - height: 100%; |
| 3 | +body { |
| 4 | + margin: 0; |
| 5 | + padding: 0; |
| 6 | + height: 100%; |
7 | 7 | } |
8 | 8 | |
9 | 9 | html { |
— | — | @@ -106,38 +106,16 @@ |
107 | 107 | text-align: center; |
108 | 108 | } |
109 | 109 | |
110 | | -.suggestions-results { |
111 | | - font-size: 1.4em; |
112 | | - cursor: pointer; |
113 | | - margin: 0; |
114 | | - padding: 0; |
115 | | -} |
116 | | - |
117 | | -.suggestions-results hr { |
118 | | - margin: 0; |
119 | | -} |
120 | | - |
121 | | -.suggestions-result { |
122 | | - color: black; |
123 | | - margin: 0; |
124 | | - line-height: 2.6em; |
125 | | - padding: 0.01em 0.25em; |
126 | | - postion: relative; |
127 | | - border-bottom: solid 1px #999999; |
128 | | -} |
129 | | - |
130 | 110 | .suggestions-result a { |
131 | 111 | text-decoration: none; |
132 | 112 | color: #666; |
133 | 113 | } |
134 | | -.suggestions-result a:link { |
135 | | - text-decoration: none; |
136 | | - color:#666; |
137 | | -} |
| 114 | + |
138 | 115 | .suggestions-result a:visited { |
139 | 116 | text-decoration: none; |
140 | 117 | color:#666; |
141 | 118 | } |
| 119 | + |
142 | 120 | .suggestions-result a:hover { |
143 | 121 | text-decoration: none; |
144 | 122 | color:#666; |
— | — | @@ -146,9 +124,11 @@ |
147 | 125 | text-decoration: none; |
148 | 126 | color:#666; |
149 | 127 | } |
| 128 | + |
150 | 129 | .suggestions-result:hover { |
151 | 130 | background-color: #ACD1E9; |
152 | 131 | } |
| 132 | + |
153 | 133 | a.sq-val-update { |
154 | 134 | font-size: 1.3em; |
155 | 135 | display: block; |
— | — | @@ -160,15 +140,15 @@ |
161 | 141 | width: 1.5em; |
162 | 142 | text-align: center; |
163 | 143 | } |
164 | | -a.sq-val-update:link { |
165 | | - text-decoration: none; |
166 | | -} |
| 144 | + |
167 | 145 | a.sq-val-update:visited { |
168 | 146 | text-decoration: none; |
169 | 147 | } |
| 148 | + |
170 | 149 | a.sq-val-update:hover { |
171 | 150 | text-decoration: none; |
172 | 151 | } |
| 152 | + |
173 | 153 | a.sq-val-update:active { |
174 | 154 | text-decoration: none; |
175 | 155 | } |
— | — | @@ -785,11 +765,19 @@ |
786 | 766 | position: relative; |
787 | 767 | border-bottom: solid 1px #999; |
788 | 768 | font-size: 1.4em; |
| 769 | + cursor: pointer; |
| 770 | + margin: 0; |
789 | 771 | } |
790 | 772 | |
791 | 773 | .full-screen-search .suggestions-result { |
792 | 774 | line-height: 2.6em; |
793 | 775 | border: none; |
| 776 | + color: black; |
| 777 | + margin: 0; |
| 778 | + line-height: 2.6em; |
| 779 | + padding: 0.01em 0.25em; |
| 780 | + position: relative; |
| 781 | + border-bottom: solid 1px #999999; |
794 | 782 | } |
795 | 783 | |
796 | 784 | .full-screen-search .suggestions-result a:visited { |
— | — | @@ -841,13 +829,3 @@ |
842 | 830 | .full-screen-search #nav { |
843 | 831 | display: none !important; |
844 | 832 | } |
845 | | - |
846 | | -#placeholder { |
847 | | - position: absolute; |
848 | | - left: 38px; |
849 | | - z-index: 2; |
850 | | - top: 0; |
851 | | - color: #666; |
852 | | - font-size: 16px; |
853 | | - padding-top: 10px; |
854 | | -} |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php |
— | — | @@ -54,14 +54,13 @@ |
55 | 55 | <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' /> |
56 | 56 | <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' /> |
57 | 57 | {$filePageStyle} |
58 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 58 | + <meta name="viewport" content="max-width=device-width, initial-scale=1.0"> |
59 | 59 | {$appleTouchIconTag} |
60 | 60 | {$jQueryScript} |
61 | 61 | <script type='text/javascript'> |
62 | 62 | //<![CDATA[ |
63 | 63 | var title = "{$this->data['htmlTitle']}"; |
64 | 64 | var scriptPath = "{$this->data['wgScriptPath']}"; |
65 | | - var placeholder = "{$this->data['placeholder']}"; |
66 | 65 | var showText = "{$buttonShowText}"; |
67 | 66 | var hideText = "{$buttonHideText}"; |
68 | 67 | //]]> |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php |
— | — | @@ -14,6 +14,8 @@ |
15 | 15 | $homeButton = $this->data['messages']['mobile-frontend-home-button']; |
16 | 16 | $randomButton = $this->data['messages']['mobile-frontend-random-button']; |
17 | 17 | $clearText = htmlentities( $this->data['messages']['mobile-frontend-clear-search'], ENT_QUOTES ); |
| 18 | + $searchValue = $this->data['messages']['mobile-frontend-search-submit']; |
| 19 | + $placeholder = htmlentities( $this->data['messages']['mobile-frontend-placeholder'], ENT_QUOTES ); |
18 | 20 | |
19 | 21 | $scriptUrl = wfScript(); |
20 | 22 | $searchBoxDisplayNone = ( $this->data['hideSearchBox'] ) ? ' style="display: none;" ' : ''; |
— | — | @@ -34,7 +36,7 @@ |
35 | 37 | <form action='{$scriptUrl}' class='search_bar' method='get' {$searchBoxDisplayNone}> |
36 | 38 | <input type="hidden" value="Special:Search" name="title" /> |
37 | 39 | <div id="sq" class="divclearable"> |
38 | | - <input type="search" name="search" id="search" size="22" value="{$searchField}" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" class="search" /> |
| 40 | + <input type="search" name="search" id="search" size="22" value="{$searchField}" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" class="search" placeholder="{$placeholder}" /> |
39 | 41 | <div class="clearlink" id="clearsearch" title="{$clearText}"></div> |
40 | 42 | </div> |
41 | 43 | <button id='goButton' class='goButton' type='submit'></button> |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
42 | 44 | Merged /trunk/extensions/MobileFrontend:r113463,113465-113466,113469-113472 |