Skip to content

Instantly share code, notes, and snippets.

@chrisinajar
Created October 14, 2012 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisinajar/3889750 to your computer and use it in GitHub Desktop.
Save chrisinajar/3889750 to your computer and use it in GitHub Desktop.
better chat window
// Make a bookmark with this in it:
javascript:(function(){$("#button-chat-expand").click(function() {$("#chat").animate({top:0})}); $("#button-chat-collapse").click(function() {$("#chat").animate({top:285})});$("#chat").css($("#playback").position()).width(842);$("#chat-messages").width(823); $.each(document.styleSheets, function(i, styleSheet) { $.each(styleSheet.cssRules, function(j, rule) { if (rule.selectorText == '.chat-message, .chat-mention, .chat-emote, .chat-skip, .chat-moderation, .chat-system, .chat-update' || rule.selectorText == '.chat-superuser' || rule.selectorText == '.chat-moderator') rule.style.width = '788px'; })});})();
@pantlesswonder
Copy link

Here's a quick way of making css changes on the fly for plug.fm, probably not the cleanest thing in the world but good for development.
The various rules are pretty useful for modding the chat window to take up the space where the video used to be.

var rules = [];
rules.push('#playback { display: none !important; }');
rules.push('#chat { width: 842px !important; left: 521px !important; }');
rules.push('#chat-input-field {width: 788px !important; }');
rules.push('#bottom-chat-line {width: 842px !important; }');
rules.push('#top-chat-line {width: 842px !important; }');
rules.push('#chat-header {width: 842px !important; }');
rules.push('#chat-messages { width: 827px !important; }');
rules.push('.chat-message, .chat-mention, .chat-emote, .chat-skip, .chat-moderation, .chat-system, .chat-update { width: 802px !important; }');
rules.push('#chat-mention-suggestion { left: 526px !important; }');
window.customStyle.innerHTML = rules.join(' ');

@pantlesswonder
Copy link

window.customStyle = document.createElement('style');
document.head.appendChild(window.customStyle);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment