Created
September 26, 2016 19:08
-
-
Save omarstreak/efe82c4e38fd3310e460925be2f0f9fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMNodeInserted', function(e){ | |
if(e.target.classList.contains('An')){ | |
addButton(e.target); | |
} | |
}); | |
$('.An').forEach(addButton); | |
function addButton(composeNode){ | |
var button = $('<div class="wG J-Z-I"><div class="J-J5-Ji J-Z-I-Kv-H"><div class="J-J5-Ji J-Z-I-J6-H"><div class="aA7 aaA aMZ"><img src="//composeIcon" /></div></div></div></div>'); | |
button.click(function(e){ | |
//30 lines of code to insert "Hello World" into the right position | |
}); | |
button.hover( | |
function(){button.addClass('J-Z-I-JW');}, | |
function(){button.removeClass('J-Z-I-JW');} | |
) | |
composeWindow.find('.gU.Up > .J-J5-Ji').append(button); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment