Changeset 2815

Show
Ignore:
Timestamp:
07/01/05 20:12:12 (3 years ago)
Author:
timothy
Message:

Various cleanup things.

  • More window frame saving improvements for all possible situations.
    • Dragging a tab off to make a new window will make the new window in the correct spot.
    • Panels that are told to make new windows in the interface prefs will remember position now. This also applies to panel rules attached to the Focused Window proxy.
    • Dragging a tab from a single panel window will simple move that window, not detach and reattach. (Tab dragging really needs work, it is very hacky and the drag image doesn't match the main window exactly.)
  • Removed some 10.3 ifdefs since building on 10.3 is not possible anymore.
  • Removed some WebKit? version ifdefs for the same reason.
  • Changed how we poke holes in windows, more direct now. Turned off NSScrollView "draws background" option for any place it encloses a WebView?. This make transparent styles work in Transcripts and Smart Transcripts.
  • Fixed the Appearance preferences preview area so it doesn't clip part of the scroller.
Files:

Legend:

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

    r2796 r2815  
    77#import <ChatCore/ChatCore.h> 
    88 
    9 #ifdef NSAppKitVersionNumber10_3 
    10 #define WebKitVersion146 1 
    119#endif 
    1210 
    13 #endif 
    14  
    15 #ifdef NSAppKitVersionNumber10_3 
    1611#include <sys/xattr.h> 
    17 #endif 
    1812 
    1913// define these here so they weak link for Panther letting the binary be backwards compatible 
  • trunk/JVAppearancePreferences.m

    r2796 r2815  
    106106 
    107107- (void) awakeFromNib { 
    108         [(NSClipView *)[preview superview] setBackgroundColor:[NSColor clearColor]]; // allows rgba backgrounds to see through to the Desktop 
    109         [(NSScrollView *)[(NSClipView *)[preview superview] superview] setBackgroundColor:[NSColor clearColor]]; 
    110108        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( styleDidReload: ) name:JVStyleViewDidChangeStylesNotification object:preview]; 
    111109 
    112 #ifdef NSAppKitVersionNumber10_3 
    113         if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 
     110        if( [[preview window] respondsToSelector:@selector( _setContentHasShadow: )] ) 
    114111                [[preview window] _setContentHasShadow:NO]; // this is new in Tiger 
    115 #endif 
    116112} 
    117113 
  • trunk/JVChatController.m

    r2809 r2815  
    168168 
    169169        [windowController addChatViewController:controller]; 
    170         if( initiated || [[windowController allChatViewControllers] count] == 1 ) { 
     170 
     171        if( initiated || [[windowController allChatViewControllers] count] == 1 ) 
    171172                [windowController showChatViewController:controller]; 
    172                 if( initiated ) [[windowController window] makeKeyAndOrderFront:nil]; 
    173         } 
    174  
    175         if( ! [[windowController window] isVisible] ) 
    176                 [[windowController window] orderFront:nil];      
     173 
     174        if( initiated ) [windowController showWindow:nil]; 
    177175} 
    178176 
  • trunk/JVChatTranscript.m

    r2796 r2815  
    633633                [self _incrementalWriteToLog:root continuation:( parent ? YES : NO )]; 
    634634 
    635 #ifdef NSAppKitVersionNumber10_3 
    636                 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 && _logFile && fsetxattr != NULL ) { 
     635                if( _logFile && fsetxattr ) { 
    637636                        NSString *lastDateString = [[message date] description]; 
    638637                        fsetxattr( [_logFile fileDescriptor], "lastMessageDate", [lastDateString UTF8String], [lastDateString length], 0, 0 ); 
    639638                } 
    640 #endif 
    641639 
    642640                _requiresNewEnvelope = NO; 
     
    11411139        [[NSFileManager defaultManager] changeFileAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSFileExtensionHidden, [NSNumber numberWithUnsignedLong:'coTr'], NSFileHFSTypeCode, [NSNumber numberWithUnsignedLong:'coRC'], NSFileHFSCreatorCode, nil] atPath:path]; 
    11421140 
    1143 #ifdef NSAppKitVersionNumber10_3 
    1144         if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 && _logFile && fsetxattr != NULL ) { 
     1141        if( _logFile && fsetxattr ) { 
    11451142                NSString *beganDateString = [[self dateBegan] description]; 
    11461143                NSString *lastDateString = [[[self lastMessage] date] description]; 
     
    11541151                if( [lastDateString length] ) fsetxattr( [_logFile fileDescriptor], "lastMessageDate", [lastDateString UTF8String], [lastDateString length], 0, 0 ); 
    11551152        } 
    1156 #endif 
    11571153} 
    11581154@end 
  • trunk/JVChatTranscriptBrowserPanel.m

    r2680 r2815  
    9595                                NSString *path = [[self logsPath] stringByAppendingPathComponent:logPath]; 
    9696 
    97 #ifdef NSAppKitVersionNumber10_3 
    98                                 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) { 
     97                                if( fgetxattr ) { 
    9998                                        FILE *logsFile = fopen( [path fileSystemRepresentation], "r" ); 
    10099                                        if( logsFile ) { 
     
    122121                                        } 
    123122                                } 
    124 #endif 
    125123 
    126124                                NSDictionary *d = [NSDictionary dictionaryWithObjectsAndKeys:server, @"server", target, @"target", session, @"session", path, @"path", nil]; 
  • trunk/JVChatTranscriptPanel.m

    r2796 r2815  
    436436                NSSearchField *field = [[[NSSearchField alloc] initWithFrame:NSMakeRect( 0., 0., 150., 22. )] autorelease]; 
    437437                [[field cell] setSendsWholeSearchString:NO]; 
    438 #ifdef NSAppKitVersionNumber10_3 
    439                 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 
     438                if( [[field cell] respondsToSelector:@selector( setSendsSearchStringImmediately: )] ) 
    440439                        [[field cell] setSendsSearchStringImmediately:NO]; 
    441 #endif 
    442440                [[field cell] setPlaceholderString:NSLocalizedString( @"Search Messages", "search field placeholder string" )]; 
    443441                [[field cell] setMaximumRecents:10]; 
     
    556554#pragma mark - 
    557555#pragma mark WebView 
    558  
    559 // Allows some simple code to work when not built with WebKit/Safari 1.3 
    560 #ifndef WebKitVersion146 
    561 #define WebMenuItemTagGoBack 9 
    562 #define WebMenuItemTagGoForward 10 
    563 #define WebMenuItemTagStop 11 
    564 #define WebMenuItemTagReload 12 
    565 #endif 
    566556 
    567557- (JVStyleView *) display { 
  • trunk/JVChatWindowController.h

    r2797 r2815  
    2222        id <JVChatViewController> _activeViewController; 
    2323        BOOL _usesSmallIcons; 
     24        BOOL _showDelayed; 
    2425} 
    2526- (NSString *) identifier; 
  • trunk/JVChatWindowController.m

    r2814 r2815  
    7878        [favoritesButton setMenu:[MVConnectionsController favoritesMenu]]; 
    7979 
    80         if( [[self identifier] length] ) { 
    81                 NSString *frameName = [NSString stringWithFormat:@"Chat Window %@", [self identifier]]; 
    82                 [self setShouldCascadeWindows:NO]; 
    83                 [[self window] setFrameUsingName:frameName]; 
    84                 [[self window] setFrameAutosaveName:frameName]; 
    85         } else { 
    86                 [self setShouldCascadeWindows:YES]; 
    87                 [[self window] setFrameUsingName:@"Chat Window"]; 
    88                 [[self window] setFrameAutosaveName:@"Chat Window"]; 
    89         } 
     80        [self setShouldCascadeWindows:NO]; 
     81        [self setWindowFrameAutosaveName:@""]; 
     82 
     83        [[self window] setDelegate:nil]; // so we don't act on the windowDidResize notification 
     84        [[self window] setFrameUsingName:@"Chat Window"]; 
     85 
     86        NSRect frame = [[self window] frame]; 
     87        NSPoint point = [[self window] cascadeTopLeftFromPoint:NSMakePoint( NSMinX( frame ), NSMaxY( frame ) )]; 
     88        [[self window] setFrameTopLeftPoint:point]; 
     89 
     90        [[self window] setDelegate:self]; 
    9091 
    9192        [[self window] useOptimizedDrawing:YES]; 
    9293        [[self window] setOpaque:NO]; // let us poke transparant holes in the window 
    9394 
    94 #ifdef NSAppKitVersionNumber10_3 
    95         if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 
     95        if( [[self window] respondsToSelector:@selector( _setContentHasShadow: )] ) 
    9696                [[self window] _setContentHasShadow:NO]; // this is new in Tiger 
    97 #endif 
    9897 
    9998        [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector( _refreshPreferences ) object:nil]; 
     
    128127        _identifier = nil; 
    129128        _settings = nil; 
     129        _showDelayed = NO; 
    130130 
    131131        [super dealloc]; 
     
    165165        _settings = [[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]] retain]; 
    166166 
    167         if( [identifier length] ) 
    168                 [[self window] setFrameAutosaveName:[NSString stringWithFormat:@"Chat Window %@", identifier]]; 
    169         else [[self window] setFrameAutosaveName:@"Chat Window"]; 
     167        if( [[self identifier] length] ) { 
     168                [[self window] setDelegate:nil]; // so we don't act on the windowDidResize notification 
     169                [[self window] setFrameUsingName:[NSString stringWithFormat:@"Chat Window %@", [self identifier]]]; 
     170                [[self window] setDelegate:self]; 
     171        } 
    170172 
    171173        [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector( _refreshPreferences ) object:nil]; 
     
    200202 
    201203#pragma mark - 
     204 
     205- (void) showWindow:(id) sender { 
     206        if( [_views count] ) { 
     207                [[self window] makeKeyAndOrderFront:nil]; 
     208                _showDelayed = NO; 
     209        } else _showDelayed = YES; 
     210} 
    202211 
    203212- (void) showChatViewController:(id <JVChatViewController>) controller { 
     
    330339        NSAssert( index >= 0 && index <= [_views count], @"Index is beyond bounds." ); 
    331340 
    332         if( ! [_views count] ) { 
    333                 [[self  window] orderWindow:NSWindowBelow relativeTo:[[[NSApplication sharedApplication] keyWindow] windowNumber]]; 
    334         } 
     341        BOOL needShow = ( ! [_views count] ); 
    335342 
    336343        [_views insertObject:controller atIndex:index]; 
    337344        [controller setWindowController:self]; 
     345 
     346        if( ! [[self identifier] length] && [_views count] == 1 ) { 
     347                [[self window] setDelegate:nil]; // so we don't act on the windowDidResize notification 
     348                [[self window] setFrameUsingName:[NSString stringWithFormat:@"Chat Window %@", [controller identifier]]]; 
     349                [[self window] setDelegate:self]; 
     350        } 
     351 
     352        if( needShow && ! _showDelayed ) 
     353                [[self  window] orderWindow:NSWindowBelow relativeTo:[[[NSApplication sharedApplication] keyWindow] windowNumber]]; 
     354 
     355        if( _showDelayed ) [self showWindow:nil]; 
    338356 
    339357        [self _saveWindowFrame]; 
     
    940958 
    941959- (void) _saveWindowFrame { 
    942         if( ! [[[self window] frameAutosaveName] length] ) { 
     960        if( [[self identifier] length] ) { 
     961                [[self window] saveFrameUsingName:@"Chat Window"]; 
     962                [[self window] saveFrameUsingName:[NSString stringWithFormat:@"Chat Window %@", [self identifier]]]; 
     963        } else { 
    943964                NSEnumerator *enumerator = [[self allChatViewControllers] objectEnumerator]; 
    944965                id <JVChatViewController> controller = nil; 
     966 
     967                [[self window] saveFrameUsingName:@"Chat Window"]; 
    945968 
    946969                while( ( controller = [enumerator nextObject] ) ) 
  • trunk/JVDirectChatPanel.m

    r2809 r2815  
    230230        JVEmoticonSet *emoticon = nil; 
    231231 
    232         [(NSClipView *)[display superview] setBackgroundColor:[NSColor clearColor]]; // allows rgba backgrounds to see through to the Desktop 
    233         [(NSScrollView *)[(NSClipView *)[display superview] superview] setBackgroundColor:[NSColor clearColor]]; 
    234  
    235232        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidConnectNotification object:[self connection]]; 
    236233        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidDisconnectNotification object:[self connection]]; 
  • trunk/JVStyleView.m

    r2813 r2815  
    178178                [WebCoreCache empty]; 
    179179 
    180 #ifdef WebKitVersion146 
    181180                if( _newWebKit ) { 
    182181                        NSString *styleSheetLocation = [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]; 
     
    184183                        if( ! styleSheetLocation ) [element setHref:@""]; 
    185184                        else [element setHref:styleSheetLocation]; 
    186                 } else 
    187 #endif 
    188                 [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"variantStyle\", \"%@\" );", [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]]]; 
     185                } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"variantStyle\", \"%@\" );", [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]]]; 
    189186 
    190187                [self performSelector:@selector( _checkForTransparantStyle ) withObject:nil afterDelay:0.]; 
     
    218215                [WebCoreCache empty]; 
    219216 
    220 #ifdef WebKitVersion146 
    221217                if( _newWebKit ) { 
    222218                        NSString *styleSheetLocation = [[[self emoticons] styleSheetLocation] absoluteString]; 
     
    224220                        if( ! styleSheetLocation ) [element setHref:@""]; 
    225221                        else [element setHref:styleSheetLocation]; 
    226                 } else 
    227 #endif 
    228                 [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"emoticonStyle\", \"%@\" );", [[[self emoticons] styleSheetLocation] absoluteString]]]; 
     222                } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setStylesheet( \"emoticonStyle\", \"%@\" );", [[[self emoticons] styleSheetLocation] absoluteString]]]; 
    229223        } else { 
    230224                [self performSelector:_cmd withObject:emoticons afterDelay:0.]; 
     
    268262                unsigned int location = 0; 
    269263 
    270 #ifdef WebKitVersion146 
    271264                if( _newWebKit ) { 
    272265                        DOMDocument *doc = [[self mainFrame] DOMDocument]; 
     
    278271                        [self scrollToBottom]; 
    279272                        location = [[elt valueForKey:@"offsetTop"] intValue]; 
    280                 } else 
    281 #endif 
    282                 location = [[self stringByEvaluatingJavaScriptFromString:@"mark();"] intValue]; 
     273                } else location = [[self stringByEvaluatingJavaScriptFromString:@"mark();"] intValue]; 
    283274 
    284275                [[self verticalMarkedScroller] removeMarkWithIdentifier:@"mark"]; 
     
    297288 
    298289        if( _webViewReady ) { 
    299 #ifdef WebKitVersion146 
    300290                if( _newWebKit ) { 
    301291                        [[self windowScriptObject] callWebScriptMethod:@"showTopic" withArguments:[NSArray arrayWithObject:topic]]; 
    302292                } else { 
    303 #endif 
    304293                        NSMutableString *mutTopic = [topic mutableCopy]; 
    305294                        [mutTopic replaceOccurrencesOfString:@"\"" withString:@"\\\"" options:NSLiteralSearch range:NSMakeRange(0, [mutTopic length])]; 
    306295                        [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"showTopic( \"%@\" );", mutTopic]]; 
    307 #ifdef WebKitVersion146 
    308296                } 
    309 #endif 
    310297        } else { 
    311298                [self performSelector:_cmd withObject:topic afterDelay:0.]; 
     
    315302- (void) hideTopic { 
    316303        if( _webViewReady ) { 
    317 #ifdef WebKitVersion146 
    318                 if( _newWebKit ) 
    319                         [[self windowScriptObject] callWebScriptMethod:@"hideTopic" withArguments:[NSArray array]]; 
    320                 else 
    321 #endif 
    322                         [self stringByEvaluatingJavaScriptFromString:@"hideTopic();"]; 
     304                if( _newWebKit ) [[self windowScriptObject] callWebScriptMethod:@"hideTopic" withArguments:[NSArray array]]; 
     305                else [self stringByEvaluatingJavaScriptFromString:@"hideTopic();"]; 
    323306        } else { 
    324307                [self performSelector:_cmd withObject:nil afterDelay:0.]; 
     
    328311- (void) toggleTopic:(NSString *) topic { 
    329312        if( _webViewReady ) { 
    330                 BOOL topicShowing; 
    331 #ifdef WebKitVersion146 
     313                BOOL topicShowing = NO; 
    332314                if( _newWebKit ) { 
    333315                        DOMHTMLElement *topicElement = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:@"topic-floater"]; 
    334316                        topicShowing = ( topicElement != nil ); 
    335317                } else { 
    336 #endif 
    337318                        NSString *result = [self stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"topic-floater\") != null"]; 
    338319                        topicShowing = [result isEqualToString:@"true"]; 
    339 #ifdef WebKitVersion146 
    340320                } 
    341 #endif 
     321 
    342322                if( topicShowing ) [self hideTopic]; 
    343323                else [self showTopic:topic]; 
     
    354334        NSString *result = nil; 
    355335 
    356 #ifdef WebKitVersion146 
    357336        if( _requiresFullMessage && _newWebKit ) { 
    358337                DOMHTMLElement *replaceElement = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:@"consecutiveInsert"]; 
    359338                if( replaceElement ) _requiresFullMessage = NO; // a full message was assumed, but we can do a consecutive one 
    360339        } 
    361 #endif 
    362340 
    363341        @try { 
     
    401379 
    402380- (void) highlightMessage:(JVChatMessage *) message { 
    403 /*#ifdef WebKitVersion146 
    404         if( _newWebKit ) { 
     381/*      if( _newWebKit ) { 
    405382                DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:[message messageIdentifier]]; 
    406383                NSString *class = [element className]; 
     
    408385                if( [class length] ) [element setClassName:[class stringByAppendingString:@" searchHighlight"]]; 
    409386                else [element setClassName:@"searchHighlight"]; 
    410         } else 
    411 #endif 
    412         [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"highlightMessage('%@');", [message messageIdentifier]]]; 
     387        } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"highlightMessage('%@');", [message messageIdentifier]]]; 
    413388*/} 
    414389 
    415390- (void) clearHighlightForMessage:(JVChatMessage *) message { 
    416 /*#ifdef WebKitVersion146 
    417         if( _newWebKit ) { 
     391/*      if( _newWebKit ) { 
    418392                DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:[message messageIdentifier]]; 
    419393                NSMutableString *class = [[[element className] mutableCopy] autorelease]; 
    420394                [class replaceOccurrencesOfString:@"searchHighlight" withString:@"" options:NSLiteralSearch range:NSMakeRange( 0, [class length] )]; 
    421395                [element setClassName:class]; 
    422         } else 
    423 #endif 
    424         [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetHighlightMessage('%@');", [message messageIdentifier]]]; 
     396        } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetHighlightMessage('%@');", [message messageIdentifier]]]; 
    425397*/} 
    426398 
    427399- (void) clearAllMessageHighlights { 
    428 /*#ifdef WebKitVersion146 
    429         if( _newWebKit ) { 
     400/*      if( _newWebKit ) { 
    430401                [[self windowScriptObject] callWebScriptMethod:@"resetHighlightMessage" withArguments:[NSArray arrayWithObject:[NSNull null]]]; 
    431         } else 
    432 #endif 
    433         [self stringByEvaluatingJavaScriptFromString:@"resetHighlightMessage(null);"]; 
     402        } else [self stringByEvaluatingJavaScriptFromString:@"resetHighlightMessage(null);"]; 
    434403*/} 
    435404 
     
    437406 
    438407- (void) highlightString:(NSString *) string inMessage:(JVChatMessage *) message { 
    439 #ifdef WebKitVersion146 
    440408        if( _newWebKit ) { 
    441409                [[self windowScriptObject] callWebScriptMethod:@"searchHighlight" withArguments:[NSArray arrayWithObjects:[message messageIdentifier], string, nil]]; 
    442         } else 
    443 #endif 
    444         [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"searchHighlight('%@','%@');", [message messageIdentifier], string]]; 
     410        } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"searchHighlight('%@','%@');", [message messageIdentifier], string]]; 
    445411} 
    446412 
    447413- (void) clearStringHighlightsForMessage:(JVChatMessage *) message { 
    448 #ifdef WebKitVersion146 
    449414        if( _newWebKit ) { 
    450415                [[self windowScriptObject] callWebScriptMethod:@"resetSearchHighlight" withArguments:[NSArray arrayWithObject:[message messageIdentifier]]]; 
    451         } else 
    452 #endif 
    453         [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetSearchHighlight('%@');", [message messageIdentifier]]]; 
     416        } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetSearchHighlight('%@');", [message messageIdentifier]]]; 
    454417} 
    455418 
    456419- (void) clearAllStringHighlights { 
    457 #ifdef WebKitVersion146 
    458420        if( _newWebKit ) { 
    459421                [[self windowScriptObject] callWebScriptMethod:@"resetSearchHighlight" withArguments:[NSArray arrayWithObject:[NSNull null]]]; 
    460         } else 
    461 #endif 
    462         [self stringByEvaluatingJavaScriptFromString:@"resetSearchHighlight(null);"]; 
     422        } else [self stringByEvaluatingJavaScriptFromString:@"resetSearchHighlight(null);"]; 
    463423} 
    464424 
     
    526486 
    527487        [self performSelector:@selector( _webkitIsReady ) withObject:nil afterDelay:0.]; 
     488} 
     489 
     490- (void) drawRect:(NSRect) rect { 
     491        [[NSColor clearColor] set]; 
     492        NSRectFill( rect ); // allows poking holes in the window with rgba background colors 
     493        [super drawRect:rect]; 
    528494} 
    529495 
     
    572538        } 
    573539 
    574 #ifdef WebKitVersion146 
    575540        if( _newWebKit ) { 
    576541                DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 
    577542                [body setValue:[body valueForKey:@"offsetHeight"] forKey:@"scrollTop"]; 
    578         } else 
    579 #endif 
    580         [self stringByEvaluatingJavaScriptFromString:@"scrollToBottom();"]; 
     543        } else [self stringByEvaluatingJavaScriptFromString:@"scrollToBottom();"]; 
    581544} 
    582545@end 
     
    586549@implementation JVStyleView (JVStyleViewPrivate) 
    587550- (void) _checkForTransparantStyle { 
    588 #ifdef WebKitVersion146 
    589551        if( _newWebKit ) { 
    590552                DOMCSSStyleDeclaration *style = [self computedStyleForElement:[(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body] pseudoElement:nil]; 
     
    596558                [self setNeedsDisplay:YES]; 
    597559        } 
    598 #endif 
    599560} 
    600561 
     
    613574        _webViewReady = NO; 
    614575        if( _rememberScrollPosition ) { 
    615 #ifdef WebKitVersion146 
    616576                if( _newWebKit ) { 
    617577                        DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 
    618578                        _lastScrollPosition = [[body valueForKey:@"scrollTop"] intValue]; 
    619                 } else 
    620 #endif 
    621                 _lastScrollPosition = [[self stringByEvaluatingJavaScriptFromString:@"document.body.scrollTop"] intValue]; 
     579                } else _lastScrollPosition = [[self stringByEvaluatingJavaScriptFromString:@"document.body.scrollTop"] intValue]; 
    622580        } else _lastScrollPosition = 0; 
    623581 
     
    688646        if( _rememberScrollPosition ) { 
    689647                _rememberScrollPosition = NO; 
    690 #ifdef WebKitVersion146 
    691648                if( _newWebKit ) { 
    692649                        DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 
    693650                        [body setValue:[NSNumber numberWithUnsignedInt:_lastScrollPosition] forKey:@"scrollTop"]; 
    694                 } else 
    695 #endif 
    696                 [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.body.scrollTop = %d", _lastScrollPosition]]; 
     651                } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.body.scrollTop = %d", _lastScrollPosition]]; 
    697652        } 
    698653} 
     
    708663        } 
    709664 
    710 #ifdef WebKitVersion146 
    711665        if( _newWebKit ) { 
    712666                DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] createElement:@"span"]; 
     
    757711                if( [scrollNeeded respondsToSelector:@selector( boolValue )] && [scrollNeeded boolValue] ) 
    758712                        [self scrollToBottom]; 
    759         } else 
    760 #endif 
    761         { // old JavaScript method 
     713        } else { 
    762714                NSMutableString *transformedMessage = [message mutableCopy]; 
    763715                [transformedMessage escapeCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\\\"'"]]; 
     
    772724 
    773725- (void) _prependMessages:(NSString *) messages { 
    774 #ifdef WebKitVersion146 
    775726        if( _newWebKit ) { 
    776727                NSMutableString *result = [messages mutableCopy]; 
     
    796747 
    797748                if( [scrollNeeded boolValue] ) [self scrollToBottom]; 
    798         } else 
    799 #endif 
    800         { // old JavaScript method 
     749        } else { 
    801750                NSMutableString *result = [messages mutableCopy]; 
    802751                [result escapeCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\\\"'"]]; 
     
    834783        if( ! _webViewReady ) return 0; 
    835784        if( ! [identifier length] ) return 0; 
    836 #ifdef WebKitVersion146 
    837785        if( _newWebKit ) { 
    838786                DOMElement *element = [[[self mainFrame] DOMDocument] getElementById:identifier]; 
     
    841789                        return [value intValue]; 
    842790                return 0; 
    843         } else 
    844 #endif 
    845         return [[self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"locationOfMessage( \"%@\" );", identifier]] intValue]; 
     791        } else return [[self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"locationOfMessage( \"%@\" );", identifier]] intValue]; 
    846792} 
    847793 
     
    852798- (long) _locationOfElementAtIndex:(unsigned long) index { 
    853799        if( ! _webViewReady ) return 0; 
    854 #ifdef WebKitVersion146 
    855800        if( _newWebKit ) { 
    856801                DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 
     
    859804                        return [value intValue]; 
    860805                return 0; 
    861         } else 
    862 #endif 
    863         return [[self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"locationOfElementAtIndex( %d );", index]] intValue]; 
     806        } else return [[self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"locationOfElementAtIndex( %d );", index]] intValue]; 
    864807} 
    865808 
    866809- (unsigned long) _visibleMessageCount { 
    867810        if( ! _webViewReady ) return 0; 
    868 #ifdef WebKitVersion146 
    869811        if( _newWebKit ) { 
    870812                return [[[(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body] childNodes] length]; 
    871         } else 
    872 #endif 
    873         return [[self stringByEvaluatingJavaScriptFromString:@"scrollBackMessageCount();"] intValue]; 
     813        } else return [[self stringByEvaluatingJavaScriptFromString:@"scrollBackMessageCount();"] intValue]; 
    874814} 
    875815 
  • trunk/JVTabbedChatWindowController.m

    r2814 r2815  
    217217        id newWindowController = [[destTabView window] windowController]; 
    218218 
     219        // check if we are dragging the only view from a window, if so just move the original window 
     220        if( ! newWindowController && [[oldWindowController allChatViewControllers] count] == 1 ) { 
     221                NSRect newFrame = [[oldWindowController window] frame]; 
     222                newFrame.origin = screenPoint; 
     223                [[oldWindowController window] setFrame:newFrame display:NO]; 
     224                [[oldWindowController window] setAlphaValue:1.]; 
     225                [self _supressTabBarHiding:NO]; 
     226                return; 
     227        } 
     228 
    219229        if( oldWindowController != newWindowController ) { 
    220                 if( ! newWindowController ) { 
     230                if( ! newWindowController ) { // need to make a new window 
    221231                        NSRect newFrame; 
    222232                        newWindowController = [[JVChatController defaultController] newChatWindowController]; 
     
    232242 
    233243                        [[newWindowController window] setFrame:newFrame display:NO]; 
    234  
    235                         if( [newWindowController isMemberOfClass:[JVTabbedChatWindowController class]] ) 
    236                                 [(JVTabbedChatWindowController *)newWindowController toggleTabBarVisible:nil]; 
     244                        [[newWindowController window] saveFrameUsingName:[NSString stringWithFormat:@"Chat Window %@", [chatController identifier]]]; 
    237245                } 
    238246 
  • trunk/Languages/English.lproj/JVAppearancePreferences.nib/info.nib

    r2747 r2815  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>13 421 356 240 0 0 1280 832 </string> 
     6        <string>14 531 356 240 0 0 1344 986 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    1010                <string>505 398 270 342 0 0 1280 832 </string> 
    1111                <key>5</key> 
    12                 <string>344 194 545 491 0 0 1280 832 </string> 
     12                <string>399 426 545 491 0 0 1344 986 </string> 
    1313        </dict> 
    1414        <key>IBFramework Version</key> 
    15         <string>437.0</string> 
     15        <string>439.0</string> 
    1616        <key>IBGroupedObjects</key> 
    1717        <dict> 
     
    4444        </array> 
    4545        <key>IBSystem Version</key> 
    46         <string>8B15</string> 
     46        <string>8C31</string> 
    4747</dict> 
    4848</plist> 
  • trunk/Languages/German.lproj/JVAppearancePreferences.nib/info.nib

    r2749 r2815  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>13 421 356 240 0 0 1280 832 </string> 
     6        <string>14 531 356 240 0 0 1344 986 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    1010                <string>505 398 270 342 0 0 1280 832 </string> 
    1111                <key>5</key> 
    12                 <string>367 324 545 491 0 0 1280 832 </string> 
     12                <string>399 426 545 491 0 0 1344 986 </string> 
    1313        </dict> 
    1414        <key>IBFramework Version</key> 
    15         <string>437.0</string> 
     15        <string>439.0</string> 
    1616        <key>IBLockedObjects</key> 
    1717        <array> 
     
    2424        </array> 
    2525        <key>IBSystem Version</key> 
    26         <string>8B15</string> 
     26        <string>8C31</string> 
    2727</dict> 
    2828</plist> 
  • trunk/MVApplicationController.m

    r2796 r2815  
    299299                NSString *searchString = nil; 
    300300 
    301 #ifdef NSAppKitVersionNumber10_3 
    302301                NSAppleEventManager *sam = [NSAppleEventManager sharedAppleEventManager]; 
    303302                NSAppleEventDescriptor *lastEvent = [sam currentAppleEvent]; 
    304                 searchString = [[lastEvent descriptorForKeyword:'stxt'] stringValue]; // keyAESearchText 
    305 #endif 
     303                searchString = [[lastEvent descriptorForKeyword:keyAESearchText] stringValue]; 
    306304 
    307305                JVChatTranscriptPanel *transcript = [[JVChatController defaultController] chatViewControllerForTranscript:filename]; 
  • trunk/MVConnectionsController.m

    r2796 r2815  
    284284        [openConnection setFrame:newWindowFrame display:YES animate:YES]; 
    285285        if( [sender state] ) [detailsTabView selectTabViewItemAtIndex:1]; 
    286 #ifdef NSAppKitVersionNumber10_3 
    287         if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 
     286        if( [openConnection respondsToSelector:@selector( recalculateKeyViewLoop )] ) 
    288287                [openConnection recalculateKeyViewLoop]; 
    289 #endif 
    290288} 
    291289 
  • trunk/Resources/JVChatRoom.nib/info.nib

    r2516 r2815  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>196 61 356 240 0 0 1024 746 </string> 
     6        <string>290 90 356 240 0 0 1344 986 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>68</key> 
    10                 <string>232 303 500 387 0 0 1024 746 </string> 
     10                <string>405 387 500 387 0 0 1344 986 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>437.0</string> 
     13        <string>439.0</string> 
    1414        <key>IBLockedObjects</key> 
    1515        <array> 
    1616                <integer>107</integer> 
    1717        </array> 
     18        <key>IBOpenObjects</key> 
     19        <array> 
     20                <integer>68</integer> 
     21        </array> 
    1822        <key>IBSystem Version</key> 
    19         <string>8A425</string> 
     23        <string>8C31</string> 
    2024</dict> 
    2125</plist> 
  • trunk/Resources/JVDirectChat.nib/info.nib

    r2282 r2815  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>183 413 356 240 0 0 1280 832 </string> 
     6        <string>196 520 356 240 0 0 1344 986 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>364.0</string> 
     13        <string>439.0</string> 
    1414        <key>IBSystem Version</key> 
    15         <string>7S215</string> 
     15        <string>8C31</string> 
    1616</dict> 
    1717</plist>