Skip to content

Instantly share code, notes, and snippets.

@omarstreak
Created September 26, 2016 19:08
Show Gist options
  • Save omarstreak/efe82c4e38fd3310e460925be2f0f9fc to your computer and use it in GitHub Desktop.
Save omarstreak/efe82c4e38fd3310e460925be2f0f9fc to your computer and use it in GitHub Desktop.
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