Skip to content

Instantly share code, notes, and snippets.

@collin
Created July 23, 2009 18:39
Show Gist options
  • Select an option

  • Save collin/153373 to your computer and use it in GitHub Desktop.

Select an option

Save collin/153373 to your computer and use it in GitHub Desktop.
jetpack.future.import("pageMods");
function callback(document) {
jQuery(document).bind('DOMNodeInserted', function(event) {
var node = jQuery(event.target);
console.log(node.html())
if(node.is(':not(.message)')) return;
if(node.find('.body').text().match(/collin|colin/i))
jetpack.notifications.show({
title: node.find('.person').text(),
body: node.find('.body').text(),
icon: 'http://www.campfirenow.com/favicon.ico'});
});
}
jetpack.pageMods.add(callback, {
matches: ["https://*.campfirenow.com/room/*"]
});
<link rel="jetpack" href="http://gist.github.com/raw/153373/f1e90446126c8b113fa33bc63d1c4a5b2002db14/campfire_notificaitons.jetpack.js" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment