Re: svn commit: r894298 - in /httpd/httpd/trunk: docs/manual/mod/mod_autoindex.html.en docs/manual/mod/mod_autoindex.xml modules/generators/mod_autoindex.c

2009-12-29 Thread Rich Bowen


On Dec 29, 2009, at 12:20 , Nick Kew wrote:



On 29 Dec 2009, at 02:18, rbo...@apache.org wrote:


Author: rbowen
Date: Tue Dec 29 02:18:55 2009
New Revision: 894298

URL: http://svn.apache.org/viewvc?rev=894298&view=rev
Log:
Adds alternating CSS classes to table rows for trendy striped table
support.


FWIW, there's an open PR in bugzilla about adding something slightly
more extensive to mod_autoindex, and at first glance it makes sense.
Furthermore, it's got a patch!

Maybe you could review it while your focus is on mod_autoindex:
see if there's something worthwhile that doesn't duplicate your  
patches,

or just close it if it's overtaken by events.

https://issues.apache.org/bugzilla/show_bug.cgi?id=34014


Oooh. Nice. I'll look at it this evening. I was also fiddling with  
your suggestion of putting stuff in a template, but I haven't gotten  
very far with that.


--
Rich Bowen
rbo...@rcbowen.com





Re: svn commit: r894298 - in /httpd/httpd/trunk: docs/manual/mod/mod_autoindex.html.en docs/manual/mod/mod_autoindex.xml modules/generators/mod_autoindex.c

2009-12-29 Thread Nick Kew

On 29 Dec 2009, at 02:18, rbo...@apache.org wrote:

> Author: rbowen
> Date: Tue Dec 29 02:18:55 2009
> New Revision: 894298
> 
> URL: http://svn.apache.org/viewvc?rev=894298&view=rev
> Log:
> Adds alternating CSS classes to table rows for trendy striped table
> support.

FWIW, there's an open PR in bugzilla about adding something slightly
more extensive to mod_autoindex, and at first glance it makes sense.
Furthermore, it's got a patch!

Maybe you could review it while your focus is on mod_autoindex:
see if there's something worthwhile that doesn't duplicate your patches,
or just close it if it's overtaken by events.

https://issues.apache.org/bugzilla/show_bug.cgi?id=34014

-- 
Nick Kew


Re: svn commit: r894298 - in /httpd/httpd/trunk: docs/manual/mod/mod_autoindex.html.en docs/manual/mod/mod_autoindex.xml modules/generators/mod_autoindex.c

2009-12-29 Thread Ruediger Pluem
On 29.12.2009 03:18, rbo...@apache.org wrote:
> Author: rbowen
> Date: Tue Dec 29 02:18:55 2009
> New Revision: 894298
> 
> URL: http://svn.apache.org/viewvc?rev=894298&view=rev
> Log:
> Adds alternating CSS classes to table rows for trendy striped table
> support.
> 
> Modified:
> httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en
> httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
> httpd/httpd/trunk/modules/generators/mod_autoindex.c
> 
> Modified: httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en?rev=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.html.en Tue Dec 29 
> 02:18:55 2009
> @@ -900,6 +900,12 @@
>IndexStyleSheet "/css/style.css"
>  
>  
> +Using this directive in conjunction with IndexOptions
> +HTMLTable also adds ai-tr-odd and
> +ai-tr-even class declarations to alternating rows of
> +the directory listing table, so that you can style alternate rows of
> +the table differently.
> +
>  
>   src="../images/up.gif" />
>   id="ReadmeName">ReadmeName  id="readmename">Directive
> 
> Modified: httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml?rev=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml Tue Dec 29 02:18:55 
> 2009
> @@ -934,6 +934,12 @@
>Example
>IndexStyleSheet "/css/style.css"
>  
> +
> +Using this directive in conjunction with IndexOptions
> +HTMLTable also adds ai-tr-odd and
> +ai-tr-even class declarations to alternating rows of
> +the directory listing table, so that you can style alternate rows of
> +the table differently.
>  
>  
>  
> 
> Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=894298&r1=894297&r2=894298&view=diff
> ==
> --- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
> +++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Tue Dec 29 02:18:55 
> 2009
> @@ -1482,6 +1482,7 @@
> char direction, const char *colargs)
>  {
>  int x;
> +int row_count;
>  apr_size_t rv;
>  char *name = r->uri;
>  char *tp;
> @@ -1658,7 +1659,23 @@
>  }
>  
>  if (autoindex_opts & TABLE_INDEXING) {
> -ap_rputs("", r);
> +ap_rputs(" +
> +/* Even/Odd rows for IndexStyleSheet */
> +if (d->style_sheet != NULL) {
> +ap_rputs(" class=\"", r);
> +if ( row_count % 2 == 0 ) {
> +ap_rputs("ai_tr_even", r);
> +}
> +else {
> +ap_rputs("ai_tr_odd", r);
> +}
> +ap_rputs("\"", r);
> +row_count++;
> +}
> +
> +ap_rputs(">", r);
> +
>  if (!(autoindex_opts & SUPPRESS_ICON)) {
>  ap_rputs("", r);
>  if (autoindex_opts & ICONS_ARE_LINKS) {
> 
> 
> 

Please inititialize row_count to 0 to avoid compiler warnings.

Regards

RĂ¼diger