adium 3770:1975426d1c02: Added lastFocus for the latest message ...

commits at adium.im commits at adium.im
Tue Mar 22 17:28:07 UTC 2011


details:	http://hg.adium.im/adium/rev/1975426d1c02
revision:	3770:1975426d1c02
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Tue Mar 22 18:27:53 2011 +0100

Added lastFocus for the latest message received in a chat without focus, as requested by mathuaerknedam.

diffs (42 lines):

diff -r 2132a193f83a -r 1975426d1c02 ChangeLogs/Changes.txt
--- a/ChangeLogs/Changes.txt	Mon Mar 21 23:06:09 2011 +0100
+++ b/ChangeLogs/Changes.txt	Tue Mar 22 18:27:53 2011 +0100
@@ -37,6 +37,9 @@
   * Fixed link insertion for NetNewsWire. (#11389)
   * Added Google Chrome support for link insertion.
 
+ Message View
+  * Added the "lastFocus" class for message styles to the latest message received while the chat didn't have focus.
+
  Transcript Viewer
  * Added next/previous buttons for highlighted search terms within a transcript (similar to Safari).
 
diff -r 2132a193f83a -r 1975426d1c02 Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Mon Mar 21 23:06:09 2011 +0100
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Tue Mar 22 18:27:53 2011 +0100
@@ -711,8 +711,24 @@
 			}
 
 			// Add a class for "this content received while out of focus"
-			if (content.chat.isGroupChat)
+			if (content.chat.isGroupChat) {
 				[content addDisplayClass:@"focus"];
+				[content addDisplayClass:@"lastFocus"];
+				
+				DOMNodeList *nodeList = [webView.mainFrameDocument querySelectorAll:@".lastFocus"];
+				DOMHTMLElement *node = nil; NSMutableArray *classes = nil;
+				for (unsigned i = 0; i < nodeList.length; i++)
+				{
+					node = (DOMHTMLElement *)[nodeList item:i];
+					classes = [[node.className componentsSeparatedByString:@" "] mutableCopy];
+					
+					[classes removeObject:@"lastFocus"];
+					
+					node.className = [classes componentsJoinedByString:@" "];
+					
+					[classes release];
+				}
+			}
 		}
 		
 		//Add the content object




More information about the commits mailing list