[Mediawiki-l] make the search button the default when hitting enter instead of the go one

Jim Wilson wilson.jim.r at gmail.com
Mon Jul 2 14:47:55 UTC 2007


Sorry Pedro - I figured that would do it :(

-- Jim

On 7/1/07, Greg Sabino Mullane <greg at turnstep.com> wrote:
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
> NotDashEscaped: You need GnuPG to verify this message
>
>
> Pedro Flores wrote:
> > That reverses the buttions alright, but it does not change the behaviour
> > of when hitting enter after entering text in the search box, the search
> > still defaults to a 'go' one.  Thanks.
>
> Try changing includes/SpecialSearch.php like so:
>
> Index: SpecialSearch.php
> ===================================================================
> --- SpecialSearch.php   (revision 23623)
> +++ SpecialSearch.php   (working copy)
> @@ -32,12 +32,12 @@
>
>         $search = $wgRequest->getText( 'search', $par );
>         $searchPage = new SpecialSearch( $wgRequest, $wgUser );
> -       if( $wgRequest->getVal( 'fulltext' ) ||
> -               !is_null( $wgRequest->getVal( 'offset' ) ) ||
> -               !is_null ($wgRequest->getVal( 'searchx' ) ) ) {
> +       if( $wgRequest->getVal( 'go' ) &&
> +               is_null( $wgRequest->getVal( 'offset' ) ) &&
> +               is_null ($wgRequest->getVal( 'searchx' ) ) ) {
> +               $searchPage->goResult( $search );
> +       } else {
>                 $searchPage->showResults( $search );
> -       } else {
> -               $searchPage->goResult( $search );
>         }
> }
>
>
>
> --
> Greg Sabino Mullane greg at turnstep.com
> End Point Corporation
> PGP Key: 0x14964AC8 200707012026
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
>
> iD8DBQFGiEakvJuQZxSWSsgRAwMBAKDFMyXcdRNizLhz2mSysJmNSSKjYwCdF/AT
> RVECxNTT8zpNY0qi7hLZFSo=
> =Bwi0
> -----END PGP SIGNATURE-----
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


More information about the MediaWiki-l mailing list