Skip to content

Instantly share code, notes, and snippets.

@pbausch
Last active April 18, 2018 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbausch/eff59590d0c0ca8aa107903abb36c760 to your computer and use it in GitHub Desktop.
Save pbausch/eff59590d0c0ca8aa107903abb36c760 to your computer and use it in GitHub Desktop.
Add one-click Basecamp applause boosts with Tampermonkey
// ==UserScript==
// @name Basecamp Applause Boost
// @namespace https://www.onfocus.com/
// @version 0.1
// @description Create an applause boost button
// @author Paul Bausch
// @match https://3.basecamp.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var player = document.createElement('audio');
player.src = 'https://www.onfocus.com/Mario-coin-sound.mp3';
player.preload = 'auto';
$('.boost-form').each(function( index ) {
var button = $('<div class="boost boost-form"><span class="emoji boost-form__label" style="background:none;font-size:1.3em;">👏</span></div>').css('background','none');
button.click(function() {
$(this).prev().find('label').click();
$(this).prev().find('#boost_content').val('👏');
$(this).prev().find('input[name="commit"]').click();
player.play();
});
$(this).after(button);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment