collin (owner)

Revisions

gist: 153373 Download_button fork
public
Public Clone URL: git://gist.github.com/153373.git
Embed All Files: show embed
campfire_notificaitons.jetpack.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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/*"]
});
jetpack_installer.html #
1
<link rel="jetpack" href="http://gist.github.com/raw/153373/f1e90446126c8b113fa33bc63d1c4a5b2002db14/campfire_notificaitons.jetpack.js" />