diff --git a/Icons/Angry/Grumpy Cat-grumpycat-grumpycatno.png b/Icons/Angry/Grumpy Cat-grumpycat-grumpycatno.png
new file mode 100644
index 0000000..43fc937
Binary files /dev/null and b/Icons/Angry/Grumpy Cat-grumpycat-grumpycatno.png differ
diff --git a/Rakefile b/Rakefile
index 624ef13..d9187a2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -81,7 +81,7 @@ namespace :build do
ri.dump_icons_to_folder('trollicons.AdiumEmoticonset')
Pathname.new('./build/trollicons.AdiumEmoticonset/Emoticons.plist').open('w'){|io| io << markup}
end
-
+
desc "Builds for Colloquy"
task :colloquy do
require 'builder'
diff --git a/extension/trollicons/manifest.json b/extension/trollicons/manifest.json
index aeeee2c..78f2526 100644
--- a/extension/trollicons/manifest.json
+++ b/extension/trollicons/manifest.json
@@ -1,6 +1,8 @@
{
+ "manifest_version": 2,
+
"name": "Trollicons for Google Chrome™",
- "version": "2.8",
+ "version": "2.9",
"description": "Parses trollicons in Facebook Chat",
"icons": {
"16": "icon16.png",
@@ -18,5 +20,6 @@
"trollicons.js"
]
}
- ]
-}
\ No newline at end of file
+ ],
+ "web_accessible_resources": ["img/*"]
+}
diff --git a/extension/trollicons/trollicons.js b/extension/trollicons/trollicons.js
index b0ef07d..6e56140 100644
--- a/extension/trollicons/trollicons.js
+++ b/extension/trollicons/trollicons.js
@@ -1,45 +1,41 @@
-(function() {
+(function()
+{
jQuery.noConflict();
var changing = false;
+ var nodes = {};
/* depending on where we are (fb or gmail) define a "replacement node" that we can just use later */
- if (/facebook/.test(window.location.href)) {
- var nodes = {};
- nodes['div#fbDockChat'] = '.fbChatMessage'; // the docked chat window messages
- //nodes['div#contentArea'] = '.storyContent'; // items in the feeds (this is buggy)
- nodes['div#MessagingMessages'] = '.MessagingMessage'; // chat messages in the inbox
+ if (/facebook/.test(window.location.href))
+ {
+ nodes['div.conversation'] = '.fbChatConvItem .messages span'; // chat messages in the inbox
+ nodes['li.webMessengerMessageGroup'] = 'span'; // the docked chat window messages
- var imgNode = (function(key, img) {
- return "" + key + "";
- });
+ var imgNode = (function(key, img)
+ {
+ return "" + key + "";
+ });
}
- /*
- * else if (/google/.test(window.location.href)) {
- * console.debug('gmail plugin is experimental');
- * var chatNode = 'div.nH.Hd';
- * var messageNode = '.tReiP';
- * var imgNode = (function(key, img) {
- * return "";
- * });
- * }
- */
- else {
+ else
+ {
console.debug('not facebook');
}
+ /****
+ * now do the actual replacement of said node (defined above)
+ ****/
- /* now do the actual replacement of said node (defined above) */
-
- // this is just going to match any simple strings wrapped in square brackets (ie. [balls] not [hello world])
+ // this is just going to match any lower case single word in square brackets (ie. [foo] not [hello world])
var re = new RegExp("\[[a-z]+\]", "g");
// go through the nodes we care about
- jQuery.each(nodes, function(chatNode, messageNode) {
+ jQuery.each(nodes, function(chatNode, messageNode)
+ {
console.debug("### chatNode = " + chatNode);
console.debug("### messageNode = " + messageNode);
- jQuery('body').delegate(chatNode, 'DOMNodeInserted', function(event) {
-
+ // When the DOM inserts a new node (message) under the chatNode node, do the icon filtering
+ jQuery('body').delegate(chatNode, 'DOMNodeInserted', function(event)
+ {
// we don't want to respond to the "change" event casued by our own replacement code
if (changing == false)
changing = true;
@@ -47,14 +43,19 @@
return;
// loop through all the messages in the chat window and replace the text with our icons
- var messages = jQuery(messageNode);
- jQuery.each(messages, function() {
+ var messages = jQuery(chatNode + " " + messageNode);
+
+ jQuery.each(messages, function()
+ {
var oldText = jQuery(this).html();
var newText = oldText;
var matches = oldText.match(re);
var message = this;
- if (matches) {
- jQuery.each(matches, function() {
+
+ if (matches)
+ {
+ jQuery.each(matches, function()
+ {
var key = this.substring(1, this.length-1);
var img = rages[key];
@@ -67,7 +68,6 @@
jQuery(message).html(newText);
}
});
-
changing = false;
});
});
diff --git a/stats b/stats
index 52a8a0c..dcb9c82 100644
--- a/stats
+++ b/stats
@@ -68,3 +68,12 @@ trollicons-ichat.pkg.zip, 1332792003, 18
trollicons-ichat-uninstaller.pkg.zip, 1332792003, 2
trollicons-digsby.zip, 1332792003, 17
trollicons-chrome.zip, 1332792003, 14
+trollicons.colloquyEmoticons.zip, 1333301470, 20
+trollicons.AdiumEmoticonset.zip, 1333301470, 232
+trollicons-trillian.zip, 1333301470, 38
+trollicons-pidgin.zip, 1333301470, 127
+trollicons-miranda.zip, 1333301470, 31
+trollicons-ichat.pkg.zip, 1333301470, 18
+trollicons-ichat-uninstaller.pkg.zip, 1333301470, 2
+trollicons-digsby.zip, 1333301470, 17
+trollicons-chrome.zip, 1333301470, 15