adium 2523:a686ca8b33f1: Backed out changeset fc55c522b2d5. Test...

commits at adium.im commits at adium.im
Sat Jun 27 00:26:05 UTC 2009


details:	http://hg.adium.im/adium/rev/a686ca8b33f1
revision:	2523:a686ca8b33f1
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 15:34:00 2009 -0700

Backed out changeset fc55c522b2d5. Testing if it caused a regression
Subject: adium 2524:0e0e38e66cf2: Add iPhone SDK support to AutoHyperlinks. Fixes #10594

details:	http://hg.adium.im/adium/rev/0e0e38e66cf2
revision:	2524:0e0e38e66cf2
author:		Mike Abdullah
date:		Wed Jun 24 19:53:17 2009 -0700

Add iPhone SDK support to AutoHyperlinks. Fixes #10594
Subject: adium 2525:a4caa7c2401d: Simplify Template.html a bunch. I think this may also fix a few emoticon issues

details:	http://hg.adium.im/adium/rev/a4caa7c2401d
revision:	2525:a4caa7c2401d
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 15:31:11 2009 -0700

Simplify Template.html a bunch. I think this may also fix a few emoticon issues
Subject: adium 2526:44d03e5661d9: Merge backout

details:	http://hg.adium.im/adium/rev/44d03e5661d9
revision:	2526:44d03e5661d9
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 15:38:24 2009 -0700

Merge backout
Subject: adium 2527:26d53e9f30c5: A few more simplifications, getting Template.html down to an even 200 lines

details:	http://hg.adium.im/adium/rev/26d53e9f30c5
revision:	2527:26d53e9f30c5
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 15:45:36 2009 -0700

A few more simplifications, getting Template.html down to an even 200 lines
Subject: adium 2528:6b768a0be2db: Backed out changeset 0e0e38e66cf2 pending getting some questions Colin had answered in the bug. Reopens #10594

details:	http://hg.adium.im/adium/rev/6b768a0be2db
revision:	2528:6b768a0be2db
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 17:24:52 2009 -0700

Backed out changeset 0e0e38e66cf2 pending getting some questions Colin had answered in the bug. Reopens #10594
Subject: adium 2529:87e9e080e516: Merge backout

details:	http://hg.adium.im/adium/rev/87e9e080e516
revision:	2529:87e9e080e516
author:		David Smith <catfish.man at gmail.com>
date:		Fri Jun 26 17:25:05 2009 -0700

Merge backout

diffs (324 lines):

diff -r fc55c522b2d5 -r 87e9e080e516 Copyright.txt
--- a/Copyright.txt	Sat Jun 20 17:30:53 2009 +0200
+++ b/Copyright.txt	Fri Jun 26 17:25:05 2009 -0700
@@ -1,7 +1,6 @@
 Adium
 Copyright (C) 2001-2009 by the following:
 
-Domenico Agresta
 Adam Atlas
 Jackie Balzer
 Colin Barrett
@@ -75,5 +74,6 @@
 Mike Timm
 Ngan Pham
 Jay Weatherstone
+Robby Weinberg
 
 If you have contributed to Adium and are not on this list, please contact us.
