Changeset 5347


Ignore:
Timestamp:
10/22/09 03:54:35 (2 years ago)
Author:
PaulHarvey
Message:

Item2254: First attempt at making TMCE (without forced_root_block: false) and WysiwygPlugin play nice with each other

Location:
branches/scratch/pharvey
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/scratch/pharvey/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm

    r5344 r5347  
    3737dialog_type: "modal", 
    3838extended_valid_elements : "li[type]", 
    39 forced_root_block : false, 
    4039setupcontent_callback : FoswikiTiny.setUpContent, 
    4140urlconverter_callback : "FoswikiTiny.convertLink", 
  • branches/scratch/pharvey/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm

    r5240 r5347  
    4747my $TT2 = chr(2); 
    4848 
     49# SMELL: Item2254: Accomodates a temporary work-around, where TML2HTML 
     50#        needs to wrap content in <div></div> 
     51my $Item2254start = '<div>'; 
     52my $Item2254end = '</div>'; 
     53 
    4954# HTML elements that are palatable to editors. Other HTML tags will be 
    5055# rendered in 'protected' regions to prevent the WYSIWYG editor mussing 
     
    129134 
    130135    # This should really use a template, but what the heck... 
    131     return $content; 
     136    # SMELL: Item2254 - see var declaration up top 
     137    return $Item2254start . $content . $Item2254end; 
     138 
     139    #return $content; 
    132140} 
    133141 
  • branches/scratch/pharvey/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm

    r5310 r5347  
    4141my $CANNOTWYSIWYG = 1 << 3;    # test that notWysiwygEditable returns true 
    4242                               #   and make the ROUNDTRIP test expect failure 
     43 
     44# SMELL: Accomodates the temporary work-around for Item2254, for when TML2HTML 
     45#        is wrapping content in <div></div> 
     46my $Item2254start = '<div>'; 
     47my $Item2254end = '</div>'; 
    4348 
    4449# Note: ROUNDTRIP is *not* the same as the combination of 
     
    21612166        $this->TML_HTMLconverterOptions() 
    21622167    ); 
     2168     
     2169    # SMELL: Item2254 temporary work-around requires TML2HTML to wrap output 
     2170    # in <div></div>. 
     2171    if (($Item2254start) and ($Item2254end)) { 
     2172      $tx = ($tx =~ /^$Item2254start(.*)$Item2254end$/mxs)[0]; 
     2173    } 
    21632174 
    21642175    $this->assert_html_equals( $html, $tx ); 
  • branches/scratch/pharvey/WysiwygPlugin/test/unit/WysiwygPlugin/WysiwygPluginTests.pm

    r4645 r5347  
    3131my $UI_FN; 
    3232 
     33# SMELL: Accomodates the temporary work-around for Item2254, for when TML2HTML 
     34#        is wrapping content in <div></div> 
     35my $Item2254start = '<div>'; 
     36my $Item2254end = '</div>'; 
     37 
    3338sub new { 
    3439    my $self = shift()->SUPER::new(@_); 
     
    164169 
    165170    $out = Encode::decode_utf8($out); 
    166  
     171     
    167172    my $id = "<!--$Foswiki::Plugins::WysiwygPlugin::SECRET_ID-->"; 
    168     $this->assert( $out =~ s/^\s*$id<p>\s*//s, anal($out) ); 
    169     $out =~ s/\s*<\/p>\s*$//s; 
     173    $this->assert( $out =~ s/^\s*$id$Item2254start<p>\s*//s, anal($out) ); 
     174    $out =~ s/\s*<\/p>$Item2254end\s*$//s; 
    170175 
    171176    require Foswiki::Plugins::WysiwygPlugin::Constants; 
Note: See TracChangeset for help on using the changeset viewer.