mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented separate Cascading Style Sheets for different output media
SVN revision: 1782
This commit is contained in:
parent
6b884f2788
commit
f1248bac07
@ -540,7 +540,21 @@ Admin user = bill
|
|||||||
A given theme can contain several Cascading Style Sheets (CSS). This
|
A given theme can contain several Cascading Style Sheets (CSS). This
|
||||||
can be usefule if several logbooks use the same images and icons, but
|
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
|
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>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Title image = <string></code></b><br>
|
<b><code>Title image = <string></code></b><br>
|
||||||
|
|||||||
17
src/elogd.c
17
src/elogd.c
@ -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,
|
void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, BOOL rss_feed, char *cookie,
|
||||||
int absolute_link)
|
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);
|
show_http_header(lbs, expires, cookie);
|
||||||
|
|
||||||
@ -6897,7 +6899,18 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head,
|
|||||||
else
|
else
|
||||||
strlcat(css, "default.css", sizeof(css));
|
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=\"shortcut icon\" href=\"favicon.ico\">\n");
|
||||||
rsprintf("<link rel=\"icon\" href=\"favicon.png\" type=\"image/png\">\n");
|
rsprintf("<link rel=\"icon\" href=\"favicon.png\" type=\"image/png\">\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user