source: trunk/lib/css.cc @ 379

Last change on this file since 379 was 379, checked in by Jari Häkkinen, 16 years ago

Addresses #62.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.8 KB
Line 
1// $Id: css.cc 379 2007-06-20 21:35:02Z jari $
2
3/*
4  Copyright (C) 2006 Peter Johansson
5  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
6
7  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
8
9  svndigest is free software; you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13
14  svndigest is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22  02111-1307, USA.
23*/
24
25#include "css.h"
26#include <config.h>
27
28#include <fstream>
29#include <string>
30
31namespace theplu{
32namespace svndigest{
33
34  void print_css(const std::string& str)
35  {
36    std::ofstream s(str.c_str());
37    s << "<-- svndigest.css generated by " << PACKAGE_STRING << "\n"
38
39      << "Copyright (C) 2006 Peter Johansson\n"
40      << "Copyright (C) 2007 Jari Häkkinen, Peter Johansson\n\n"
41      << "This file is part of svndigest, " 
42      << "http://lev.thep.lu.se/trac/svndigest\n\n"
43
44      << "svndigest is free software; you can redistribute it and/or " 
45      << "modify it\n"
46      << "under the terms of the GNU General Public License as published by\n"
47      << "the Free Software Foundation; either version 2 of the License, or\n"
48      << "(at your option) any later version.\n\n"
49
50      << "svndigest is distributed in the hope that it will be useful, but\n"
51      << "WITHOUT ANY WARRANTY; without even the implied warranty of\n"
52      << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
53      << "General Public License for more details.\n\n"
54
55      << "You should have received a copy of the GNU General Public License\n"
56      << "along with this program; if not, write to the Free Software\n"
57      << "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n"
58      << "02111-1307, USA.\n\n"
59
60      << "This file was initially inspired by the cascading style sheet\n"
61      << "within the Trac open source project (http://trac.edgewall.org/)\n"
62      << "Copyright (C) 2003-2006 Edgewall Software\n"
63      << "All rights reserved.\n\n"
64
65      << "Redistribution and use in source and binary forms, with or without\n"
66      << "modification, are permitted provided that the following conditions\n"
67      << "are met:\n\n"
68     
69      << "1. Redistributions of source code must retain the above copyright\n"
70      << "   notice, this list of conditions and the following disclaimer.\n"
71      << "2. Redistributions in binary form must reproduce the above copyright\n"
72      << "   notice, this list of conditions and the following disclaimer in\n"
73      << "   the documentation and/or other materials provided with the\n"
74      << "   distribution.\n"
75      << "3. The name of the author may not be used to endorse or promote\n"
76      << "   products derived from this software without specific prior\n"
77      << "   written permission.\n\n"
78     
79      << "THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS\n"
80      << "OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n"
81      << "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n"
82      << "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n"
83      << "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"
84      << "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n"
85      << "GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n"
86      << "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n"
87      << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n"
88      << "NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n"
89      << "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-->\n";
90
91    s << "body {\n";
92    s << " background: #fff; \n";
93    s << " color: #000; \n";
94    s << " margin: 0px; \n";
95    s << " padding: 0; \n";
96    s << "} \n";
97    s << "\n";
98
99    s << "#menu {\n";
100    s << " background: #eee;\n";
101    s << " width: 100%;\n";
102    s << " margin: 0px;\n";
103    s << " padding: 0px;\n";
104    s << "}\n\n";
105    s << "#menu ul\n";
106    s << "{ \n";
107    s << "padding: 0px;\n";
108    s << "margin: 0px;list-style-type: none; text-align: center;"
109      << "border-bottom: 1px solid black;}\n";
110    s << "#menu ul li { display: inline; border-right: 1px solid black;}\n";
111    s << "#menu ul li a {text-decoration: none; padding-right: 1em;" 
112      << "padding-left: 1em; margin: 0px;}\n";
113    s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
114    s << "#menu ul li.highlight a {color: #fff; background: #777; }";
115    s << "\n";
116    s << "#main {\n";
117    s << " margin: 10px; \n";
118    s << "}\n";
119    s << "\n";
120
121    s << "body, th, td {\n";
122    s << " font: normal 13px verdana,arial,'Bitstream Vera Sans',"
123      << "helvetica,sans-serif;\n";
124    s << "}\n";
125    s << ":link, :visited {\n";
126    s << " text-decoration: none;\n";
127    s << " color: #b00;\n";
128    s << "}\n";
129    s << "\n";
130
131    s << "div.main {\n";
132    s << "margin-top: 50px;\n";         
133    s << "margin-left: 50px;\n";
134    s << " \n";
135    s << "}\n";
136
137    s << "table.main {\n"; 
138    s << " text-align: left;\n";
139    s << " padding: 0 1em .1em 0;\n";
140    s << "}\n";
141    s << "table.main th {\n";
142    s << " text-align: left;\n";
143    s << " padding: 0 1em 0.5em 0;\n";
144    s << " font-size: 150%;\n";
145    s << " font-wheight: bold;\n";
146    s << "}\n";
147    s << "table.main td {\n";
148    s << " padding: 0 1em .1em 0;\n";
149    s << "}\n";
150
151    s << "table.blame {\n";
152    s << " clear: both;\n";
153    s << " border-bottom: 1px solid #d7d7d7;\n";
154    s << " border-collapse: collapse;\n";
155    s << " border-spacing: 0;\n";
156    s << " margin-top: 1em;\n";
157    s << " width: 100%;\n";
158    s << "}\n";
159    s << "\n";
160    s << "table.blame th {\n";
161    s << " text-align: left;\n";
162    s << " padding: 0 1em .1em 0;\n";
163    s << " font-size: 12px\n";
164    s << "}\n";
165    s << "table.blame thead { background: #f7f7f0 }\n";
166    s << "table.blame thead th {\n";
167    s << " border: 1px solid #d7d7d7;\n";
168    s << " border-bottom-color: #999;\n";
169    s << " font-size: 11px;\n";
170    s << " font-wheight: bold;\n";
171    s << " padding: 2px .5em;\n";
172    s << " vertical-align: bottom;\n";
173    s << "}\n";
174    s << "\n";
175    s << "table.blame tbody td a:hover, table.listing tbody th a:hover {\n";
176    s << " background-color: transparent;\n";
177    s << "}\n";
178    s << "\n";
179    s << "table.blame tbody td, table.listing tbody th {\n";
180    s << " border: 1px dotted #ddd;\n";
181    s << " padding: .33em .5em;\n";
182    s << " vertical-align: top;\n";
183    s << "}\n";
184    s << "\n";
185    s << "table.blame tbody td a:hover, table.listing tbody th a:hover {\n";
186    s << " background-color: transparent;\n";
187    s << "}\n";
188    s << "table.blame tbody tr { border-top: 1px solid #ddd }\n";
189    s << "table.blame tbody tr.light { background-color: #fcfcfc }\n";
190    s << "table.blame tbody tr.dark { background-color: #f7f7f7 }\n";
191    s << "table.blame tbody tr:hover { background: #eed }\n";
192    s << "table.blame tbody td { text-align: left }\n";
193    s << "table.blame tbody td a { display: block; }\n";
194    s << "table.blame tbody td.directory a { font-weight: bold }\n";
195    s << "\n";
196
197    s << "table.listings {\n";
198    s << " clear: both;\n";
199    s << " border-bottom: 1px solid #d7d7d7;\n";
200    s << " border-collapse: collapse;\n";
201    s << " border-spacing: 0;\n";
202    s << " margin-top: 1em;\n";
203    s << " width: 100%;\n";
204    s << "}\n";
205    s << "\n";
206    s << "table.listings th {\n";
207    s << " text-align: left;\n";
208    s << " padding: 0 1em .1em 0;\n";
209    s << " font-size: 12px\n";
210    s << "}\n";
211    s << "table.listings thead { background: #f7f7f0 }\n";
212    s << "table.listings thead th {\n";
213    s << " border: 1px solid #d7d7d7;\n";
214    s << " border-bottom-color: #999;\n";
215    s << " font-size: 11px;\n";
216    s << " font-wheight: bold;\n";
217    s << " padding: 2px .5em;\n";
218    s << " vertical-align: bottom;\n";
219    s << "}\n";
220    s << "\n";
221    s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
222    s << " background-color: transparent;\n";
223    s << "}\n";
224    s << "\n";
225    s << "table.listings tbody td, table.listing tbody th {\n";
226    s << " border: 1px dotted #ddd;\n";
227    s << " padding: .33em .5em;\n";
228    s << " vertical-align: top;\n";
229    s << "}\n";
230    s << "\n";
231    s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
232    s << " background-color: transparent;\n";
233    s << "}\n";
234    s << "table.listings tbody tr { border-top: 1px solid #ddd }\n";
235    s << "table.listings tbody tr.light { background-color: #fcfcfc }\n";
236    s << "table.listings tbody tr.dark { background-color: #f7f7f7 }\n";
237    s << "table.listings tbody tr:hover { background: #eed }\n";
238    s << "table.listings tbody td { text-align: left }\n";
239    s << "table.listings tbody td a { display: block; }\n";
240    s << "table.listings tbody td.directory a { font-weight: bold }\n";
241    s << "\n";
242
243    s << ".sep { color: #666}\n";
244    s << "\n";
245    s << "\n";
246    s.close();
247  }
248
249
250}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.