Last active
April 18, 2018 20:56
-
-
Save pbausch/eff59590d0c0ca8aa107903abb36c760 to your computer and use it in GitHub Desktop.
Add one-click Basecamp applause boosts with Tampermonkey
This file contains hidden or 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
// ==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