Skip to content

Instantly share code, notes, and snippets.

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 cyu/90771 to your computer and use it in GitHub Desktop.
Save cyu/90771 to your computer and use it in GitHub Desktop.
Fixes a clipping issue when running Campfire in Fluid
// ==UserScript==
// @name Fix Chat ViewPort width
// @namespace http://blog.codeeg.com
// @description Fix clipping of campfire chats
// @include *
// @author Calvin Yu
// ==/UserScript==
(function () {
if (window.fluid) {
Campfire.LayoutManager.prototype.adjustChatMessageColumnWidth = function() {
if (this.chat.IE && !this.chat.IE7) return false;
var viewportWidth = this.getChatViewportWidth();
var authorColumnWidth = this.getChatAuthorColumnWidth();
var messageColumnWidth = viewportWidth - authorColumnWidth - 15;
var stylesheet = $A(document.styleSheets).last();
var rules = stylesheet.cssRules || stylesheet.rules;
var style = rules[rules.length - 1].style;
if (style) style.width = messageColumnWidth + 'px';
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment