1
Fork 0

I don't know what I did, but it fixed things?!

This commit is contained in:
Jake Howard 2015-08-21 12:52:38 +01:00
parent b3b169f0f3
commit 4bc4b791c2
6 changed files with 45 additions and 11 deletions

View file

@ -6,8 +6,10 @@ for (var i = 0; i < sites.length; i++) {
pattern = Object.keys(sites[i])[0];
script = sites[i][pattern];
content_scripts = ["./lib/jquery.js", "./image-lookup.js", "./injections/" + script];
console.log('pattern: ' + pattern);
console.log('content_scripts: ' + content_scripts);
pageMod.PageMod({
include: pattern,
contentScriptFile: content_scripts
contentScriptFile: content_scripts,
});
}

View file

@ -1,4 +1,4 @@
var image_decoder = {
"as" : "https://dujrsrsgsd3nh.cloudfront.net/img/emoticons/23362/noot-1438871175.png"
"form" : "https://dujrsrsgsd3nh.cloudfront.net/img/emoticons/23362/noot-1438871175.png"
}
console.log("Image Decoder imported");

View file

@ -11,26 +11,32 @@ function change_chat_tabs() {
}
$('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', function() { // Something changes inside the chat tab
$('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', function() { // Something changes inside the chat tab
change_chat_tabs();
});
$('._d97').on('change load', function(){ // Chat Bubble messages
$('._d97').on('change load', function(){ // Chat Bubble messages
change_chat_tabs();
});
$('.fbNubButton').on('click', function() { // Facebook tab button is clicked
$('.fbNubButton').on('click', function() { // Facebook tab button is clicked
change_chat_tabs();
});
$('._55ln').on('click', function() { //Facebook sidebar person is clicked
$('._55ln').on('click', function() { //Facebook sidebar person is clicked
change_chat_tabs();
})
$('._552m').on('input paste', function() { // Text change in textbox. Mainly used to cover all bases
$('._552m').on('input paste', function() { // Text change in textbox. Mainly used to cover all bases
change_chat_tabs();
});
$(window).on('load', function() { // When window loads
change_chat_tabs();
});
alert("Facebook");

24
src/injections/github.js Normal file
View file

@ -0,0 +1,24 @@
function change_comments() {
$('.comment-body').each(function() {
for (var i = 0; i < image_decoder.length; i++) {
console.log('Checking for ' + image_decoder[i][0])
$(this).html($(this).html().replace(
image_decoder[i][0],
"<img style='height: 30px; width: 30px;' src='" + image_decoder[i][1] + "'/>"
));
}
});
}
$("button.btn[name='comment_and_close']").prev().on('click', function(){ // When the comment button is clicked
change_comments();
});
$('.js-comment-container').on('load change', function(){ // when another comment comes in
change_comments();
});
$(window).on('load', function(){ // When window loads
change_comments();
});
alert("Github");

1
src/lib/jquery.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
{
"sites": [
{"*.facebook.com":"facebook.js"}
{"*.facebook.com":"facebook.js"},
{"*.github.com":"github.js"}
]
}