[aur-dev] Select All in Package Listing
Lukas Fleischer
archlinux at cryptocrack.de
Fri Dec 2 04:35:34 EST 2011
On Thu, Dec 01, 2011 at 03:14:00PM +0100, Nick Lanham wrote:
> There was some talk on the aur-general list about how it would be
> nice to have a select all option on the package listing page. This
> patch adds that.
Please send full Git-formatted patches (generated by
git-format-patch(1)) and please send them inline instead of attaching
stuff.
>
> Note that I just dropped the javascript into a <script> tag as, as
> far as i can tell, there isn't any central location for js stuff.
> If that's a problem, I can move it elsewhere.
Well, the reason for not having a central location for JavaScript stuff
is because we (that's me, basically) don't like JavaScript :) If we ever
feel the need for such a thing, it should definitely be put in a central
location, though.
Also, there's a lot of design changes going on right now and all
design/interface related patches should probably be delayed until
everything is merged into master. Could you wait for a while and
resubmit this patch when all the hard work is done? :) You can also open
a feature request in the meantime, so we don't lose track of this one.
>
> Regards,
>
> Nick Lanham
> diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php
> index 8ef352b..45173bb 100644
> --- a/web/template/pkg_search_results.php
> +++ b/web/template/pkg_search_results.php
> @@ -10,12 +10,22 @@
> </div>
>
>
> -
> -
> -<table class='results'>
> +<script type="text/javascript">
> + function clickAll(box,table) {
> + var checks = table.getElementsByTagName("input");
> + for (var i = 0; i < checks.length; i++)
> + checks[i].checked = box.checked
> + }
> +</script>
> +<table class='results' id='result_table'>
> <tr>
> <?php if ($SID): ?>
> - <th class='header'> </th>
> + <th class='header' style='text-align:left'>
> + <input type='checkbox'
> + title='<?php print __("Select All/None") ?>'
> + onClick='clickAll(this,document.getElementById("result_table"))'
> + name='SelAllCheck' value='1' />
> + </th>
> <?php endif; ?>
>
> <th class='header'><span class='f2'>
More information about the aur-dev
mailing list