Last active
December 19, 2015 06:09
-
-
Save jeffrafter/5909617 to your computer and use it in GitHub Desktop.
A Theme for Slack or This is my theme for English B.
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
// What?! http://stackoverflow.com/a/5571069/700536 | |
function multiline(f) { | |
return f.toString(). | |
replace(/^[^\/]+\/\*!?/, ''). | |
replace(/\*\/[^\/]+$/, ''); | |
} | |
var overrides = multiline(function() {/*! | |
#messages_container { | |
background-color: #dfdfdf; | |
} | |
*/}); | |
$('head').append("<style>"+overrides+"</style>"); | |
var audio = document.createElement('audio'); | |
$(audio).attr('src', "http://meaganproctorkavouras.com/levi.wav"); | |
TS.ui.sounds.new_message = audio; | |
TS.ui.playSound('new_message'); | |
// Leave reset false when you say something | |
function say(message, skipReset) { | |
if (!skipReset) { | |
window.channels = []; | |
$('a.channel_name').each(function() { | |
window.channels.push($(this).attr('href').replace('/channels/', '')); | |
}); | |
} | |
setTimeout(function() { | |
if (window.channels.length == 0) return; | |
var chan = window.channels.pop(); | |
$('#message-input').val('/open '+chan); | |
$('#message-input').parents('form').submit(); | |
setTimeout(function() { | |
$('#message-input').val(message); | |
$('#message-input').parents('form').submit(); | |
say(message, true); | |
}, 100); | |
}, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment