Implemented separate Cascading Style Sheets for different output media
SVN revision: 1782
This commit is contained in:
+15
-1
@@ -540,7 +540,21 @@ Admin user = bill
|
||||
A given theme can contain several Cascading Style Sheets (CSS). This
|
||||
can be usefule if several logbooks use the same images and icons, but
|
||||
differnt colors. By default, the CSS <i>default.css</i> is used. This
|
||||
can be overwritten by this statement.
|
||||
can be overwritten by this statement. If different CSS'es should be used
|
||||
for different output media, this can be accomplished with a comma-
|
||||
separated list in the form
|
||||
<code><b>CSS = <file1>&<media1>,<file2>&<media2></b></code>. This will then be translated into separate style sheet
|
||||
statements for the different media. For example a statement
|
||||
|
||||
<code><b>CSS = default.css&screen,print.css&print</b></code>
|
||||
|
||||
will result in the HTML statements:
|
||||
|
||||
<pre>
|
||||
<link rel="stylesheet" type="text/css" href="default.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="print.css" media="print">
|
||||
</pre>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<b><code>Title image = <string></code></b><br>
|
||||
|
||||
+15
-2
@@ -6872,7 +6872,9 @@ void show_plain_header(int size, char *file_name)
|
||||
void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, BOOL rss_feed, char *cookie,
|
||||
int absolute_link)
|
||||
{
|
||||
char css[256], str[256];
|
||||
int i, n;
|
||||
char css[1000], str[1000], media[1000];
|
||||
char css_list[MAX_N_LIST][NAME_LENGTH];
|
||||
|
||||
show_http_header(lbs, expires, cookie);
|
||||
|
||||
@@ -6897,7 +6899,18 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head,
|
||||
else
|
||||
strlcat(css, "default.css", sizeof(css));
|
||||
|
||||
rsprintf("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">\n", css);
|
||||
if (strchr(css, ',')) {
|
||||
n = strbreak(css, css_list, MAX_N_LIST, ",");
|
||||
for (i=0 ; i<n ; i++) {
|
||||
strlcpy(str, css_list[i], sizeof(str));
|
||||
if (strchr(str, '&')) {
|
||||
strlcpy(media, strchr(str, '&')+1, sizeof(media));
|
||||
*strchr(str, '&') = 0;
|
||||
rsprintf("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" media=\"%s\">\n", str, media);
|
||||
}
|
||||
}
|
||||
} else
|
||||
rsprintf("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">\n", css);
|
||||
rsprintf("<link rel=\"shortcut icon\" href=\"favicon.ico\">\n");
|
||||
rsprintf("<link rel=\"icon\" href=\"favicon.png\" type=\"image/png\">\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user