From e7ba64e3701b17f9ddf7d2851dade38e6e653605 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 5 Jun 2015 14:20:51 +0200 Subject: [PATCH] Made CSS if IN ADDITION to default CSS file which is now "elog.css". This way it is simpler to override settings from the default file. --- doc/config.html | 5 +- src/elogd.c | 45 +-- themes/default/compact.css | 333 +---------------------- themes/default/{default.css => elog.css} | 0 themes/default/tiny.css | 274 +------------------ xcode/elogd.xcodeproj/project.pbxproj | 4 +- 6 files changed, 33 insertions(+), 628 deletions(-) rename themes/default/{default.css => elog.css} (100%) diff --git a/doc/config.html b/doc/config.html index d1527b0e..3d0f8dcc 100755 --- a/doc/config.html +++ b/doc/config.html @@ -550,8 +550,9 @@ Admin user = bill CSS = <filename>
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 default.css is used. This - can be overwritten by this statement. If different CSS'es should be used + differnt colors. By default, the CSS elog.css is used. This + statement adds an additional CSS, which can overwrite settings from + elog.css. If different CSS'es should be used for different output media, this can be accomplished with a comma- separated list in the form CSS = <file1>&<media1>,<file2>&<media2>. This will then be translated into separate style sheet diff --git a/src/elogd.c b/src/elogd.c index 7c250897..8ad273fe 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -7581,7 +7581,7 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, int absolute_link, int refresh) { int i, n; - char css[1000], str[1000], media[1000]; + char css[1000], css_base[1000], str[1000], media[1000]; char css_list[MAX_N_LIST][NAME_LENGTH]; show_http_header(lbs, expires, cookie); @@ -7603,29 +7603,34 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, /* Cascading Style Sheet */ if (absolute_link) - compose_base_url(lbs, css, sizeof(css), FALSE); + compose_base_url(lbs, css_base, sizeof(css_base), FALSE); + else + css_base[0] = 0; + + rsprintf("\n", css_base); + + if (lbs != NULL && getcfg(lbs->name, "CSS", str, sizeof(str))) + strlcpy(css, str, sizeof(css)); + else if (lbs == NULL && getcfg("global", "CSS", str, sizeof(str))) + strlcpy(css, str, sizeof(css)); else css[0] = 0; - if (lbs != NULL && getcfg(lbs->name, "CSS", str, sizeof(str))) - strlcat(css, str, sizeof(css)); - else if (lbs == NULL && getcfg("global", "CSS", str, sizeof(str))) - strlcat(css, str, sizeof(css)); - else - strlcat(css, "default.css", sizeof(css)); - - if (strchr(css, ',')) { - n = strbreak(css, css_list, MAX_N_LIST, ",", FALSE); - 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("\n", str, media); + if (css[0]) { + if (strchr(css, ',')) { + n = strbreak(css, css_list, MAX_N_LIST, ",", FALSE); + 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("\n", str, media); + } } - } - } else - rsprintf("\n", css); + } else + rsprintf("\n", css_base, css); + } + rsprintf("\n"); rsprintf("\n"); diff --git a/themes/default/compact.css b/themes/default/compact.css index db6037eb..487eb0c1 100755 --- a/themes/default/compact.css +++ b/themes/default/compact.css @@ -1,391 +1,60 @@ -/* default formatting */ +/* compact formatting */ body { margin:0px; - color:black; - background-color:white; - font-family:sans-serif; - /* background-image:url(elog.gif); */ } -/* standard link colors and decorations */ -a:link { color:#0000FF; text-decoration:none } -a:visited { color:#800080; text-decoration:none } -a:hover { color:#0000FF; text-decoration:underline } -a:active { color:#0000FF; text-decoration:underline } -a:focus { color:#0000FF; text-decoration:underline } - -td { - color:black; - font-family:sans-serif; -} - -/* frame table */ -.frame { - width:100%; -} - -/* printable frame table */ -.pframe { - width:600px; -} - -/* standard formatting for logbook tabs */ -.tabs { - font-family:sans-serif; - font-size:10pt; - background-color:white; -} - -/* unselected and selected group tabs */ - .gtab a { - background-color:#B0E0B0; padding-left:1px; padding-right:1px; } -.gtab { - background-color:#B0E0B0; - border-right:1px solid #409040; -} - .sgtab a { - color:white; padding-left:1px; padding-right:1px; } -.sgtab { - background-color:#486090; - color:white; - border-right:1px solid #084070; -} - -.sgtab a:visited { color:white; } /* buf for IE */ - -/* unselected and selected logbook tabs */ - .ltab a { - background-color:#E0E0E0; padding-left:1px; padding-right:1px; } -.ltab { - background-color:#E0E0E0; - border-right:1px solid gray; -} - .sltab a { - background-color:#486090; - color:white; padding-left:1px; padding-right:1px; } -.sltab { - background-color:#486090; - color:white; - border-right:1px solid #084070; -} - -.sltab a:visited { color:white; } /* bug for IE */ - -/* logbook title, left, middle and right cell */ - -.title1 { - background-color:#486090; - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - border-left:1px solid #E0E0E0; - color:white; - font-size:medium; - font-family:sans-serif; - text-align:left; -} - -.title2 { - background-color:#486090; - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - color:white; - font-size:medium; - font-family:sans-serif; - text-align:center; -} - -.title3 { - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - border-right:1px solid black; - background-color:#486090; - text-align:right; -} - -/* main menu row */ - .menuframe { - border:1px solid #486090; - border-top:1px solid white; - border-left:1px solid white; padding:1px; - background-color:#E0E0E0; } -.menu1 { - text-align:left; - font-size:10pt; -} - -.menu2a { - text-align:left; - font-size:10pt; -} - -.menu2b { - text-align:right; - font-size:10pt; -} - -.menu3 { - text-align:left; - font-size:8pt; - font-weight:bold; -} - -.menu4 { - text-align:right; - font-size:10pt; - vertical-align:middle; -} - -/* frame table in listings */ -.listframe { - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1pc solid white; - background-color:#486090; - border:0px; -} - -/* title row in listing */ -.listtitle { - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; - background-color:#CCCCFF; - text-align:center; -} - -/* odd and even lines in message listing */ - -.list1 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:center; -} - -.list2 { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:center; -} - -.list1h { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:center; - font-weight:bold; -} - -.list2h { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:center; - font-weight:bold; -} - -/* attachment line */ - -.attachment { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:left; -} - -/* threaded listing */ -.thread { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:left; -} - -.threadreply { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:left; -} - -/* attribute names and values on single message page */ .attribhead { - background-color:#E0E0A0; - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; padding:1px; - font-size:10pt; - font-family:sans-serif; } .attribname { - width:150px; - background-color:#CCCCFF; - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; padding:1px; } .attribvalue { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; padding:1px; } .attribvalue2 { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; padding:1px; } -/* message cell in listing */ .messagelist { - background-color:white; - border-right:1px solid gray; - border-left:1px solid gray; - border-bottom:1px solid gray; - font-family:'lucida console',courier,monospace; - font-size:10pt; padding:1px; } -/* message display in single message page */ .messageframe { - background-color:white; - border:1px solid #486090; - border-top:0px; padding:1px; } -.messagepre { - font-family:'lucida console',courier,monospace; - font-size:10pt; -} - -/* attachment size */ -.bytes { - font-family:'lucida console',courier,monospace; - font-size:10pt; -} - -/* summary display (threaded mode expand) */ -.summary { - border:1px solid black; - border-top:1px solid white; - border-left:1px solid white; - background-color:white; - font-family:'lucida console',courier,monospace; - font-size:8pt; -} - -/* input forms */ -.form1 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - padding:1px; -} - -.form2 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - padding:1px; -} - -/* error message */ .errormsg { - border:1px solid #486090; padding:1px; - background-color:#FFB0B0; - text-align:center; - font-size:medium; } -/* notification (warning) */ .notifymsg { padding:1px; - border:1px solid #806000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFD070; - text-align:center; - font-size:small; } - -/* dialog boxes (login, delete, etc.) */ -.dlgframe { - width:50%; - background-color:#486090; - border:1px solid #486090; - margin-top:2cm; -} - -.dlgerror { - background-color:red; - padding:10px; - font-size:small; - text-align:center; - font-size:medium; - color:white; -} - -.dlgtitle { - background-color:#486090; - color:white; - font-size:medium; - text-align:center; - padding:5px; -} - -.dlgform { - background-color:#DDEEBB; - padding:5px; -} - -/* ELOG home page link at bottom of page */ -.bottomlink { - font-family:sans-serif; - font-size:xx-small; -} - diff --git a/themes/default/default.css b/themes/default/elog.css similarity index 100% rename from themes/default/default.css rename to themes/default/elog.css diff --git a/themes/default/tiny.css b/themes/default/tiny.css index ab61f219..e8eac5dd 100755 --- a/themes/default/tiny.css +++ b/themes/default/tiny.css @@ -1,392 +1,122 @@ -/* default formatting */ +/* tiny formatting */ body { margin:0px; - color:black; - background-color:white; - font-family:sans-serif; - /* background-image:url(elog.gif); */ } -/* standard link colors and decorations */ -a:link { color:#0000FF; text-decoration:none } -a:visited { color:#800080; text-decoration:none } -a:hover { color:#0000FF; text-decoration:underline } -a:active { color:#0000FF; text-decoration:underline } -a:focus { color:#0000FF; text-decoration:underline } - td { - color:black; - font-family:sans-serif; font-size:8pt; } -/* frame table */ -.frame { - width:100%; -} - -/* printable frame table */ -.pframe { - width:600px; -} - -/* standard formatting for logbook tabs */ .tabs { - font-family:sans-serif; font-size:8pt; - background-color:white; } /* unselected and selected group tabs */ .gtab a { - background-color:#B0E0B0; padding-left:1px; padding-right:1px; } -.gtab { - background-color:#B0E0B0; - border-right:1px solid #409040; -} - .sgtab a { - color:white; padding-left:1px; padding-right:1px; } -.sgtab { - background-color:#486090; - color:white; - border-right:1px solid #084070; -} - -.sgtab a:visited { color:white; } /* buf for IE */ - -/* unselected and selected logbook tabs */ - .ltab a { - background-color:#E0E0E0; padding-left:1px; padding-right:1px; } -.ltab { - background-color:#E0E0E0; - border-right:1px solid gray; -} - .sltab a { - background-color:#486090; - color:white; padding-left:1px; padding-right:1px; } -.sltab { - background-color:#486090; - color:white; - border-right:1px solid #084070; -} - -.sltab a:visited { color:white; } /* bug for IE */ - -/* logbook title, left, middle and right cell */ - .title1 { - background-color:#486090; - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - border-left:1px solid #E0E0E0; - color:white; font-size:10pt; - font-family:sans-serif; - text-align:left; } .title2 { - background-color:#486090; - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - color:white; font-size:10pt; - font-family:sans-serif; - text-align:center; } .title3 { - border-bottom:1px solid black; - border-top:1px solid #E0E0E0; - border-right:1px solid black; - background-color:#486090; - text-align:right; -} - -/* main menu row */ - -.menuframe { - border:1px solid #486090; - border-top:1px solid white; - border-left:1px solid white; - padding:1px; - background-color:#E0E0E0; + font-size:10pt; } .menu1 { - text-align:left; font-size:8pt; } .menu2a { - text-align:left; font-size:8pt; } .menu2b { - text-align:right; font-size:8pt; } .menu3 { - text-align:left; font-size:8pt; - font-weight:bold; } .menu4 { - text-align:right; font-size:8pt; - vertical-align:middle; } -/* frame table in listings */ -.listframe { - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1pc solid white; - background-color:#486090; - border:0px; -} - -/* title row in listing */ -.listtitle { - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; - background-color:#CCCCFF; - text-align:center; -} - -/* odd and even lines in message listing */ - -.list1 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:center; -} - -.list2 { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:center; -} - -.list1h { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:center; - font-weight:bold; -} - -.list2h { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:center; - font-weight:bold; -} - -/* attachment line */ - -.attachment { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:left; -} - -/* threaded listing */ -.thread { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; - text-align:left; -} - -.threadreply { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; - text-align:left; -} - -/* attribute names and values on single message page */ .attribhead { - background-color:#E0E0A0; - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; padding:1px; font-size:8pt; - font-family:sans-serif; } .attribname { - width:150px; - background-color:#CCCCFF; - border:1px solid #0000FF; - border-top:1px solid white; - border-left:1px solid white; padding:1px; } .attribvalue { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; padding:1px; } .attribvalue2 { - border:1px solid #808040; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFFFB0; padding:1px; } -/* message cell in listing */ .messagelist { - background-color:white; - border-right:1px solid gray; - border-left:1px solid gray; - border-bottom:1px solid gray; - font-family:'lucida console',courier,monospace; font-size:8pt; padding:1px; } -/* message display in single message page */ .messageframe { - background-color:white; - border:1px solid #486090; - border-top:0px; padding:1px; } .messagepre { - font-family:'lucida console',courier,monospace; font-size:8pt; } -/* attachment size */ .bytes { - font-family:'lucida console',courier,monospace; font-size:8pt; } -/* summary display (threaded mode expand) */ .summary { - border:1px solid black; - border-top:1px solid white; - border-left:1px solid white; - background-color:white; - font-family:'lucida console',courier,monospace; font-size:8pt; } -/* input forms */ .form1 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; padding:1px; } .form2 { - border:1px solid #308000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#DDEEBB; padding:1px; } /* error message */ .errormsg { - border:1px solid #486090; - padding:1px; - background-color:#FFB0B0; - text-align:center; font-size:10pt; } -/* notification (warning) */ .notifymsg { padding:1px; - border:1px solid #806000; - border-top:1px solid white; - border-left:1px solid white; - background-color:#FFD070; - text-align:center; font-size:10pt; } - -/* dialog boxes (login, delete, etc.) */ -.dlgframe { - width:50%; - background-color:#486090; - border:1px solid #486090; - margin-top:2cm; -} - -.dlgerror { - background-color:red; - padding:10px; - font-size:10pt; - text-align:center; - font-size:10pt; - color:white; -} - -.dlgtitle { - background-color:#486090; - color:white; - font-size:10pt; - text-align:center; - padding:5px; -} - -.dlgform { - background-color:#DDEEBB; - padding:5px; -} - -/* ELOG home page link at bottom of page */ -.bottomlink { - font-family:sans-serif; - font-size:6pt; -} - diff --git a/xcode/elogd.xcodeproj/project.pbxproj b/xcode/elogd.xcodeproj/project.pbxproj index 0ac4bf21..b2aef001 100644 --- a/xcode/elogd.xcodeproj/project.pbxproj +++ b/xcode/elogd.xcodeproj/project.pbxproj @@ -47,7 +47,7 @@ D548630A1ACA9A9F00BA8C69 /* im.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = im.js; path = ../scripts/im.js; sourceTree = ""; }; D548630B1ACA9AAB00BA8C69 /* load-ckeditor.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "load-ckeditor.js"; path = "../scripts/load-ckeditor.js"; sourceTree = ""; }; D548630C1ACA9AC600BA8C69 /* elcode.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = elcode.js; path = ../scripts/elcode.js; sourceTree = ""; }; - D548630D1ACAEF5400BA8C69 /* default.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = default.css; path = ../themes/default/default.css; sourceTree = ""; }; + D57031C51B21CAF900A7C6EE /* elog.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = elog.css; path = ../themes/default/elog.css; sourceTree = ""; }; D58A366615AF103300682DC0 /* elog-version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "elog-version.h"; path = "../src/elog-version.h"; sourceTree = SOURCE_ROOT; }; D5AC5BF9154AC7200018DD90 /* config.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = config.html; path = ../doc/config.html; sourceTree = SOURCE_ROOT; }; D5C8CD7A1ACC02A0008B1201 /* elogd.cfg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = elogd.cfg; path = ../../../elogdemo/elogd.cfg; sourceTree = ""; }; @@ -115,8 +115,8 @@ D5F11B9013AFA146002CE8BF /* Resources */ = { isa = PBXGroup; children = ( + D57031C51B21CAF900A7C6EE /* elog.css */, D5C8CD7A1ACC02A0008B1201 /* elogd.cfg */, - D548630D1ACAEF5400BA8C69 /* default.css */, D5AC5BF9154AC7200018DD90 /* config.html */, D51F4A9214F27F3C00CB29E9 /* index.html */, D528A7C514F278DA00D33974 /* checklist.txt */,