Changeset 2518

Show
Ignore:
Timestamp:
04/09/05 04:07:23 (3 years ago)
Author:
eridius
Message:

Fix problem when switching back to default variant for a style in a build with WebKitVersion146 enabled
This problem was introduced in [2516] when I modified the variant and emoticon methods to use the new DOM methods when WebKitVersion146 is enabled - I forgot to mention that in the log

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Colloquy.pch

    r2367 r2518  
    44#import <AGRegex/AGRegex.h> 
    55 
    6 //#define WebKitVersion146 1 
     6#define WebKitVersion146 1 
    77#endif 
  • trunk/JVStyleView.m

    r2516 r2518  
    170170        if( _webViewReady ) { 
    171171#ifdef WebKitVersion146 
    172                 if( [self respondsToSelector:@selector( windowScriptObject )] ) 
    173                         [[self windowScriptObject] callWebScriptMethod:@"setStylesheet" withArguments:[NSArray arrayWithObjects:@"variantStyle", [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString], nil]]; 
    174                 else 
     172                if( [self respondsToSelector:@selector( windowScriptObject )] ) { 
     173                        NSString *styleSheetLocation = [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]; 
     174                        if( ! styleSheetLocation ) styleSheetLocation = @""; 
     175                        [[self windowScriptObject] callWebScriptMethod:@"setStylesheet" withArguments:[NSArray arrayWithObjects:@"variantStyle", styleSheetLocation, nil]]; 
     176                } else 
    175177#endif 
    176178                [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"variantStyle\", \"%@\" );", [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]]]; 
     
    201203        if( _webViewReady ) 
    202204#ifdef WebKitVersion146 
    203                 if( [self respondsToSelector:@selector( webScriptObject )] ) 
    204                         [[self windowScriptObject] callWebScriptMethod:@"setStylesheet" withArguments:[NSArray arrayWithObjects:@"emoticonStyle", [[[self emoticons] styleSheetLocation] absoluteString], nil]]; 
    205                 else 
     205                if( [self respondsToSelector:@selector( webScriptObject )] ) { 
     206                        NSString *styleSheetLocation = [[[self emoticons] styleSheetLocation] absoluteString]; 
     207                        if( ! styleSheetLocation ) styleSheetLocation = @""; 
     208                        [[self windowScriptObject] callWebScriptMethod:@"setStylesheet" withArguments:[NSArray arrayWithObjects:@"emoticonStyle", styleSheetLocation, nil]]; 
     209                } else 
    206210#endif 
    207211                [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"emoticonStyle\", \"%@\" );", [[[self emoticons] styleSheetLocation] absoluteString]]];