Show
Ignore:
Timestamp:
04/23/07 20:48:15 (3 years ago)
Author:
eevee
Message:

Fixed: bbcode stylesheet was not being loaded.
Changed: Stylesheet variables are now available to all stylesheets.
Styled forum reply form.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/BBCode.pm

    r38 r111  
    3333#  - replace won't work with no_close 
    3434our %tags = ( 
    35     b       => { param => 0, start => '<strong class="bbcode_b">', end => '</strong>' }, 
    36     i       => { param => 0, start => '<em class="bbcode_i">', end => '</em>' }, 
    37     u       => { param => 0, start => '<span class="bbcode_u">', end => '</span>' }, 
    38     s       => { param => 0, start => '<span class="bbcode_s">', end => '</span>' }, 
    39     h       => { param => 0, start => '<span class="bbcode_h">', end => '</span>' }, 
     35    b       => { param => 0, start => '<strong class="bbcode-b">', end => '</strong>' }, 
     36    i       => { param => 0, start => '<em class="bbcode-i">', end => '</em>' }, 
     37    u       => { param => 0, start => '<span class="bbcode-u">', end => '</span>' }, 
     38    s       => { param => 0, start => '<span class="bbcode-s">', end => '</span>' }, 
     39    h       => { param => 0, start => '<span class="bbcode-h">', end => '</span>' }, 
    4040    color   => { param => 2, strip_quotes => 1, start => sub { 
    4141        my $color = shift; 
     
    4747            | [a-z]+[0-9]* 
    4848         /ix) { $color = 'inherit' } 
    49         qq'<span class="bbcode_color" style="color: $color;">' 
     49        qq'<span class="bbcode-color" style="color: $color;">' 
    5050    }, end => '</span>' }, 
    5151#    size    => { param => 2, }, 
    52     url     => { param => 1, strip_quotes => 1, replace => sub { qq'<a href="@{[ $_[0] ? $_[0] : $_[1] ]}" class="bbcode_url">$_[1]</a>' }  }, 
    53     img     => { param => 1, strip_quotes => 1, raw => 1, start => sub { $_[0] ? qq'<img src="$_[0]" alt="' : '<img alt="" src="' }, end => '" class="bbcode_img"/>' }, 
    54     code    => { param => 1, raw => 1, start => sub { '<span class="bbcode_code_header">' . ($_[0] ? "Code for $_[0]" : 'Code') . ':</span><span class="bbcode_code">' }, end => '</span>' }, 
    55     quote   => { param => 1, start => sub { '<fieldset class="bbcode_quote"><legend class="bbcode_quote_header">' . ($_[0] ? "Quote from $_[0]" : 'Quote') . ':</legend>' }, end => '</fieldset>' }, 
    56     mono    => { param => 1, start => '<span class="bbcode_prop">', end => '</span>' }, 
     52    url     => { param => 1, strip_quotes => 1, replace => sub { qq'<a href="@{[ $_[0] ? $_[0] : $_[1] ]}" class="bbcode-url">$_[1]</a>' }  }, 
     53    img     => { param => 1, strip_quotes => 1, raw => 1, start => sub { $_[0] ? qq'<img src="$_[0]" alt="' : '<img alt="" src="' }, end => '" class="bbcode-img"/>' }, 
     54    code    => { param => 1, raw => 1, start => sub { '<div class="bbcode-code-heading">' . ($_[0] ? "Code for $_[0]" : 'Code') . ':</div><div class="bbcode-code">' }, end => '</div>' }, 
     55    quote   => { param => 1, start => sub { '<div class="bbcode-quote-heading">' . ($_[0] ? "Quote from $_[0]" : 'Quote') . ':</div><div class="bbcode-quote">' }, end => '</div>' }, 
     56    mono    => { param => 1, start => '<span class="bbcode-prop">', end => '</span>' }, 
    5757    raw     => { param => 1, raw => 1, start => '', end => '' }, 
    58     hr      => { param => 0, no_close => 1, start => '<hr class="bbcode_hr"/>' }, 
    59     center  => { param => 0, no_close => 0, start => '<div class="bbcode_center">', end => '</div>' }, 
     58    hr      => { param => 0, no_close => 1, start => '<hr class="bbcode-hr"/>' }, 
     59    center  => { param => 0, no_close => 0, start => '<div class="bbcode-center">', end => '</div>' }, 
    6060#    list    => { param => 1, contents => { '*' => 1 }, }, 
    6161#    '*'     => { param => 0, container => { list => 1 }, self_closing => 1, }, 
     
    192192 
    193193                push @errors, [ "Tag '$tag_name' not closed before parent tag '$next_tag'", $left_bracket ]; 
    194                 $output[-1] .= qq'<span class="bbcode_error_wrongorder">[/$tag_name]</span>'; 
     194                $output[-1] .= qq'<span class="bbcode-error-wrongorder">[/$tag_name]</span>'; 
    195195            } 
    196196 
     
    198198                # we have run out of initial closing tags!  replace this with something temporary for now 
    199199                push @errors, [ "Tag '$tag_name' closed but not open", $left_bracket ]; 
    200                 $output[-1] .= qq'<span class="bbcode_error_notopen">[/$tag_name]</span>'; 
     200                $output[-1] .= qq'<span class="bbcode-error-notopen">[/$tag_name]</span>'; 
    201201                next PARSE; 
    202202            }