Ignore:
Timestamp:
04/10/09 10:37:08 (3 years ago)
Author:
CrawfordCurrie
Message:

Item1394: fixed colour handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm

    r2957 r3396  
    44 
    55use strict; 
    6  
    7 our ( %ALWAYS_BLOCK, $ALWAYS_BLOCK_S, $STARTWW, $ENDWW, $PROTOCOL ); 
    86 
    97# HTML elements that are strictly block type, as defined by 
     
    119# Block type elements do not require 
    1210# <br /> to be generated for newlines on the boundary - see WC::isInline. 
    13 %ALWAYS_BLOCK = map { $_ => 1 } 
     11our %ALWAYS_BLOCK = map { $_ => 1 } 
    1412  qw( ADDRESS BLOCKQUOTE CENTER DIR DIV DL FIELDSET FORM H1 H2 H3 H4 H5 H6 
    1513  HR ISINDEX MENU NOFRAMES NOSCRIPT OL P PRE TABLE UL ); 
    16 $ALWAYS_BLOCK_S = join( '|', keys %ALWAYS_BLOCK ); 
    17  
    18 $STARTWW  = qr/^|(?<=[ \t\n\(\!])/om; 
    19 $ENDWW    = qr/$|(?=[ \t\n\,\.\;\:\!\?\)])/om; 
    20 $PROTOCOL = qr/^(file|ftp|gopher|https?|irc|news|nntp|telnet|mailto):/; 
    21  
    22 our (%KNOWN_COLOUR); 
    23  
    24 # Colours with colour settings in DefaultPreferences. WTF does Foswiki see 
    25 # fit to *redefine* the standard colors? e.g. ORANGE below is *not* orange. 
    26 # For goodness sakes! 
    27 %KNOWN_COLOUR = ( 
     14our $ALWAYS_BLOCK_S = join( '|', keys %ALWAYS_BLOCK ); 
     15 
     16our $STARTWW  = qr/^|(?<=[ \t\n\(\!])/om; 
     17our $ENDWW    = qr/$|(?=[ \t\n\,\.\;\:\!\?\)])/om; 
     18our $PROTOCOL = qr/^(file|ftp|gopher|https?|irc|news|nntp|telnet|mailto):/; 
     19 
     20# Colours with colour settings in DefaultPreferences. 
     21our @TML_COLOURS = ( 
     22    'BLACK',  'MAROON', 'PURPLE', 'PINK',       'RED',   'ORANGE', 
     23    'YELLOW', 'LIME',   'AQUA',   'AQUAMARINE', 'GREEN', 'OLIVE', 
     24    'BROWN',  'NAVY',   'TEAL',   'BLUE',       'GRAY',  'SILVER', 
     25    'WHITE', 
     26); 
     27 
     28# Map of possible colours back to TML %COLOUR%...%ENDCOLOR% 
     29our %HTML2TML_COLOURMAP = ( 
    2830    BLACK      => 'BLACK', 
    2931    '#000000'  => 'BLACK', 
     
    3234    PURPLE     => 'PURPLE', 
    3335    '#800080'  => 'PURPLE', 
    34     PINK       => 'PINK', 
     36    FUCHSIA    => 'PINK', 
    3537    '#FF00FF'  => 'PINK', 
    3638    RED        => 'RED', 
     
    3840    ORANGE     => 'ORANGE', 
    3941    '#FF6600'  => 'ORANGE', 
    40     '#FFA500'  => 'ORANGE',    # HTML standard 
    4142    YELLOW     => 'YELLOW', 
    4243    '#FFFF00'  => 'YELLOW', 
     
    5253    BROWN      => 'BROWN', 
    5354    '#996633'  => 'BROWN', 
    54     '#A52A2A'  => 'BROWN',     # HTML standard 
    5555    NAVY       => 'NAVY', 
    5656    '#000080'  => 'NAVY', 
Note: See TracChangeset for help on using the changeset viewer.