Changeset 2815
- Timestamp:
- 07/01/05 20:12:12 (3 years ago)
- Files:
-
- trunk/Colloquy.pch (modified) (1 diff)
- trunk/JVAppearancePreferences.m (modified) (1 diff)
- trunk/JVChatController.m (modified) (1 diff)
- trunk/JVChatTranscript.m (modified) (3 diffs)
- trunk/JVChatTranscriptBrowserPanel.m (modified) (2 diffs)
- trunk/JVChatTranscriptPanel.m (modified) (2 diffs)
- trunk/JVChatWindowController.h (modified) (1 diff)
- trunk/JVChatWindowController.m (modified) (6 diffs)
- trunk/JVDirectChatPanel.m (modified) (1 diff)
- trunk/JVStyleView.m (modified) (27 diffs)
- trunk/JVTabbedChatWindowController.m (modified) (2 diffs)
- trunk/Languages/English.lproj/JVAppearancePreferences.nib/info.nib (modified) (3 diffs)
- trunk/Languages/English.lproj/JVAppearancePreferences.nib/keyedobjects.nib (modified) (previous)
- trunk/Languages/German.lproj/JVAppearancePreferences.nib/info.nib (modified) (3 diffs)
- trunk/Languages/German.lproj/JVAppearancePreferences.nib/keyedobjects.nib (modified) (previous)
- trunk/MVApplicationController.m (modified) (1 diff)
- trunk/MVConnectionsController.m (modified) (1 diff)
- trunk/Resources/JVChatRoom.nib/info.nib (modified) (1 diff)
- trunk/Resources/JVChatRoom.nib/keyedobjects.nib (modified) (previous)
- trunk/Resources/JVDirectChat.nib/info.nib (modified) (2 diffs)
- trunk/Resources/JVDirectChat.nib/keyedobjects.nib (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Colloquy.pch
r2796 r2815 7 7 #import <ChatCore/ChatCore.h> 8 8 9 #ifdef NSAppKitVersionNumber10_310 #define WebKitVersion146 111 9 #endif 12 10 13 #endif14 15 #ifdef NSAppKitVersionNumber10_316 11 #include <sys/xattr.h> 17 #endif18 12 19 13 // define these here so they weak link for Panther letting the binary be backwards compatible trunk/JVAppearancePreferences.m
r2796 r2815 106 106 107 107 - (void) awakeFromNib { 108 [(NSClipView *)[preview superview] setBackgroundColor:[NSColor clearColor]]; // allows rgba backgrounds to see through to the Desktop109 [(NSScrollView *)[(NSClipView *)[preview superview] superview] setBackgroundColor:[NSColor clearColor]];110 108 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( styleDidReload: ) name:JVStyleViewDidChangeStylesNotification object:preview]; 111 109 112 #ifdef NSAppKitVersionNumber10_3 113 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 110 if( [[preview window] respondsToSelector:@selector( _setContentHasShadow: )] ) 114 111 [[preview window] _setContentHasShadow:NO]; // this is new in Tiger 115 #endif116 112 } 117 113 trunk/JVChatController.m
r2809 r2815 168 168 169 169 [windowController addChatViewController:controller]; 170 if( initiated || [[windowController allChatViewControllers] count] == 1 ) { 170 171 if( initiated || [[windowController allChatViewControllers] count] == 1 ) 171 172 [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]; 177 175 } 178 176 trunk/JVChatTranscript.m
r2796 r2815 633 633 [self _incrementalWriteToLog:root continuation:( parent ? YES : NO )]; 634 634 635 #ifdef NSAppKitVersionNumber10_3 636 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 && _logFile && fsetxattr != NULL ) { 635 if( _logFile && fsetxattr ) { 637 636 NSString *lastDateString = [[message date] description]; 638 637 fsetxattr( [_logFile fileDescriptor], "lastMessageDate", [lastDateString UTF8String], [lastDateString length], 0, 0 ); 639 638 } 640 #endif641 639 642 640 _requiresNewEnvelope = NO; … … 1141 1139 [[NSFileManager defaultManager] changeFileAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSFileExtensionHidden, [NSNumber numberWithUnsignedLong:'coTr'], NSFileHFSTypeCode, [NSNumber numberWithUnsignedLong:'coRC'], NSFileHFSCreatorCode, nil] atPath:path]; 1142 1140 1143 #ifdef NSAppKitVersionNumber10_3 1144 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 && _logFile && fsetxattr != NULL ) { 1141 if( _logFile && fsetxattr ) { 1145 1142 NSString *beganDateString = [[self dateBegan] description]; 1146 1143 NSString *lastDateString = [[[self lastMessage] date] description]; … … 1154 1151 if( [lastDateString length] ) fsetxattr( [_logFile fileDescriptor], "lastMessageDate", [lastDateString UTF8String], [lastDateString length], 0, 0 ); 1155 1152 } 1156 #endif1157 1153 } 1158 1154 @end trunk/JVChatTranscriptBrowserPanel.m
r2680 r2815 95 95 NSString *path = [[self logsPath] stringByAppendingPathComponent:logPath]; 96 96 97 #ifdef NSAppKitVersionNumber10_3 98 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) { 97 if( fgetxattr ) { 99 98 FILE *logsFile = fopen( [path fileSystemRepresentation], "r" ); 100 99 if( logsFile ) { … … 122 121 } 123 122 } 124 #endif125 123 126 124 NSDictionary *d = [NSDictionary dictionaryWithObjectsAndKeys:server, @"server", target, @"target", session, @"session", path, @"path", nil]; trunk/JVChatTranscriptPanel.m
r2796 r2815 436 436 NSSearchField *field = [[[NSSearchField alloc] initWithFrame:NSMakeRect( 0., 0., 150., 22. )] autorelease]; 437 437 [[field cell] setSendsWholeSearchString:NO]; 438 #ifdef NSAppKitVersionNumber10_3 439 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 438 if( [[field cell] respondsToSelector:@selector( setSendsSearchStringImmediately: )] ) 440 439 [[field cell] setSendsSearchStringImmediately:NO]; 441 #endif442 440 [[field cell] setPlaceholderString:NSLocalizedString( @"Search Messages", "search field placeholder string" )]; 443 441 [[field cell] setMaximumRecents:10]; … … 556 554 #pragma mark - 557 555 #pragma mark WebView 558 559 // Allows some simple code to work when not built with WebKit/Safari 1.3560 #ifndef WebKitVersion146561 #define WebMenuItemTagGoBack 9562 #define WebMenuItemTagGoForward 10563 #define WebMenuItemTagStop 11564 #define WebMenuItemTagReload 12565 #endif566 556 567 557 - (JVStyleView *) display { trunk/JVChatWindowController.h
r2797 r2815 22 22 id <JVChatViewController> _activeViewController; 23 23 BOOL _usesSmallIcons; 24 BOOL _showDelayed; 24 25 } 25 26 - (NSString *) identifier; trunk/JVChatWindowController.m
r2814 r2815 78 78 [favoritesButton setMenu:[MVConnectionsController favoritesMenu]]; 79 79 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]; 90 91 91 92 [[self window] useOptimizedDrawing:YES]; 92 93 [[self window] setOpaque:NO]; // let us poke transparant holes in the window 93 94 94 #ifdef NSAppKitVersionNumber10_3 95 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 95 if( [[self window] respondsToSelector:@selector( _setContentHasShadow: )] ) 96 96 [[self window] _setContentHasShadow:NO]; // this is new in Tiger 97 #endif98 97 99 98 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector( _refreshPreferences ) object:nil]; … … 128 127 _identifier = nil; 129 128 _settings = nil; 129 _showDelayed = NO; 130 130 131 131 [super dealloc]; … … 165 165 _settings = [[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]] retain]; 166 166 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 } 170 172 171 173 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector( _refreshPreferences ) object:nil]; … … 200 202 201 203 #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 } 202 211 203 212 - (void) showChatViewController:(id <JVChatViewController>) controller { … … 330 339 NSAssert( index >= 0 && index <= [_views count], @"Index is beyond bounds." ); 331 340 332 if( ! [_views count] ) { 333 [[self window] orderWindow:NSWindowBelow relativeTo:[[[NSApplication sharedApplication] keyWindow] windowNumber]]; 334 } 341 BOOL needShow = ( ! [_views count] ); 335 342 336 343 [_views insertObject:controller atIndex:index]; 337 344 [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]; 338 356 339 357 [self _saveWindowFrame]; … … 940 958 941 959 - (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 { 943 964 NSEnumerator *enumerator = [[self allChatViewControllers] objectEnumerator]; 944 965 id <JVChatViewController> controller = nil; 966 967 [[self window] saveFrameUsingName:@"Chat Window"]; 945 968 946 969 while( ( controller = [enumerator nextObject] ) ) trunk/JVDirectChatPanel.m
r2809 r2815 230 230 JVEmoticonSet *emoticon = nil; 231 231 232 [(NSClipView *)[display superview] setBackgroundColor:[NSColor clearColor]]; // allows rgba backgrounds to see through to the Desktop233 [(NSScrollView *)[(NSClipView *)[display superview] superview] setBackgroundColor:[NSColor clearColor]];234 235 232 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidConnectNotification object:[self connection]]; 236 233 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidDisconnectNotification object:[self connection]]; trunk/JVStyleView.m
r2813 r2815 178 178 [WebCoreCache empty]; 179 179 180 #ifdef WebKitVersion146181 180 if( _newWebKit ) { 182 181 NSString *styleSheetLocation = [[[self style] variantStyleSheetLocationWithName:_styleVariant] absoluteString]; … … 184 183 if( ! styleSheetLocation ) [element setHref:@""]; 185 184 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]]]; 189 186 190 187 [self performSelector:@selector( _checkForTransparantStyle ) withObject:nil afterDelay:0.]; … … 218 215 [WebCoreCache empty]; 219 216 220 #ifdef WebKitVersion146221 217 if( _newWebKit ) { 222 218 NSString *styleSheetLocation = [[[self emoticons] styleSheetLocation] absoluteString]; … … 224 220 if( ! styleSheetLocation ) [element setHref:@""]; 225 221 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]]]; 229 223 } else { 230 224 [self performSelector:_cmd withObject:emoticons afterDelay:0.]; … … 268 262 unsigned int location = 0; 269 263 270 #ifdef WebKitVersion146271 264 if( _newWebKit ) { 272 265 DOMDocument *doc = [[self mainFrame] DOMDocument]; … … 278 271 [self scrollToBottom]; 279 272 location = [[elt valueForKey:@"offsetTop"] intValue]; 280 } else 281 #endif 282 location = [[self stringByEvaluatingJavaScriptFromString:@"mark();"] intValue]; 273 } else location = [[self stringByEvaluatingJavaScriptFromString:@"mark();"] intValue]; 283 274 284 275 [[self verticalMarkedScroller] removeMarkWithIdentifier:@"mark"]; … … 297 288 298 289 if( _webViewReady ) { 299 #ifdef WebKitVersion146300 290 if( _newWebKit ) { 301 291 [[self windowScriptObject] callWebScriptMethod:@"showTopic" withArguments:[NSArray arrayWithObject:topic]]; 302 292 } else { 303 #endif304 293 NSMutableString *mutTopic = [topic mutableCopy]; 305 294 [mutTopic replaceOccurrencesOfString:@"\"" withString:@"\\\"" options:NSLiteralSearch range:NSMakeRange(0, [mutTopic length])]; 306 295 [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"showTopic( \"%@\" );", mutTopic]]; 307 #ifdef WebKitVersion146308 296 } 309 #endif310 297 } else { 311 298 [self performSelector:_cmd withObject:topic afterDelay:0.]; … … 315 302 - (void) hideTopic { 316 303 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();"]; 323 306 } else { 324 307 [self performSelector:_cmd withObject:nil afterDelay:0.]; … … 328 311 - (void) toggleTopic:(NSString *) topic { 329 312 if( _webViewReady ) { 330 BOOL topicShowing; 331 #ifdef WebKitVersion146 313 BOOL topicShowing = NO; 332 314 if( _newWebKit ) { 333 315 DOMHTMLElement *topicElement = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:@"topic-floater"]; 334 316 topicShowing = ( topicElement != nil ); 335 317 } else { 336 #endif337 318 NSString *result = [self stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"topic-floater\") != null"]; 338 319 topicShowing = [result isEqualToString:@"true"]; 339 #ifdef WebKitVersion146340 320 } 341 #endif 321 342 322 if( topicShowing ) [self hideTopic]; 343 323 else [self showTopic:topic]; … … 354 334 NSString *result = nil; 355 335 356 #ifdef WebKitVersion146357 336 if( _requiresFullMessage && _newWebKit ) { 358 337 DOMHTMLElement *replaceElement = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:@"consecutiveInsert"]; 359 338 if( replaceElement ) _requiresFullMessage = NO; // a full message was assumed, but we can do a consecutive one 360 339 } 361 #endif362 340 363 341 @try { … … 401 379 402 380 - (void) highlightMessage:(JVChatMessage *) message { 403 /*#ifdef WebKitVersion146 404 if( _newWebKit ) { 381 /* if( _newWebKit ) { 405 382 DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:[message messageIdentifier]]; 406 383 NSString *class = [element className]; … … 408 385 if( [class length] ) [element setClassName:[class stringByAppendingString:@" searchHighlight"]]; 409 386 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]]]; 413 388 */} 414 389 415 390 - (void) clearHighlightForMessage:(JVChatMessage *) message { 416 /*#ifdef WebKitVersion146 417 if( _newWebKit ) { 391 /* if( _newWebKit ) { 418 392 DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] getElementById:[message messageIdentifier]]; 419 393 NSMutableString *class = [[[element className] mutableCopy] autorelease]; 420 394 [class replaceOccurrencesOfString:@"searchHighlight" withString:@"" options:NSLiteralSearch range:NSMakeRange( 0, [class length] )]; 421 395 [element setClassName:class]; 422 } else 423 #endif 424 [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetHighlightMessage('%@');", [message messageIdentifier]]]; 396 } else [self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"resetHighlightMessage('%@');", [message messageIdentifier]]]; 425 397 */} 426 398 427 399 - (void) clearAllMessageHighlights { 428 /*#ifdef WebKitVersion146 429 if( _newWebKit ) { 400 /* if( _newWebKit ) { 430 401 [[self windowScriptObject] callWebScriptMethod:@"resetHighlightMessage" withArguments:[NSArray arrayWithObject:[NSNull null]]]; 431 } else 432 #endif 433 [self stringByEvaluatingJavaScriptFromString:@"resetHighlightMessage(null);"]; 402 } else [self stringByEvaluatingJavaScriptFromString:@"resetHighlightMessage(null);"]; 434 403 */} 435 404 … … 437 406 438 407 - (void) highlightString:(NSString *) string inMessage:(JVChatMessage *) message { 439 #ifdef WebKitVersion146440 408 if( _newWebKit ) { 441 409 [[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]]; 445 411 } 446 412 447 413 - (void) clearStringHighlightsForMessage:(JVChatMessage *) message { 448 #ifdef WebKitVersion146449 414 if( _newWebKit ) { 450 415 [[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]]]; 454 417 } 455 418 456 419 - (void) clearAllStringHighlights { 457 #ifdef WebKitVersion146458 420 if( _newWebKit ) { 459 421 [[self windowScriptObject] callWebScriptMethod:@"resetSearchHighlight" withArguments:[NSArray arrayWithObject:[NSNull null]]]; 460 } else 461 #endif 462 [self stringByEvaluatingJavaScriptFromString:@"resetSearchHighlight(null);"]; 422 } else [self stringByEvaluatingJavaScriptFromString:@"resetSearchHighlight(null);"]; 463 423 } 464 424 … … 526 486 527 487 [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]; 528 494 } 529 495 … … 572 538 } 573 539 574 #ifdef WebKitVersion146575 540 if( _newWebKit ) { 576 541 DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 577 542 [body setValue:[body valueForKey:@"offsetHeight"] forKey:@"scrollTop"]; 578 } else 579 #endif 580 [self stringByEvaluatingJavaScriptFromString:@"scrollToBottom();"]; 543 } else [self stringByEvaluatingJavaScriptFromString:@"scrollToBottom();"]; 581 544 } 582 545 @end … … 586 549 @implementation JVStyleView (JVStyleViewPrivate) 587 550 - (void) _checkForTransparantStyle { 588 #ifdef WebKitVersion146589 551 if( _newWebKit ) { 590 552 DOMCSSStyleDeclaration *style = [self computedStyleForElement:[(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body] pseudoElement:nil]; … … 596 558 [self setNeedsDisplay:YES]; 597 559 } 598 #endif599 560 } 600 561 … … 613 574 _webViewReady = NO; 614 575 if( _rememberScrollPosition ) { 615 #ifdef WebKitVersion146616 576 if( _newWebKit ) { 617 577 DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 618 578 _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]; 622 580 } else _lastScrollPosition = 0; 623 581 … … 688 646 if( _rememberScrollPosition ) { 689 647 _rememberScrollPosition = NO; 690 #ifdef WebKitVersion146691 648 if( _newWebKit ) { 692 649 DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; 693 650 [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]]; 697 652 } 698 653 } … … 708 663 } 709 664 710 #ifdef WebKitVersion146711 665 if( _newWebKit ) { 712 666 DOMHTMLElement *element = (DOMHTMLElement *)[[[self mainFrame] DOMDocument] createElement:@"span"]; … … 757 711 if( [scrollNeeded respondsToSelector:@selector( boolValue )] && [scrollNeeded boolValue] ) 758 712 [self scrollToBottom]; 759 } else 760 #endif 761 { // old JavaScript method 713 } else { 762 714 NSMutableString *transformedMessage = [message mutableCopy]; 763 715 [transformedMessage escapeCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\\\"'"]]; … … 772 724 773 725 - (void) _prependMessages:(NSString *) messages { 774 #ifdef WebKitVersion146775 726 if( _newWebKit ) { 776 727 NSMutableString *result = [messages mutableCopy]; … … 796 747 797 748 if( [scrollNeeded boolValue] ) [self scrollToBottom]; 798 } else 799 #endif 800 { // old JavaScript method 749 } else { 801 750 NSMutableString *result = [messages mutableCopy]; 802 751 [result escapeCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\\\"'"]]; … … 834 783 if( ! _webViewReady ) return 0; 835 784 if( ! [identifier length] ) return 0; 836 #ifdef WebKitVersion146837 785 if( _newWebKit ) { 838 786 DOMElement *element = [[[self mainFrame] DOMDocument] getElementById:identifier]; … … 841 789 return [value intValue]; 842 790 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]; 846 792 } 847 793 … … 852 798 - (long) _locationOfElementAtIndex:(unsigned long) index { 853 799 if( ! _webViewReady ) return 0; 854 #ifdef WebKitVersion146855 800 if( _newWebKit ) { 856 801 DOMHTMLElement *body = [(DOMHTMLDocument *)[[self mainFrame] DOMDocument] body]; … … 859 804 return [value intValue]; 860 805 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]; 864 807 } 865 808 866 809 - (unsigned long) _visibleMessageCount { 867 810 if( ! _webViewReady ) return 0; 868 #ifdef WebKitVersion146869 811 if( _newWebKit ) { 870 812 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]; 874 814 } 875 815 trunk/JVTabbedChatWindowController.m
r2814 r2815 217 217 id newWindowController = [[destTabView window] windowController]; 218 218 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 219 229 if( oldWindowController != newWindowController ) { 220 if( ! newWindowController ) { 230 if( ! newWindowController ) { // need to make a new window 221 231 NSRect newFrame; 222 232 newWindowController = [[JVChatController defaultController] newChatWindowController]; … … 232 242 233 243 [[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]]]; 237 245 } 238 246 trunk/Languages/English.lproj/JVAppearancePreferences.nib/info.nib
r2747 r2815 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string>1 3 421 356 240 0 0 1280 832</string>6 <string>14 531 356 240 0 0 1344 986 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 10 10 <string>505 398 270 342 0 0 1280 832 </string> 11 11 <key>5</key> 12 <string>3 44 194 545 491 0 0 1280 832</string>12 <string>399 426 545 491 0 0 1344 986 </string> 13 13 </dict> 14 14 <key>IBFramework Version</key> 15 <string>43 7.0</string>15 <string>439.0</string> 16 16 <key>IBGroupedObjects</key> 17 17 <dict> … … 44 44 </array> 45 45 <key>IBSystem Version</key> 46 <string>8 B15</string>46 <string>8C31</string> 47 47 </dict> 48 48 </plist> trunk/Languages/German.lproj/JVAppearancePreferences.nib/info.nib
r2749 r2815 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string>1 3 421 356 240 0 0 1280 832</string>6 <string>14 531 356 240 0 0 1344 986 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 10 10 <string>505 398 270 342 0 0 1280 832 </string> 11 11 <key>5</key> 12 <string>3 67 324 545 491 0 0 1280 832</string>12 <string>399 426 545 491 0 0 1344 986 </string> 13 13 </dict> 14 14 <key>IBFramework Version</key> 15 <string>43 7.0</string>15 <string>439.0</string> 16 16 <key>IBLockedObjects</key> 17 17 <array> … … 24 24 </array> 25 25 <key>IBSystem Version</key> 26 <string>8 B15</string>26 <string>8C31</string> 27 27 </dict> 28 28 </plist> trunk/MVApplicationController.m
r2796 r2815 299 299 NSString *searchString = nil; 300 300 301 #ifdef NSAppKitVersionNumber10_3302 301 NSAppleEventManager *sam = [NSAppleEventManager sharedAppleEventManager]; 303 302 NSAppleEventDescriptor *lastEvent = [sam currentAppleEvent]; 304 searchString = [[lastEvent descriptorForKeyword:'stxt'] stringValue]; // keyAESearchText 305 #endif 303 searchString = [[lastEvent descriptorForKeyword:keyAESearchText] stringValue]; 306 304 307 305 JVChatTranscriptPanel *transcript = [[JVChatController defaultController] chatViewControllerForTranscript:filename]; trunk/MVConnectionsController.m
r2796 r2815 284 284 [openConnection setFrame:newWindowFrame display:YES animate:YES]; 285 285 if( [sender state] ) [detailsTabView selectTabViewItemAtIndex:1]; 286 #ifdef NSAppKitVersionNumber10_3 287 if( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_3 ) 286 if( [openConnection respondsToSelector:@selector( recalculateKeyViewLoop )] ) 288 287 [openConnection recalculateKeyViewLoop]; 289 #endif290 288 } 291 289 trunk/Resources/JVChatRoom.nib/info.nib
r2516 r2815 4 4 <dict> 5 5 <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> 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 9 <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> 11 11 </dict> 12 12 <key>IBFramework Version</key> 13 <string>43 7.0</string>13 <string>439.0</string> 14 14 <key>IBLockedObjects</key> 15 15 <array> 16 16 <integer>107</integer> 17 17 </array> 18 <key>IBOpenObjects</key> 19 <array> 20 <integer>68</integer> 21 </array> 18 22 <key>IBSystem Version</key> 19 <string>8 A425</string>23 <string>8C31</string> 20 24 </dict> 21 25 </plist> trunk/Resources/JVDirectChat.nib/info.nib
r2282 r2815 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string>1 83 413 356 240 0 0 1280 832</string>6 <string>196 520 356 240 0 0 1344 986 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 11 11 </dict> 12 12 <key>IBFramework Version</key> 13 <string> 364.0</string>13 <string>439.0</string> 14 14 <key>IBSystem Version</key> 15 <string> 7S215</string>15 <string>8C31</string> 16 16 </dict> 17 17 </plist>
