From 91da22e8278c7cda4216f878708df087dd8b528a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 24 Aug 2015 22:15:12 +0100 Subject: [PATCH] Added jquery $ and better format for events --- src/injections/facebook.js | 16 ++++------------ src/injections/github.js | 12 ++++-------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/injections/facebook.js b/src/injections/facebook.js index bebd4d3..2c5ff50 100644 --- a/src/injections/facebook.js +++ b/src/injections/facebook.js @@ -3,24 +3,16 @@ function change_chat_tabs() { inject_image('._d97', 'emoticon'); } - -jq('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', function() { // Something changes inside the chat tab - change_chat_tabs(); +$('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', change_chat_tabs); }); - -jq('._d97').on('change load', function(){ // Chat Bubble messages - change_chat_tabs(); +$('._d97').on('change load', change_chat_tabs); }); - -jq('.fbNub').on('click', function() { // Facebook tab button is clicked - change_chat_tabs(); +$('.fbNub').on('click', change_chat_tabs); }); - -jq('._55ln').on('click', function() { //Facebook sidebar person is clicked - change_chat_tabs(); +$('._55ln').on('click', change_chat_tabs); }) change_chat_tabs(); \ No newline at end of file diff --git a/src/injections/github.js b/src/injections/github.js index 44b9c17..6a1cd1a 100644 --- a/src/injections/github.js +++ b/src/injections/github.js @@ -5,19 +5,15 @@ function change_comments() { function change_readme() { console.log("readme event"); - inject_image('.comment-body'); + inject_image('#readme'); } +$("button.btn[name='comment_and_close']").prev().on('click', change_comments); - -jq("button.btn[name='comment_and_close']").prev().on('click', function(){ // When the comment button is clicked - change_comments(); +$('.js-comment-container').on('load change', change_comments); }); - -jq('.js-comment-container').on('load change', function(){ // when another comment comes in - change_comments(); -}); +$('#readme').on('load change', change_readme); change_comments();