Guest User

Untitled

a guest
Jun 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #!/usr/bin/awk -f
  2.  
  3. # style.awk
  4. # place next to status.awk
  5.  
  6. function styleadd( _match, _newstyle ) {
  7. if ( style[_match] == "" ) style[ _match ] = _newstyle
  8. else style[ _match ] = style[ _match ] ";" _newstyle
  9. }
  10.  
  11. function output_header() {
  12. print "Content-Type: text/css"
  13. print ""
  14. }
  15.  
  16. function setup_style() {
  17. styleadd( "table th, table td", "border: 1px solid black" )
  18. styleadd( "table td", "-moz-border-radius: 9px" )
  19. styleadd( "tr.even", "background-color: #e0e0ff" )
  20. styleadd( "tr.odd", "background-color: #ffffff" )
  21.  
  22. styleadd( "th", "font-family: arial" )
  23. styleadd( "th", "font-size: 14px" )
  24. styleadd( "th", "padding: 6px" )
  25. styleadd( "th", "font-weight: bold" )
  26. styleadd( "th", "background-color: #808080" )
  27. styleadd( "th", "color: #4f0000" )
  28.  
  29. styleadd( "td", "padding: 2px 12px" )
  30.  
  31. styleadd( "td:hover", "background-color: #ffff80" )
  32.  
  33. styleadd( ".title", "" )
  34. styleadd( ".progress", "text-align: center" )
  35. }
  36.  
  37. function output_style( _s) {
  38. for( _s in style ) {
  39. print _s " { " style[_s] " }"
  40. }
  41. }
  42.  
  43. BEGIN {
  44. output_header()
  45. setup_style()
  46. output_style()
  47. }
Add Comment
Please, Sign In to add comment