r45490 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45489‎ | r45490 | r45491 >
Date:04:56, 7 January 2009
Author:danny_b
Status:reverted (Comments)
Tags:
Comment:
* Added "Advanced search" link to the search form
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -1446,7 +1446,7 @@
14471447 * to ensure that client-side caches don't keep obsolete copies of global
14481448 * styles.
14491449 */
1450 -$wgStyleVersion = '195';
 1450+$wgStyleVersion = '196';
14511451
14521452
14531453 # Server-side caching:
Index: trunk/phase3/includes/Skin.php
@@ -1148,7 +1148,8 @@
11491149 . '<input type="text" id="searchInput'.$this->searchboxes.'" name="search" size="19" value="'
11501150 . htmlspecialchars(substr($search,0,256)) . "\" />\n"
11511151 . '<input type="submit" name="go" value="' . wfMsg ('searcharticle') . '" />&nbsp;'
1152 - . '<input type="submit" name="fulltext" value="' . wfMsg ('searchbutton') . "\" />\n</form>";
 1152+ . '<input type="submit" name="fulltext" value="' . wfMsg ('searchbutton') . "\" />\n"
 1153+ . '<a href="' . $this->escapeSearchLink() . '" rel="search">' . wfMsg ('powersearch-legend') . '</a></form>';
11531154
11541155 // Ensure unique id's for search boxes made after the first
11551156 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
Index: trunk/phase3/RELEASE-NOTES
@@ -258,6 +258,7 @@
259259 * Image moving is now enabled for sysops by default
260260 * Make "Did you mean" search feature more noticeable
261261 * (bug 16720) Transcluded Special:NewPages processes "/username="
 262+* Added "Advanced search" link to the search form
262263
263264 === Bug fixes in 1.14 ===
264265
Index: trunk/phase3/skins/MonoBook.php
@@ -259,6 +259,7 @@
260260 ?> value="<?php $this->text('search') ?>"<?php } ?> />
261261 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />&nbsp;
262262 <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
 263+ <a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a>
263264 </div></form>
264265 </div>
265266 </div>
Index: trunk/phase3/skins/Modern.php
@@ -256,6 +256,7 @@
257257 ?> value="<?php $this->text('search') ?>"<?php } ?> />
258258 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />&nbsp;
259259 <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
 260+ <a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a>
260261 </div></form>
261262 </div><!-- pBody -->
262263 </div><!-- portlet -->
Index: trunk/phase3/skins/monobook/main.css
@@ -715,7 +715,9 @@
716716 padding: .5em .4em .4em .4em;
717717 text-align: center;
718718 }
719 -
 719+#p-search a {
 720+ font-size: 95%;
 721+}
720722 /*
721723 ** the personal toolbar
722724 */
Index: trunk/phase3/skins/CologneBlue.php
@@ -299,7 +299,8 @@
300300 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
301301 . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
302302 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"
303 - . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
 303+ . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n"
 304+ . '<a href="$action" rel="search">' . wfMsg ('powersearch-legend') . '</a></form>';
304305
305306 // Ensure unique id's for search boxes made after the first
306307 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;

Follow-up revisions

RevisionCommit summaryAuthorDate
r45941Revert r45490 per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/45490aaron23:04, 20 January 2009

Comments

#Comment by Tim Starling (talk | contribs)   09:01, 8 January 2009

Needs at least 0.5em of padding between the link and the buttons.

#Comment by Danny B. (talk | contribs)   10:44, 8 January 2009

Vertical or horizontal? Which skin?

#Comment by Nikerabbit (talk | contribs)   12:20, 11 January 2009

This causes some ugly word wrapping.

The following needs to be escaped, wfMsg doesn't do it.

'<a href="$action" rel="search">' . wfMsg ('powersearch-legend') . '</a></form>';
'<a href="' . $this->escapeSearchLink() . '" rel="search">' . wfMsg ('powersearch-legend') . '</a></form>';

And while at it, the following should be too:

'<input type="submit" name="fulltext" value="' . wfMsg ('searchbutton') . "\" />\n"

Imho, two buttons and a link seems to be a tad too many alternatives for simple searching.


#Comment by Danny B. (talk | contribs)   15:51, 11 January 2009

Per IRC talk on wikitech I'm going to remove the Search button, since its function is partially duplicate to the Go button and partially duplicate to the Advanced search link and since search forms everywhere mostly look like that.

I'll be tweaking the styles and HTML code to correct the visual representation too.

#Comment by Umherirrender (talk | contribs)   17:48, 12 January 2009

Please use a own div for that link and add an id so users can add own style per .css. Thanks.

#Comment by Brion VIBBER (talk | contribs)   17:56, 13 January 2009

IMHO this looks really awkward:

Advanced search link looking weird in place.png

It's good to be doing some experiments here but I'm not too keen on this atm.

#Comment by Rainman (talk | contribs)   10:39, 17 January 2009

I also think it looks somewhat awkward. I am not sure there would be consensus for such a link (especially if it's not configurable), since some wikis did put 'Advanced search' in sidebar just to get it removed a couple of days after ...

#Comment by Aaron Schulz (talk | contribs)   23:05, 20 January 2009

Reverted in r45941

#Comment by Danny B. (talk | contribs)   23:34, 22 January 2009

Per Brion's suggestion on IRC added as configurable feature in r46042.

Status & tagging log