Changeset 177


Ignore:
Timestamp:
Sep 2, 2006, 6:30:57 AM (13 years ago)
Author:
Peter Johansson
Message:

moved html related utility to its own 'html_utility'

Location:
trunk/lib
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Makefile.am

    r167 r177  
    2525noinst_LTLIBRARIES = libsvndigest.la
    2626
    27 noinst_HEADERS = Directory.h File.h Gnuplot.h GnuplotFE.h Node.h  \
     27noinst_HEADERS = Directory.h File.h Gnuplot.h GnuplotFE.h html_utility.h
     28  Node.h  \
    2829  Parser.h rmdirhier.h Stats.h SVN.h SVNblame.h SVNinfo.h utility.h
    2930
    3031libsvndigest_la_SOURCES = Directory.cc File.cc Gnuplot.cc GnuplotFE.cc  \
     32  html_utility.cc \
    3133  Node.cc Parser.cc rmdirhier.cc Stats.cc SVN.cc SVNblame.cc  \
    3234  SVNinfo.cc utility.cc
  • trunk/lib/Node.cc

    r176 r177  
    2323
    2424#include "Node.h"
     25#include "html_utility.h"
    2526#include "utility.h"
    2627#include <config.h> // this header file is created by configure
  • trunk/lib/Node.h

    r176 r177  
    2525*/
    2626
     27#include "html_utility.h"
    2728#include "Stats.h"
    2829#include "SVNinfo.h"
  • trunk/lib/utility.cc

    r175 r177  
    5858
    5959
    60   void anchor(std::ostream& os, const std::string& href,
    61               const std::string& name, u_int level,
    62               const std::string& title)
    63   {
    64     os << "<a title=\"" << title << "\" href=\"" ;
    65     for (size_t i=0; i<level; ++i)
    66       os << "../";
    67     os << href << "\">" << name << "</a>";
    68   }
    69 
    70 
    7160  std::string file_name(const std::string& full_path)
    7261  {
     
    7564    while (getline(ss,name,'/')) {}
    7665    return name;
    77   }
    78 
    79 
    80   void print_css(std::ostream& s)
    81   {
    82     s << "body {\n";
    83     s << " background: #fff; \n";
    84     s << " color: #000; \n";
    85     s << " margin: 0px; \n";
    86     s << " padding: 0; \n";
    87     s << "} \n";
    88     s << "\n";
    89     s << "#menu {\n";
    90     s << " background: #eee;\n";
    91     s << " width: 100%;\n";
    92     s << " margin: 0px;\n";
    93     s << " padding: 0px;\n";
    94     s << "}\n\n";
    95     s << "#menu ul\n";
    96     s << "{ \n";
    97     s << "padding: 0px;\n";
    98     s << "margin: 0px;list-style-type: none; text-align: center;"
    99       << "border-bottom: 1px solid black;}\n";
    100     s << "#menu ul li { display: inline; border-right: 1px solid black;}\n";
    101     s << "#menu ul li a {text-decoration: none; padding-right: 1em;"
    102       << "padding-left: 1em; margin: 0px;}\n";
    103     s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
    104     s << "\n";
    105     s << "#main {\n";
    106     s << " margin: 10px; \n";
    107     s << "}\n";
    108     s << "\n";
    109     s << "body, th, td {\n";
    110     s << " font: normal 13px verdana,arial,'Bitstream Vera Sans',"
    111       << "helvetica,sans-serif;\n";
    112     s << "}\n";
    113     s << ":link, :visited {\n";
    114     s << " text-decoration: none;\n";
    115     s << " color: #b00;\n";
    116     s << "}\n";
    117     s << "\n";
    118     s << "table.listings {\n";
    119     s << " clear: both;\n";
    120     s << " border-bottom: 1px solid #d7d7d7;\n";
    121     s << " border-collapse: collapse;\n";
    122     s << " border-spacing: 0;\n";
    123     s << " margin-top: 1em;\n";
    124     s << " width: 100%;\n";
    125     s << "}\n";
    126     s << "\n";
    127     s << "table.listings th {\n";
    128     s << " text-align: left;\n";
    129     s << " padding: 0 1em .1em 0;\n";
    130     s << " font-size: 12px\n";
    131     s << "}\n";
    132     s << "table.listings thead { background: #f7f7f0 }\n";
    133     s << "table.listings thead th {\n";
    134     s << " border: 1px solid #d7d7d7;\n";
    135     s << " border-bottom-color: #999;\n";
    136     s << " font-size: 11px;\n";
    137     s << " font-wheight: bold;\n";
    138     s << " padding: 2px .5em;\n";
    139     s << " vertical-align: bottom;\n";
    140     s << "}\n";
    141     s << "\n";
    142     s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
    143     s << " background-color: transparent;\n";
    144     s << "}\n";
    145     s << "\n";
    146     s << "table.listings tbody td, table.listing tbody th {\n";
    147     s << " border: 1px dotted #ddd;\n";
    148     s << " padding: .33em .5em;\n";
    149     s << " vertical-align: top;\n";
    150     s << "}\n";
    151     s << "\n";
    152     s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
    153     s << " background-color: transparent;\n";
    154     s << "}\n";
    155     s << "table.listings tbody tr { border-top: 1px solid #ddd }\n";
    156     s << "table.listings tbody tr.light { background-color: #fcfcfc }\n";
    157     s << "table.listings tbody tr.dark { background-color: #f7f7f7 }\n";
    158     s << "table.listings tbody tr:hover { background: #eed }\n";
    159     s << "table.listings tbody td { text-align: left }\n";
    160     s << "\n";
    161     s << ".sep { color: #666}\n";
    162     s << "\n";
    163     s << "\n";
    16466  }
    16567
  • trunk/lib/utility.h

    r175 r177  
    3636namespace theplu{
    3737namespace svndigest{
    38 
    39   ///
    40   /// @brief send anchor to stream @a os
    41   ///
    42   /// @param address to link to
    43   /// @param name text visible on page
    44   /// @param level '../' is added @a level times before @a href
    45   /// @param title title of anchor
    46   ///
    47   void anchor(std::ostream& os, const std::string& href,
    48               const std::string& name, u_int level=0,
    49               const std::string& title="");
    5038
    5139  ///
     
    8977  ///
    9078  inline int mkdir(const std::string& dir) { return ::mkdir(dir.c_str(),0777); }
    91 
    92   ///
    93   /// @printing cascading style sheet to stream @a s.
    94   ///
    95   void print_css(std::ostream& s);
    9679
    9780  ///
Note: See TracChangeset for help on using the changeset viewer.