Skip to content

Instantly share code, notes, and snippets.

View Armaxis's full-sized avatar

Artem Chubaryan Armaxis

View GitHub Profile
@Armaxis
Armaxis / emoji_bitbucket.js
Last active March 16, 2017 18:33
Custom JS for Bitbucket that adds few buttons
//This custom JS adds few missing features to Bitbucket's code review tool
//1) emoji buttons to Edit page to easily mark Pull Request
//2) 'No whitespaces' button is added next to 'Commits' and 'Activity' and reloads the page with whitespaces diff turned off.
//I'm not familiar with JS or jQuery, so this code is ugly and could be much better. But it works, so I have that going for me which is nice
//I used Chrome Extension to enable usage of this code: https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija?hl=en
//Reference to last focused text field
var lastFocused;
$("input[type='text']").focus(function() {
lastFocused = document.activeElement;