Changeset 2481


Ignore:
Timestamp:
Aug 22, 2008, 2:45:03 AM (16 years ago)
Author:
rvelices
Message:
  • further reduce css rules and remove unused ones
  • added a smarty prefilter so that html output is nicely indented now ...
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r2476 r2481  
    8080    $this->smarty->register_modifier( 'explode', array('Template', 'mod_explode') );
    8181    $this->smarty->register_block('html_head', array(&$this, 'block_html_head') );
     82    $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') );
    8283    if ( $conf['compiled_template_cache_language'] )
    8384    {
    84       $this->smarty->register_prefilter( array(&$this, 'prefilter_language') );
     85      $this->smarty->register_prefilter( array('Template', 'prefilter_language') );
    8586    }
    8687
     
    356357  }
    357358
     359  /*static */ function prefilter_white_space($source, &$smarty)
     360  {
     361    $ld = $smarty->left_delimiter;
     362    $rd = $smarty->right_delimiter;
     363    $ldq = preg_quote($ld, '#');
     364    $rdq = preg_quote($rd, '#');
     365
     366    $regex = array();
     367    $tags = array('if', 'foreach', 'section');
     368    foreach($tags as $tag)
     369    {
     370      array_push($regex, "#^\s+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m");
     371      array_push($regex, "#^\s+($ldq/$tag$rdq)\s*$#m");
     372    }
     373    $tags = array('include', 'else', 'html_head');
     374    foreach($tags as $tag)
     375    {
     376      array_push($regex, "#^\s+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m");
     377    }
     378    $source = preg_replace( $regex, "$1", $source);
     379    return $source;
     380  }
     381
    358382  /**
    359383   * Smarty prefilter to allow caching (whenever possible) language strings
    360384   * from templates.
    361385   */
    362   function prefilter_language($source, &$smarty)
     386  /*static */ function prefilter_language($source, &$smarty)
    363387  {
    364388    global $lang;
    365     $ldq = preg_quote($this->smarty->left_delimiter, '~');
    366     $rdq = preg_quote($this->smarty->right_delimiter, '~');
     389    $ldq = preg_quote($smarty->left_delimiter, '~');
     390    $rdq = preg_quote($smarty->right_delimiter, '~');
    367391
    368392    $regex = "~$ldq *\'([^'$]+)\'\|@translate *$rdq~";
  • trunk/template-common/default-layout.css

    r2480 r2481  
    2727.content DIV.thumbnailCategory DIV.description {
    2828  height: 140px;    /* max thumbnail height + 2px */
    29 }
    30 DIV#comments DIV.comment A.illustration {
    31         width: 140px; /*maximum thumbnail width + ~5px */
    3229}
    3330
  • trunk/template/yoga/comment_list.tpl

    r2480 r2481  
    11{* $Id$ *}
    22{foreach from=$comments item=comment}
    3         <div class="comment" >
    4           {if isset($comment.TN_SRC)}
    5                 <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}" alt="{$comment.ALT}" /></a>
    6           {/if}
    7                 <div class="commentHeader">
     3        <div class="thumbnailCategory">
     4        {if isset($comment.TN_SRC)}
     5                <div class="illustration">
     6                        <a href="{$comment.U_PICTURE}">
     7                                <img src="{$comment.TN_SRC}" alt="{$comment.ALT}" />
     8                        </a>
     9                </div>
     10        {/if}
     11                <div class="description">
    812                        {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) }
    913                        <ul class="actions" style="float:right">
    1014                                {if isset($comment.U_DELETE)}
    11                                   <li>
     15                                <li>
    1216                                        <a href="{$comment.U_DELETE}" title="{'comments_del'|@translate}">
    13                                                 <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" alt="[{'delete'|@translate}]"/>
     17                                                <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" alt="[delete]" />
    1418                                        </a>
    15                                         </li>{/if}
    16 
     19                                </li>
     20                                {/if}
    1721                                {if isset($comment.U_VALIDATE)}
    18                                         <li>
     22                                <li>
    1923                                        <a href="{$comment.U_VALIDATE}" title="validate this comment">
    20                                                 <img src="{$ROOT_URL}{$themeconf.icon_dir}/validate_s.png" class="button" alt="[validate]"/>
     24                                                <img src="{$ROOT_URL}{$themeconf.icon_dir}/validate_s.png" class="button" alt="[validate]" />
    2125                                        </a>
    22                                         </li>{/if}
     26                                </li>
     27                                {/if}
    2328                        </ul>
    2429                        {/if}
    2530                        <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
     31                        <blockquote>{$comment.CONTENT}</blockquote>
    2632                </div>
    27 
    28                 <blockquote>{$comment.CONTENT}</blockquote>
    2933        </div>
     34        {if isset($comment_separator)}
    3035        <hr/>
     36        {/if}
    3137{/foreach}
    32 
  • trunk/template/yoga/content.css

    r2480 r2481  
    7474}
    7575
    76 /* User comments */
    77 
    78 DIV#comments {
    79         padding-left: 5px;
    80         padding-right: 5px;
    81 }
    82 
    83 DIV#comments HR {
    84         clear:both;
    85 }
    86 
    87 DIV#comments DIV.comment A.illustration {
    88         display: block;
    89         float: left;
    90         margin: 0.5em 1em 0 0.5em;
    91         width: 140px;
    92 }
    93 
    9476/* begin chronology/calendar elements*/
    9577.content DIV.calendarViews {
     
    210192        float: left;
    211193}
     194
     195
     196/* User comments */
     197DIV#comments {
     198        padding-left: 5px;
     199        padding-right: 5px;
     200}
     201
     202DIV#comments DIV.description {
     203        font-size: 100%;
     204}
  • trunk/template/yoga/menubar.css

    r2480 r2481  
    1111
    1212#menubar .button {
    13         margin: 0 2px;
     13        margin: 2px 2px ;
    1414        width: auto;
    1515        padding: 0;
  • trunk/template/yoga/not-ie.css

    r2480 r2481  
    88  -webkit-border-radius: 4px; /* Safari webkit project */
    99}
    10 ul.tabsheet li {
    11   -moz-border-radius: 6px 6px 0px 0px;  /* round corners with Geko */
    12   -webkit-border-radius: 6px 6px 0px 0px; /* Safari webkit project */
    13 }
  • trunk/template/yoga/picture.tpl

    r2480 r2481  
    245245{if isset($COMMENT_COUNT)}
    246246<div id="comments">
    247   <h2>[{$COMMENT_COUNT}] {'comments_title'|@translate}</h2>
    248 
    249   <div class="navigationBar">{$COMMENT_NAV_BAR}</div>
    250 
    251   {if isset($comments)}
    252                 {include file='comment_list.tpl'}
    253   {/if}
    254 
    255   {if isset($comment_add)}
    256   <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
    257     <fieldset>
    258       <legend>{'comments_add'|@translate}</legend>
    259       {if $comment_add.SHOW_AUTHOR}
    260       <label>{'upload_author'|@translate}<input type="text" name="author"></label>
    261       {/if}
    262       <label>{'comment'|@translate}<textarea name="content" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
    263       <input type="hidden" name="key" value="{$comment_add.KEY}" />
    264       <input class="submit" type="submit" value="{'Submit'|@translate}">
    265     </fieldset>
    266   </form>
    267   {/if}
    268 
     247        <h3>[{$COMMENT_COUNT}] {'comments_title'|@translate}</h3>
     248
     249        {if !empty($COMMENT_NAV_BAR)}
     250        <div class="navigationBar">{$COMMENT_NAV_BAR}</div>
     251        {/if}
     252
     253        {if isset($comments)}
     254                {include file='comment_list.tpl' comment_separator=true}
     255        {/if}
     256
     257        {if isset($comment_add)}
     258        <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
     259        <fieldset>
     260                <legend>{'comments_add'|@translate}</legend>
     261                {if $comment_add.SHOW_AUTHOR}
     262                <label>{'upload_author'|@translate}<input type="text" name="author"></label>
     263                {/if}
     264                <label>{'comment'|@translate}<textarea name="content" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
     265                <input type="hidden" name="key" value="{$comment_add.KEY}" />
     266                <input class="submit" type="submit" value="{'Submit'|@translate}">
     267        </fieldset>
     268        </form>
     269        {/if}
    269270</div>
    270271{/if} {*comments*}
  • trunk/template/yoga/theme/clear/theme.css

    r2480 r2481  
    44BODY, H1, H2, H3, DT,
    55INPUT.rateButtonSelected /* <= why IE doesn't inherit this ? */ {
    6   color:#696969;        /* dimgray */
     6        color:#696969;  /* dimgray */
    77}
    88
    99/* backgrounds */
    10 BODY, H3, .throw {
    11   background-color: #ffffff;    /* white */
     10BODY, H3 {
     11        background-color: #ffffff;      /* white */
    1212}
    1313
    14 H2, #menubar DT, #imageHeaderBar, #imageToolBar A:hover, .row1 {
    15   background-color: #d3d3d3;
     14H2, #menubar DT, #imageHeaderBar, #imageToolBar A:hover {
     15        background-color: #d3d3d3;
    1616}
    1717
     
    3434
    3535FIELDSET, INPUT, SELECT, TEXTAREA,
    36 .content DIV.comment  A.illustration IMG,
    3736.content DIV.thumbnailCategory {
    3837  border: 1px solid gray;
     
    8180
    8281
    83 UL.tabsheet LI.normal_tab { background-color: #d3d3d3; }
    84 UL.tabsheet LI.selected_tab { background-color: #eeeeee; }
    85 
    86 UL.tabsheet, UL.tabsheet LI {border-color: gray;}
    87 UL.tabsheet LI.normal_tab:hover { border-color: black; }
  • trunk/template/yoga/theme/dark/theme.css

    r2480 r2481  
    77}
    88
    9 H2, #menubar DT, .throw {
     9H2, #menubar DT {
    1010        color: #fff48e;
    1111}
     
    1414/* backgrounds */
    1515
    16 BODY, H3, #imageHeaderBar, #imageToolBar A:hover, .row1, UL.tabsheet LI.normal_tab {
     16BODY, H3, #imageHeaderBar, #imageToolBar A:hover {
    1717        background-color: #2f2f2f;
    1818}
    1919
    20 #menubar DL, .content, #imageToolBar, .header_notes, UL.tabsheet LI.selected_tab {
     20#menubar DL, .content, #imageToolBar, .header_notes {
    2121        background-color: #505050;
    2222}
    2323
    24 H2, #menubar DT, .throw {
     24H2, #menubar DT {
    2525        background-image: url(images/tableh1_bg.png);
    2626}
     
    5151
    5252FIELDSET, INPUT, SELECT, TEXTAREA,
    53 .content DIV.comment  A.illustration IMG,
    5453.content DIV.thumbnailCategory {
    5554        border: 1px solid gray;
     
    6968}
    7069
    71 UL.tabsheet LI.normal_tab:hover { border-color: #fff48e; }
    7270
    7371/* links */
  • trunk/template/yoga/theme/p0w0/theme.css

    r2480 r2481  
    1818/******************************************************************************/
    1919/* Texts Only */
    20 BODY, H1, H3, DT, H2, .throw { color: #369; }
    21 H2, #menubar DT, .throw, TD H3 {
     20BODY, H1, H3, DT, H2 { color: #369; }
     21H2, #menubar DT, TD H3 {
    2222  color: #fff;
    2323}
     
    7272 letter-spacing: 0em;
    7373}
    74 #thePicturePage #comments H2 {
     74#thePicturePage #comments H3 {
    7575  color: #69c;
    7676}
     
    8181  color: #369;
    8282}
    83 .tabsheet li, .tabsheet li a,
    8483.content div.thumbnailCategory .description h3 a {
    8584  color: #fff;
    8685}
    87 .tabsheet li a:hover, .content div.thumbnailCategory .description h3 a:hover {
     86.content div.thumbnailCategory .description h3 a:hover {
    8887  color: #f92;
    8988}
     
    9897.content { background-color: #dfe8ff; }
    9998#the_page { background-color: #dfe8ff; }
    100 #menubar, H3, #imageHeaderBar,
    101 .row1  { background-color: #eef; }
    102 H2, #menubar DT, .throw, TD H3,
     99#menubar, H3, #imageHeaderBar { background-color: #eef; }
     100H2, #menubar DT, TD H3,
    103101#imageToolBar,
    104 #imageHeaderBar, #imageHeaderBar H2, .tabsheet li,
     102#imageHeaderBar, #imageHeaderBar H2,
    105103.content H2 { background-color: #369; }
    106104.content .infos { background-color: #47a; ;}
    107105.content .errors { background-color: #fc5; ;}
    108 #thePicturePage #comments H2 { background-color: #eef; ;}
     106#thePicturePage #comments H3 { background-color: #eef; ;}
    109107.content ul.thumbnailCategories li div.thumbnailCategory .description h3 {
    110108  background-color: #69c;
     
    120118input#qsearchInput { background-color: #cde; }
    121119.virtual_cat { background: #fff !important; }
    122 .selected_tab { background-color: #69c !important; }
    123120/******************************************************************************/
    124121/* Borders, Margins, Padding Only */
     
    159156  padding: 3px 0px 15px 0px;
    160157}
    161 #thePicturePage #comments H2 {
     158#thePicturePage #comments H3 {
    162159  border-top: 2px solid #69c;
    163160  border-bottom: 1px solid #369;
     
    181178}
    182179FIELDSET, INPUT, SELECT, TEXTAREA,
    183 .content DIV.comment  A.illustration IMG,
    184180.content DIV.thumbnailCategory {
    185181  border: 1px solid #69c;
     
    206202  margin: 0px;
    207203}
    208 ul.tabsheet, ul.tabsheet li { border-color: #369 !important; }
    209 .tabsheet li:hover { border-color: #f92 !important; }
    210204
    211205/******************************************************************************/
     
    254248* { outline: none; }
    255249
    256 tr.throw td a { color: #fff; }
    257 tr.throw td a:focus { color: #f92; }
  • trunk/template/yoga/theme/wipi/theme.css

    r2480 r2481  
    1111  border: 0px;
    1212}
    13 H2, .throw {
     13H2 {
    1414  color: #eee;
    1515}
     
    6363  padding: 0px;
    6464}
    65 H3, #imageToolBar A:hover, .row1, .tabsheet li {
     65H3, #imageToolBar A:hover {
    6666  background-color: #222;
    6767}
     
    7373  background-color: #333;
    7474}
    75 .selected_tab { background-color: eee !important; }
    7675A {
    7776  border-color: #69c;
     
    8685}
    8786
    88 H2, #menubar DT, .throw, TD H3 {
     87H2, #menubar DT, TD H3 {
    8988  background-image: url(images/tableh1_bg.png);
    9089  background-repeat: repeat-x;
     
    146145}
    147146
    148 #thePicturePage #comments H2 {
     147#thePicturePage #comments H3 {
    149148  background-image: none;
    150149  background-color: #222;
     
    175174}
    176175FIELDSET, INPUT, SELECT, TEXTAREA,
    177 .content DIV.comment  A.illustration IMG,
    178176.content DIV.thumbnailCategory {
    179177  border: 1px solid gray;
     
    195193}
    196194
    197 #menubar .buttonmenu {
    198   margin: 0 2px;
    199   width: auto;
    200   padding: 0;
    201   text-indent: 0;
    202   list-style: none;
    203   text-align: center;
    204   float: left;
    205 }
    206195/* links */
    207196A, INPUT.rateButton, legend {
     
    287276h2.showtitle, #theImage p.showlegend { display: none }
    288277* { outline-width: 0px; }
    289 ul.tabsheet, ul.tabsheet li {
    290   border-color: #69c;
    291 }
    292 ul.tabsheet li.normal_tab {
    293   background-image: url(images/tableh1_bg.png);
    294   background-repeat: repeat-x;
    295 }
    296 ul.tabsheet li.normal_tab:hover { border-color: #f92 }
    297 ul.tabsheet li {
    298   -moz-border-radius: 0px 0px 3px 3px;
    299   border-radius:  0px 0px 12px 12px;
    300   -webkit-border-radius: 0px 0px 3px 3px;
    301 }
  • trunk/template/yoga/thumbnails.css

    r2352 r2481  
    5151  top: 2px;
    5252}
    53  
    54 UL.thumbnails .levelIndicatorB {
    55 display:block; position:absolute; z-index:100;padding:0px 0 0 14px; color:black; font-weight:bold; fontsize:120%;
    56 }
    57 
    58 UL.thumbnails .levelIndicatorF {
    59 display:block; position:absolute; z-index:101;padding:1px 0 0 15px; color:white; font-weight:bold; fontsize:120%;
    60 }
Note: See TracChangeset for help on using the changeset viewer.