-
-
Save austintaylor/1eddb0394e94988813b0 to your computer and use it in GitHub Desktop.
My customizations for Slack in Fluid.app
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
.bot_message { | |
background: #F2F2F2 !important; | |
border-top: 8px solid #F2F2F2; | |
color: #666; | |
margin: 0 !important; | |
} | |
.message { | |
margin: 4px 0; | |
} | |
.message_content { | |
margin-left: 200px !important; | |
} | |
.message_content > .message_sender { | |
position: absolute !important; | |
width: 130px !important; | |
left: 80px !important; | |
text-align: right !important; | |
white-space: nowrap; | |
text-transform: capitalize; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} | |
.bot_label { | |
display: none !important; | |
} | |
#channel_creator_name { | |
display: none !important; | |
} | |
.inline_attachment[data-real-src*=".giphy.com"] { | |
display: none; | |
} |
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
var clickOverrides = function(){ | |
// Automatically mark ALL as read and scroll to it | |
// when clicking on a channel (stared or normal) | |
$('#channel-list, #starred-list').on('click',function(){ | |
TS.ui.forceMarkAllRead(); | |
TS.ui.scrollMsgsSoFirstUnreadMsgIsInView(); | |
}); | |
}; | |
var onMessageClick = function(){ | |
TS.ui.forceMarkAllRead(); | |
TS.ui.scrollMsgsSoFirstUnreadMsgIsInView(); | |
}; | |
// Setup and use notification center! Yay. | |
function wkNotify(title,content,clickCallBack) { | |
if (!window.Notification) { | |
console.log('not supported'); | |
return; | |
} | |
if (Notification.permission === 'denied') { | |
console.log("Can't show notification here"); | |
} else if (Notification.permission === 'default') { | |
// Get permission | |
Notification.requestPermission(function() { | |
notify(); | |
}); | |
} else if (Notification.permission === 'granted') { | |
var wkNotification = window.webkitNotifications.createNotification(null, title, content); | |
if(typeof clickCallBack === "function"){ | |
wkNotification.onclick = clickCallBack; | |
} | |
// Show that thing! | |
try {wkNotification.show();} | |
catch (e) {alert('error: '+e);} | |
} | |
} | |
// override the growl and use notification center | |
// wait 10 seconds for everything to load, then do this | |
setTimeout(function(){ | |
clickOverrides(); | |
wkNotify("Loaded custom scripts",""); | |
TS.ui.growls.show = function(title, text, a,b,c){ | |
wkNotify(title,text,onMessageClick); | |
}; | |
},10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment