You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2009/12/29 03:18:56 UTC
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
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"
</code></p></div>
+ <p>Using this directive in conjunction with <code>IndexOptions
+ HTMLTable</code> also adds <code>ai-tr-odd</code> and
+ <code>ai-tr-even</code> class declarations to alternating rows of
+ the directory listing table, so that you can style alternate rows of
+ the table differently.</p>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ReadmeName" id="ReadmeName">ReadmeName</a> <a name="readmename" id="readmename">Directive</a></h2>
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 @@
<title>Example</title>
IndexStyleSheet "/css/style.css"
</example>
+
+ <p>Using this directive in conjunction with <code>IndexOptions
+ HTMLTable</code> also adds <code>ai-tr-odd</code> and
+ <code>ai-tr-even</code> class declarations to alternating rows of
+ the directory listing table, so that you can style alternate rows of
+ the table differently.</p>
</usage>
</directivesynopsis>
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("<tr>", r);
+ ap_rputs("<tr", r);
+
+ /* 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("<td valign=\"top\">", r);
if (autoindex_opts & ICONS_ARE_LINKS) {
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
Posted by Ruediger Pluem <rp...@apache.org>.
On 29.12.2009 03:18, rbowen@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"
> </code></p></div>
>
> + <p>Using this directive in conjunction with <code>IndexOptions
> + HTMLTable</code> also adds <code>ai-tr-odd</code> and
> + <code>ai-tr-even</code> class declarations to alternating rows of
> + the directory listing table, so that you can style alternate rows of
> + the table differently.</p>
> +
> </div>
> <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
> <div class="directive-section"><h2><a name="ReadmeName" id="ReadmeName">ReadmeName</a> <a name="readmename" id="readmename">Directive</a></h2>
>
> 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 @@
> <title>Example</title>
> IndexStyleSheet "/css/style.css"
> </example>
> +
> + <p>Using this directive in conjunction with <code>IndexOptions
> + HTMLTable</code> also adds <code>ai-tr-odd</code> and
> + <code>ai-tr-even</code> class declarations to alternating rows of
> + the directory listing table, so that you can style alternate rows of
> + the table differently.</p>
> </usage>
> </directivesynopsis>
>
>
> 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("<tr>", r);
> + ap_rputs("<tr", r);
> +
> + /* 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("<td valign=\"top\">", r);
> if (autoindex_opts & ICONS_ARE_LINKS) {
>
>
>
Please inititialize row_count to 0 to avoid compiler warnings.
Regards
RĂ¼diger
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
Posted by Rich Bowen <rb...@rcbowen.com>.
On Dec 29, 2009, at 12:20 , Nick Kew wrote:
>
> On 29 Dec 2009, at 02:18, rbowen@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
rbowen@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
Posted by Nick Kew <ni...@webthing.com>.
On 29 Dec 2009, at 02:18, rbowen@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