Index: trunk/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 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,8 +45,8 @@ |
52 | 46 | if ( !focused ) { |
53 | 47 | MobileFrontend.utils( document.body ).addClass( 'full-screen-search' ); |
54 | 48 | |
55 | | - removeResultsEl = document.getElementById( 'remove-results' ); |
56 | | - if ( !removeResultsEl ) { |
| 49 | + rrd = document.getElementById( 'remove-results' ); |
| 50 | + if ( !rrd ) { |
57 | 51 | rrd = document.createElement( 'a' ); |
58 | 52 | rrd.setAttribute( 'href', '#' ); |
59 | 53 | rrd.setAttribute( 'id', 'remove-results' ); |
— | — | @@ -68,12 +62,7 @@ |
69 | 63 | |
70 | 64 | function removeResults() { |
71 | 65 | MobileFrontend.utils( document.body ).removeClass( 'full-screen-search' ); |
72 | | - var removeResultsEl, pE = document.getElementById( 'placeholder' ); |
73 | 66 | |
74 | | - if ( pE ) { |
75 | | - pE.style.display = 'none'; |
76 | | - } |
77 | | - |
78 | 67 | if ( focused ) { |
79 | 68 | focused = false; |
80 | 69 | } |
— | — | @@ -165,8 +154,8 @@ |
166 | 155 | } |
167 | 156 | |
168 | 157 | function htmlEntities( str ) { |
169 | | - var text = document.createTextNode( str ); |
170 | | - var el = document.createElement( 'div' ); |
| 158 | + var text = document.createTextNode( str ), |
| 159 | + el = document.createElement( 'div' ); |
171 | 160 | el.appendChild( text ); |
172 | 161 | return el.innerHTML; |
173 | 162 | } |
— | — | @@ -229,8 +218,7 @@ |
230 | 219 | |
231 | 220 | function initClearSearch() { |
232 | 221 | var clearSearch = document.getElementById( 'clearsearch' ), |
233 | | - search = document.getElementById( 'search' ), |
234 | | - results = document.getElementById( 'results' ); |
| 222 | + search = document.getElementById( 'search' ); |
235 | 223 | function handleClearSearchLink() { |
236 | 224 | if ( clearSearch ) { |
237 | 225 | if ( search.value.length > 0 ) { |
— | — | @@ -275,4 +263,4 @@ |
276 | 264 | removeResults: removeResults |
277 | 265 | }; |
278 | 266 | |
279 | | -}()); |
\ No newline at end of file |
| 267 | +}()); |