diff -r fc55c522b2d5 -r 87e9e080e516 Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m
--- a/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m	Sat Jun 20 17:30:53 2009 +0200
+++ b/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m	Fri Jun 26 17:25:05 2009 -0700
@@ -233,7 +233,6 @@
 			month_or_week = [now monthOfYear];
 			day = [now dayOfMonth];
 		} else {
-			segment = 0U;
 
 			while(*ch == '-') {
 				++num_leading_hyphens;
diff -r fc55c522b2d5 -r 87e9e080e516 Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Sat Jun 20 17:30:53 2009 +0200
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Fri Jun 26 17:25:05 2009 -0700
@@ -996,7 +996,7 @@
 {
 	if (visible && !characterCounter) {
 		characterCounter = [[AISimpleTextView alloc] initWithFrame:NSZeroRect];
-		[characterCounter setAutoresizingMask:(NSViewMinXMargin)];
+		[characterCounter setAutoresizingMask:(NSViewMinXMargin|NSViewWidthSizable)];
 
 		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(positionIndicators:) name:NSViewBoundsDidChangeNotification object:[self superview]];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(positionIndicators:) name:NSViewFrameDidChangeNotification object:[self superview]];		
diff -r fc55c522b2d5 -r 87e9e080e516 Plugins/Twitter Plugin/AITwitterAccount.m
--- a/Plugins/Twitter Plugin/AITwitterAccount.m	Sat Jun 20 17:30:53 2009 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m	Fri Jun 26 17:25:05 2009 -0700
@@ -1134,7 +1134,7 @@
 			
 		case 502:
 			// Bad Gateway: returned if Twitter is down or being upgraded.
-			return AILocalizedString(@"The server is currently down or being upgraded.", nil);
+			return AILocalizedString(@"The server is currently down.", nil);
 			break;
 			
 		case -1001:
@@ -1735,7 +1735,7 @@
 														   withSource:nil
 														  destination:self
 																 date:[NSDate date]
-															  message:[NSAttributedString stringWithString:[NSString stringWithFormat:AILocalizedString(@"An error occurred: %@", nil),
+															  message:[NSAttributedString stringWithString:[NSString stringWithFormat:AILocalizedString(@"Unable to update timeline: %@", nil),
 																											[self errorMessageForError:error]]]
 															 withType:@"error"];
 				
@@ -2030,6 +2030,12 @@
 		if (updateAfterSend) {
 			[self periodicUpdate];
 		}
+		
+		if (statuses.count) {
+			[adium.contentController displayEvent:AILocalizedString(@"Tweet successfully sent.", nil)
+										   ofType:@"tweet"
+										  inChat:self.timelineChat];
+		}
 				
 		for(NSDictionary *update in statuses) {
 			[[NSNotificationCenter defaultCenter] postNotificationName:AITwitterNotificationPostedStatus
diff -r fc55c522b2d5 -r 87e9e080e516 Plugins/WebKit Message View/Template.html
--- a/Plugins/WebKit Message View/Template.html	Sat Jun 20 17:30:53 2009 +0200
+++ b/Plugins/WebKit Message View/Template.html	Fri Jun 26 17:25:05 2009 -0700
@@ -3,61 +3,41 @@
 <head>
 	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 	<base href="%@">
-	<script type="text/ecmascript" defer="defer">
+	<script type="text/javascript">
 		// NOTE:
 		// Any percent signs in this file must be escaped!
 		// Use two escape signs (%%) to display it, this is passed through a format call!
+		
+		function appendHTML(html) {
+			var node = document.getElementById("Chat");
+			var range = document.createRange();
+			range.selectNode(node);
+			var documentFragment = range.createContextualFragment(html);
+			node.appendChild(documentFragment);
+		}
 
 		//Appending new content to the message view
 		function appendMessage(html) {
 			var shouldScroll = nearBottom();
-
-			//Remove any existing insertion point
+			appendMessageNoScroll(html);
+			alignChat(shouldScroll);
+		}
+		
+		function appendMessageNoScroll(html) {			
+			//Remove the current insertion point
 			var insert = document.getElementById("insert");
 			if(insert) 
 				insert.parentNode.removeChild(insert);
-
-			//Append the new message to the bottom of our chat block
-			var chat = document.getElementById("Chat");
-			var range = document.createRange();
-			range.selectNode(chat);
-			var documentFragment = range.createContextualFragment(html);
-			chat.appendChild(documentFragment);
-
+			
+			appendHTML(html);
+		}
+		
+		function appendNextMessage(html){
+			var shouldScroll = nearBottom();
+			appendNextMessageNoScroll(html);
 			alignChat(shouldScroll);
 		}
-		function appendMessageNoScroll(html) {
-			//Remove any existing insertion point
-			var insert = document.getElementById("insert");
-			if(insert) 
-				insert.parentNode.removeChild(insert);
-
-			//Append the new message to the bottom of our chat block
-			var chat = document.getElementById("Chat");
-			var range = document.createRange();
-			range.selectNode(chat);
-			var documentFragment = range.createContextualFragment(html);
-			chat.appendChild(documentFragment);
-		}
-		function appendNextMessage(html){
-			var shouldScroll = nearBottom();
-
-			//Locate the insertion point
-			var insert = document.getElementById("insert");
-			if(insert){
-				//make new node
-				var range = document.createRange();
-				range.selectNode(insert.parentNode);
-				var newNode = range.createContextualFragment(html);
-
-				//swap
-				insert.parentNode.replaceChild(newNode,insert);
-
-				alignChat(shouldScroll);
-			} else {
-				appendMessage(html);
-			}
-		}
+		
 		function appendNextMessageNoScroll(html){
 			//Locate the insertion point
 			var insert = document.getElementById("insert");
@@ -80,19 +60,15 @@
 			//Retrieve the current insertion point, then remove it
 			//This requires that there have been an insertion point... is there a better way to retrieve the last element? -evands
 			var insert = document.getElementById("insert");
-			var chat = document.getElementById("Chat");
 			if(insert){
 				var parentNode = insert.parentNode;
 				parentNode.removeChild(insert);
-				var lastMessage = chat.lastChild;
-				chat.removeChild(lastMessage);
+				var lastMessage = document.getElementById("Chat").lastChild;
+				document.getElementById("Chat").removeChild(lastMessage);
 			}
 
 			//Now append the message itself
-			var range = document.createRange();
-			range.selectNode(chat);
-			documentFragment = range.createContextualFragment(html);
-			chat.appendChild(documentFragment);
+			appendHTML(html);
 
 			alignChat(shouldScroll);
 		}
@@ -119,44 +95,50 @@
 			head.appendChild( documentFragment );
 		}
 
-		/* Swap an images with its alt-tag text on click, or expand/unexpand an attached image.
-		Combined the click with the alt key and all the image in the parent node are swapped. */
-		document.onclick = imageCheck;
-		function imageCheck() {
+		/* Converts emoticon images to textual emoticons; all emoticons in message if alt is held */
+		document.onclick = function imageCheck() {
+			var node = event.target;
+			if (node.tagName.toLowerCase() != 'img')
+				return;
+				
+			imageSwap(node, false);
+		}
+		
+		/* Converts textual emoticons to images if textToImagesFlag is true, otherwise vice versa */
+		function imageSwap(node, textToImagesFlag) {
 			var shouldScroll = nearBottom();
-			var node = event.target;
-			if (node.tagName.toLowerCase() != 'img' && node.tagName.toLowerCase() != 'a')
-				return;
-
-			if (!event.altKey)
-			{
-				if (!client.zoomImage(node) && node.alt) {
-					 imageToText(node);
-				}
+			
+			var images = [node];
+			if (event.altKey) {
+				while (node.id != "Chat" && node.parentNode.id != "Chat")
+					node = node.parentNode;
+				images = node.querySelectorAll(textToImagesFlag ? "a" : "img");
 			}
-			else
-			{
-				var chatElement = document.getElementById("Chat");
-				while (node != chatElement && node.parentNode != chatElement)
-					node = node.parentNode;
-				var aImgChilds = node.getElementsByTagName('img');
-				//The odd i++/continue usage is due to getElementsByTagName returning a live NodeList
-				for (i = 0; i < aImgChilds.length;) {
-					var child = aImgChilds[i];
-					if (!client.zoomImage(child) && child.alt) {
-						 imageToText(child);
-						 continue;
-					}
-					i++;
-				}
+			
+			for (var i = 0; i < images.length; i++) {
+				textToImagesFlag ? textToImage(images[i]) : imageToText(images[i]);
 			}
+			
 			alignChat(shouldScroll);
 		}
 
+		function textToImage(node) {
+			if (!node.getAttribute("isEmoticon"))
+				return;
+			//Swap the image/text
+			var img = document.createElement('img');
+			img.setAttribute('src', node.getAttribute('src'));
+			img.setAttribute('alt', node.firstChild.nodeValue);
+			img.className = node.className;
+			node.parentNode.replaceChild(img, node);
+		}
+		
 		function imageToText(node)
 		{
+			if (client.zoomImage(node) || !node.alt)
+				return;
 			var a = document.createElement('a');
-			a.setAttribute('onclick', 'imageSwap(this)');
+			a.setAttribute('onclick', 'imageSwap(this, true)');
 			a.setAttribute('src', node.getAttribute('src'));
 			a.setAttribute('isEmoticon', true);
 			a.className = node.className;
@@ -165,44 +147,6 @@
 			node.parentNode.replaceChild(a, node);
 		}
 		
-		/* Swap the emoticon text in images.
-		Combined the click with the alt key and all emoticons in text mode in the message are swapped. */
-		function imageSwap(node) {
-			var shouldScroll = nearBottom();
-
-			if (!event.altKey)
-			{
-				textToImage(node);
-			}
-			else
-			{
-				var chatElement = document.getElementById("Chat");
-				while (node != chatElement && node.parentNode != chatElement)
-					node = node.parentNode;
-				var aImgChilds = node.getElementsByTagName('a');
-				//The odd i++/continue usage is due to getElementsByTagName returning a live NodeList
-				for (i = 0; i < aImgChilds.length; ) {
-					var child = aImgChilds[i];
-					if (child.getAttribute('isEmoticon')) {
-						 textToImage(child);
-						continue;
-					}
-
-					i++;
-				}
-			}
-			alignChat(shouldScroll);
-		}
-
-		function textToImage(node) {
-			//Swap the image/text
-			var img = document.createElement('img');
-			img.setAttribute('src', node.getAttribute('src'));
-			img.setAttribute('alt', node.firstChild.nodeValue);
-			img.className = node.className;
-			node.parentNode.replaceChild(img, node);
-		}
-
 		//Align our chat to the bottom of the window.  If true is passed, view will also be scrolled down
 		function alignChat(shouldScroll) {
 			var windowHeight = window.innerHeight;
@@ -221,11 +165,9 @@
 			if (shouldScroll) scrollToBottom();
 		}
 
-		function windowDidResize(){
+		window.onresize = function windowDidResize(){
 			alignChat(true/*nearBottom()*/); //nearBottom buggy with inactive tabs
 		}
-
-		window.onresize = windowDidResize;
 	</script>
 
 	<style type="text/css">




More information about the commits mailing list