r113882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113881‎ | r113882 | r113883 >
Date:00:35, 15 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
remove autocomplete from search results

it was discussed that although we'd like this in future
at the moment whilst the search is only a title search
this doesn't make much sense so removing
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/beta_opensearch.js (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/beta_common.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/beta_opensearch.js
@@ -149,15 +149,6 @@
150150 return sections;
151151 }
152152
153 - function sqValUpdate( sqValue ) {
154 - var search = document.getElementById( 'search' );
155 - if ( search ) {
156 - search.value = sqValue + ' ';
157 - search.focus();
158 - searchApi( search.value );
159 - }
160 - }
161 -
162153 function htmlEntities( str ) {
163154 var text = document.createTextNode( str ),
164155 el = document.createElement( 'div' );
@@ -172,7 +163,7 @@
173164 function writeResults( sections ) {
174165 var results = document.getElementById( 'results' ), suggestions, i,
175166 term = htmlEntities( document.getElementById( 'search' ).value ),
176 - suggestionListener, section, escapedTerm, suggestionsResult, link, label;
 167+ section, escapedTerm, suggestionsResult, link, label;
177168
178169 results.style.display = 'block';
179170 if ( search ) {
@@ -187,22 +178,12 @@
188179 suggestions = document.createElement( 'ul' );
189180 suggestions.className = 'suggestions-results';
190181 results.appendChild( suggestions );
191 - suggestionListener = function() {
192 - var title = this.parentNode.getAttribute( 'title' );
193 - sqValUpdate( title );
194 - };
195182
196183 for ( i = 0; i < sections.length; i++ ) {
197184 section = sections[i];
198185 suggestionsResult = document.createElement( 'li' );
199 - link = document.createElement( 'a' );
200186 suggestionsResult.setAttribute( 'title', section.label );
201187 suggestionsResult.className = 'suggestions-result';
202 - label = document.createTextNode( '+' );
203 - link.appendChild(label);
204 - link.className = 'sq-val-update';
205 - u( link ).bind( 'click', suggestionListener );
206 - suggestionsResult.appendChild( link );
207188
208189 link = document.createElement( 'a' );
209190 link.setAttribute( 'href', section.value.replace( /^(?:\/\/|[^\/]+)*\//, '/' ) );
Index: trunk/extensions/MobileFrontend/stylesheets/beta_common.css
@@ -129,30 +129,6 @@
130130 background-color: #ACD1E9;
131131 }
132132
133 -a.sq-val-update {
134 - font-size: 1.3em;
135 - display: block;
136 - font-weight: normal;
137 - text-decoration: none;
138 - color: #666;
139 - position: absolute;
140 - right: 0;
141 - width: 1.5em;
142 - text-align: center;
143 -}
144 -
145 -a.sq-val-update:visited {
146 - text-decoration: none;
147 -}
148 -
149 -a.sq-val-update:hover {
150 - text-decoration: none;
151 -}
152 -
153 -a.sq-val-update:active {
154 - text-decoration: none;
155 -}
156 -
157133 a.search-result-item {
158134 display: block;
159135 margin-right: 2em;

Follow-up revisions

RevisionCommit summaryAuthorDate
r114202MFT r113807, r113831, r113832, r113865, r113866, r113870, r113871, r113872, r...awjrichards22:23, 19 March 2012

Status & tagging log